/** * A simple but efficient method for getting the interfaces for a class type, * this has some shortcuts for the common types like maps, lists, etc.<br/> * Only returns the interfaces for the current type and not for all nested types * * @param type any class type * @return the list of interfaces (empty if none) */ public static List<Class<?>> getInterfacesForClass(Class<?> type) { ArrayList<Class<?>> interfaces = new ArrayList<Class<?>>(); // find the actual interfaces from the class itself for (Class<?> iface : type.getInterfaces()) { interfaces.add(iface); } // add in the collection interface if this is a collection if ( isClassCollection(type) ) { if ( isClassList(type) ) { interfaces.add(List.class); } else if ( Set.class.isAssignableFrom(type)) { interfaces.add(Set.class); } interfaces.add(Collection.class); } else if ( isClassMap(type) ) { interfaces.add(Map.class); } return interfaces; }
/** * A simple but efficient method for getting the interfaces for a class type, * this has some shortcuts for the common types like maps, lists, etc.<br/> * Only returns the interfaces for the current type and not for all nested types * * @param type any class type * @return the list of interfaces (empty if none) */ public static List<Class<?>> getInterfacesForClass(Class<?> type) { ArrayList<Class<?>> interfaces = new ArrayList<Class<?>>(); // find the actual interfaces from the class itself for (Class<?> iface : type.getInterfaces()) { interfaces.add(iface); } // add in the collection interface if this is a collection if ( isClassCollection(type) ) { if ( isClassList(type) ) { interfaces.add(List.class); } else if ( Set.class.isAssignableFrom(type)) { interfaces.add(Set.class); } interfaces.add(Collection.class); } else if ( isClassMap(type) ) { interfaces.add(Map.class); } return interfaces; }
} else if (SortedMap.class.isAssignableFrom(type)) { toType = (Class<T>) TreeMap.class; } else if ( isClassList(type) ) {
} else if (SortedMap.class.isAssignableFrom(type)) { toType = (Class<T>) TreeMap.class; } else if ( isClassList(type) ) {
throw new IllegalArgumentException("Failed to set index ("+index+") for array of size ("+Array.getLength(indexedObject)+") to value: " + value, e); } else if ( ConstructorUtils.isClassList(indexedObject.getClass()) ) {
throw new IllegalArgumentException("Failed to set index ("+index+") for array of size ("+Array.getLength(indexedObject)+") to value: " + value, e); } else if ( ConstructorUtils.isClassList(indexedObject.getClass()) ) {
indexedObject = obj; isArray = true; } else if ( ConstructorUtils.isClassList(obj.getClass()) ) { indexedObject = obj; } else {
indexedObject = obj; isArray = true; } else if ( ConstructorUtils.isClassList(obj.getClass()) ) { indexedObject = obj; } else {