|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.ReflectionUtil
public class ReflectionUtil
Some general reflection utility methods.
| Constructor Summary | |
|---|---|
ReflectionUtil()
|
|
| Method Summary | |
|---|---|
static Object |
getOuter(Object object)
Returns a reference to an inner object's outer class reference, or null if
the object represents an instance of a static class. |
static Class<?> |
getOuterClass(Class<?> clazz)
Returns the outer class for the given inner class (or null if not an inner
class). |
static boolean |
isInner(Class<?> clazz)
Determines whether the specified class is a non-static inner class. |
static Object |
newInstance(Class<?> clazz)
Creates a new instance of the specified class. |
static Object |
newInstance(Class<?> clazz,
Object outer)
Creates a new instance of the specified (possibly inner) class. |
static Object |
newInstance(String classname)
Creates a new instance of the named class. |
static Object |
newInstance(String classname,
Object outer)
Creates a new instance of the named inner class. |
static void |
setOuter(Object object,
Object outer)
Sets an inner object's outer class reference if it has one. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectionUtil()
| Method Detail |
|---|
public static Object newInstance(String classname)
classname - the name of the class to instantiate.
public static Object newInstance(String classname,
Object outer)
classname - the name of the class to instantiate.outer - an instance of the enclosing class.public static Object newInstance(Class<?> clazz)
clazz - the class to instantiate.
public static Object newInstance(Class<?> clazz,
Object outer)
clazz - the class to instantiate.outer - for inner classes, a reference to the enclosing instance (otherwise
null).
null if there was some error
(in which case a message will be logged).
public static void setOuter(Object object,
Object outer)
public static Object getOuter(Object object)
null if
the object represents an instance of a static class.
public static boolean isInner(Class<?> clazz)
public static Class<?> getOuterClass(Class<?> clazz)
null if not an inner
class).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||