/** * Determine if an object is a map * @param object any object * @return true if the object is a map */ private boolean isObjectMap(Object object) { boolean map = false; if (object != null) { Class clazz = object.getClass(); map = ConstructorUtils.isClassMap(clazz); } return map; }
/** * 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 ( ConstructorUtils.isClassMap(fromType) ) {
Map<String, Object> map = null; if (clone != null) { if ( ConstructorUtils.isClassMap(clone.getClass())) { map = (Map<String, Object>) clone; } else {
Map<String, Object> map = null; if (clone != null) { if ( ConstructorUtils.isClassMap(clone.getClass())) { map = (Map<String, Object>) clone; } else {
} else if (Set.class.isAssignableFrom(type)) { toType = (Class<T>) HashSet.class; } else if ( isClassMap(type) ) { toType = (Class<T>) ArrayOrderedMap.class; } else if ( isClassCollection(type) ) {
} else if ( ConstructorUtils.isClassMap(fromType) ) {
} else if (Set.class.isAssignableFrom(type)) { toType = (Class<T>) HashSet.class; } else if ( isClassMap(type) ) { toType = (Class<T>) ArrayOrderedMap.class; } else if ( isClassCollection(type) ) {
/** * @param type any class * @return true if this is a collection, map, or array, * something that holds a bunch of objects (e.g. {@link Map}, {@link Set}, {@link List}, array) */ public static boolean isClassObjectHolder(Class<?> type) { checkNull(type); boolean holder = false; if ( isClassArray(type) || isClassCollection(type) || isClassMap(type) ) { holder = true; } return holder; }
/** * @param type any class * @return true if this is a collection, map, or array, * something that holds a bunch of objects (e.g. {@link Map}, {@link Set}, {@link List}, array) */ public static boolean isClassObjectHolder(Class<?> type) { checkNull(type); boolean holder = false; if ( isClassArray(type) || isClassCollection(type) || isClassMap(type) ) { holder = true; } return holder; }
i++; } else if ( ConstructorUtils.isClassMap(fromType) ) {
i++; } else if ( ConstructorUtils.isClassMap(fromType) ) {
i++; } else if ( ConstructorUtils.isClassMap(fromType) ) {
i++; } else if ( ConstructorUtils.isClassMap(fromType) ) {
if ( ConstructorUtils.isClassMap(type)) { Map<String, Object> m = (Map)container.getContainer(); if (m.containsKey(key)) {
if ( ConstructorUtils.isClassMap(type)) { Map<String, Object> m = (Map)container.getContainer(); if (m.containsKey(key)) {
} else if ( ConstructorUtils.isClassMap(fromType) ) {
} else if ( ConstructorUtils.isClassMap(fromType) ) {
sb.append(" <type>array</type>\n"); sb.append(" <componentType>"+ArrayUtils.type((Object[])entity).getName()+"</componentType>\n"); } else if (ConstructorUtils.isClassMap(entityType)) { sb.append(" <type>map</type>\n"); String cType = "Component Class: " + ArrayUtils.type((Object[])entity).getName(); sb.append( makeResolveType("array", cType, locale)); } else if (ConstructorUtils.isClassMap(entityType)) {