Package xmlparser.utils
Enum Reflection
java.lang.Object
java.lang.Enum<Reflection>
xmlparser.utils.Reflection
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Reflection>,java.lang.constant.Constable
public enum Reflection extends java.lang.Enum<Reflection>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReflection.ClassTypestatic classReflection.FieldType -
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.Class<?>,java.lang.Class<?>>PRIMITIVE_TO_OBJECT -
Method Summary
Modifier and Type Method Description static java.lang.reflect.FielddetermineTypeOfFields(java.lang.Class<?> clazz, java.lang.Object o, java.util.List<java.lang.reflect.Field> attributes, java.util.List<java.lang.reflect.Field> childNodes)static java.lang.Class<?>findAbstractType(XmlAbstractClass annotation, XmlElement node)static java.lang.ObjectinvokeFieldDeserializer(java.lang.reflect.Field f, XmlElement element)static booleanisAbstract(java.lang.reflect.Field f)static booleanisList(java.lang.Class<?> c)static booleanisMap(java.lang.Class<?> c)static booleanisSet(java.lang.Class<?> c)static booleanisSimple(java.lang.Class<?> c)static booleanisWrapped(java.lang.reflect.Field f)static java.util.List<java.lang.reflect.Field>listFields(java.lang.Class<?> type)static java.util.List<java.lang.reflect.Field>listFields(java.util.List<java.lang.reflect.Field> fields, java.lang.Class<?> type)static voidsetField(java.lang.reflect.Field field, java.lang.Object object, java.lang.Object value)static java.lang.Class<?>toClassOfCollection(java.lang.reflect.Field f)static java.lang.Class<?>toClassOfMapKey(java.lang.reflect.ParameterizedType type)static java.lang.Class<?>toClassOfMapValue(java.lang.reflect.ParameterizedType type)static Reflection.ClassTypetoClassType(java.lang.Class<?> c, Interfaces.AccessSerializers s)static Reflection.FieldTypetoFieldType(java.lang.reflect.Field f)static java.lang.StringtoName(java.lang.Class<?> o)static java.lang.StringtoName(java.lang.reflect.Field field)static <T> java.lang.Class<T>toObjectClass(java.lang.Class<T> clazz)static java.lang.StringtoWrappedName(java.lang.reflect.Field f)static ReflectionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Reflection[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Field Details
-
PRIMITIVE_TO_OBJECT
public static final java.util.Map<java.lang.Class<?>,java.lang.Class<?>> PRIMITIVE_TO_OBJECT
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
determineTypeOfFields
public static java.lang.reflect.Field determineTypeOfFields(java.lang.Class<?> clazz, java.lang.Object o, java.util.List<java.lang.reflect.Field> attributes, java.util.List<java.lang.reflect.Field> childNodes) throws java.lang.IllegalAccessException- Throws:
java.lang.IllegalAccessException
-
toFieldType
-
toClassType
public static Reflection.ClassType toClassType(java.lang.Class<?> c, Interfaces.AccessSerializers s) -
listFields
public static java.util.List<java.lang.reflect.Field> listFields(java.lang.Class<?> type) -
listFields
public static java.util.List<java.lang.reflect.Field> listFields(java.util.List<java.lang.reflect.Field> fields, java.lang.Class<?> type) -
isSimple
public static boolean isSimple(java.lang.Class<?> c) -
isList
public static boolean isList(java.lang.Class<?> c) -
isSet
public static boolean isSet(java.lang.Class<?> c) -
isMap
public static boolean isMap(java.lang.Class<?> c) -
isWrapped
public static boolean isWrapped(java.lang.reflect.Field f) -
toWrappedName
public static java.lang.String toWrappedName(java.lang.reflect.Field f) -
isAbstract
public static boolean isAbstract(java.lang.reflect.Field f) -
findAbstractType
-
toName
public static java.lang.String toName(java.lang.Class<?> o) -
toName
public static java.lang.String toName(java.lang.reflect.Field field) -
toClassOfCollection
public static java.lang.Class<?> toClassOfCollection(java.lang.reflect.Field f) -
toClassOfMapKey
public static java.lang.Class<?> toClassOfMapKey(java.lang.reflect.ParameterizedType type) -
toClassOfMapValue
public static java.lang.Class<?> toClassOfMapValue(java.lang.reflect.ParameterizedType type) -
toObjectClass
public static <T> java.lang.Class<T> toObjectClass(java.lang.Class<T> clazz) -
invokeFieldDeserializer
public static java.lang.Object invokeFieldDeserializer(java.lang.reflect.Field f, XmlElement element) -
setField
public static void setField(java.lang.reflect.Field field, java.lang.Object object, java.lang.Object value)
-