|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.util.obj.ReflectionUtil
public final class ReflectionUtil
This class includes some utilities to be used with reflection. This are mostly used by the Encog generic persistence classes.
Method Summary | ||
---|---|---|
static Field |
findField(Class<?> c,
String name)
Find the specified field, look also in superclasses. |
|
static Collection<Field> |
getAllFields(Class<?> c)
Get all of the fields from the specified class as a collection. |
|
static void |
getAllFields(Class<?> c,
Collection<Field> fields)
Get all of the fields in the specified class and super classes. |
|
static boolean |
isInstanceOf(Class<?> class1,
Class<?> class2)
Determine if one class is an instance of the other class. |
|
static boolean |
isPrimitive(Object obj)
Determine if the specified object is a primitive. |
|
static boolean |
isSimple(Object obj)
Determine if an object is "simple", that is it should be persisted just with a .tostring. |
|
static void |
loadClassmap()
Load the classmap file. |
|
static void |
loadStandardClassmap()
Load the classmap file. |
|
static Class<?> |
resolveEncogClass(String name)
Resolve an encog class using its simple name. |
|
static Object |
resolveEnum(Field field,
String value)
Resolve an enumeration. |
|
static
|
safeHashCode(T o)
Generate a hash code for an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Field findField(Class<?> c, String name)
c
- The class to search.name
- The name of the field we are looking for.
public static Collection<Field> getAllFields(Class<?> c)
c
- The class to access.
public static void getAllFields(Class<?> c, Collection<Field> fields)
c
- The class to check.fields
- A collection to hold the classes.public static boolean isInstanceOf(Class<?> class1, Class<?> class2)
class1
- The class to check.class2
- Is class1 an instance of class 2.
public static boolean isPrimitive(Object obj)
obj
- The object to check.
public static boolean isSimple(Object obj)
obj
- The object to check.
public static void loadStandardClassmap()
public static void loadClassmap()
public static Class<?> resolveEncogClass(String name)
name
- The simple name of the class.
public static Object resolveEnum(Field field, String value)
field
- The field to resolve.value
- The value to get the enum for.
public static <T> int safeHashCode(T o)
T
- The type of object to generate for.o
- The object to generate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |