Examples of elementTypeDescriptor()


Examples of org.springframework.core.convert.TypeDescriptor.elementTypeDescriptor()

    // if the object is something that looks indexable by an integer, attempt to treat the index value as a number
    if (targetObject instanceof Collection || targetObject.getClass().isArray() || targetObject instanceof String) {
      int idx = (Integer) state.convertValue(index, TypeDescriptor.valueOf(Integer.class));   
      if (targetObject.getClass().isArray()) {
        Object arrayElement = accessArrayElement(targetObject, idx);
        return new TypedValue(arrayElement, targetObjectTypeDescriptor.elementTypeDescriptor(arrayElement));
      } else if (targetObject instanceof Collection) {
        Collection c = (Collection) targetObject;
        if (idx >= c.size()) {
          if (!growCollection(state, targetObjectTypeDescriptor, idx, c)) {
            throw new SpelEvaluationException(getStartPosition(),SpelMessage.COLLECTION_INDEX_OUT_OF_BOUNDS, c.size(), idx);
View Full Code Here

Examples of org.springframework.core.convert.TypeDescriptor.elementTypeDescriptor()

          }
        }
        int pos = 0;
        for (Object o : c) {
          if (pos == idx) {
            return new TypedValue(o, targetObjectTypeDescriptor.elementTypeDescriptor(o));
          }
          pos++;
        }
      } else if (targetObject instanceof String) {
        String ctxString = (String) targetObject;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.