org.jutil
Class TReflect
java.lang.Object
org.jutil.TReflect
public final class TReflect
- extends java.lang.Object
This is the TReflect utility code class.
|
Constructor Summary |
TReflect()
Ensure that no one can create instances of this Class. |
|
Method Summary |
static java.lang.reflect.Method[] |
getMethodsWithPrefix(java.lang.Class clss,
java.lang.String prefix)
|
static java.lang.Object |
getProperty(java.lang.Object o,
java.lang.String name)
|
static boolean |
hasMethodPrefix(java.lang.reflect.Method method,
java.lang.String prefix)
|
static boolean |
isGetMethod(java.lang.reflect.Method method)
|
static boolean |
isHasMethod(java.lang.reflect.Method method)
|
static boolean |
isIsMethod(java.lang.reflect.Method method)
|
static boolean |
isSetMethod(java.lang.reflect.Method method)
|
static void |
setProperty(java.lang.Object obj,
java.lang.String name,
java.lang.String value)
Find a method with the right name
If found, call the method ( if param is int or boolean we'll convert value to
the right type before) - that means you can have setDebug(1). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE_PRIMITIVE_BOOLEAN
public static final java.lang.String TYPE_PRIMITIVE_BOOLEAN
- See Also:
- Constant Field Values
TYPE_BOOLEAN
public static final java.lang.String TYPE_BOOLEAN
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_BYTE
public static final java.lang.String TYPE_PRIMITIVE_BYTE
- See Also:
- Constant Field Values
TYPE_BYTE
public static final java.lang.String TYPE_BYTE
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_CHARACTER
public static final java.lang.String TYPE_PRIMITIVE_CHARACTER
- See Also:
- Constant Field Values
TYPE_CHARACTER
public static final java.lang.String TYPE_CHARACTER
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_INTEGER
public static final java.lang.String TYPE_PRIMITIVE_INTEGER
- See Also:
- Constant Field Values
TYPE_INTEGER
public static final java.lang.String TYPE_INTEGER
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_SHORT
public static final java.lang.String TYPE_PRIMITIVE_SHORT
- See Also:
- Constant Field Values
TYPE_SHORT
public static final java.lang.String TYPE_SHORT
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_LONG
public static final java.lang.String TYPE_PRIMITIVE_LONG
- See Also:
- Constant Field Values
TYPE_LONG
public static final java.lang.String TYPE_LONG
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_FLOAT
public static final java.lang.String TYPE_PRIMITIVE_FLOAT
- See Also:
- Constant Field Values
TYPE_FLOAT
public static final java.lang.String TYPE_FLOAT
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_DOUBLE
public static final java.lang.String TYPE_PRIMITIVE_DOUBLE
- See Also:
- Constant Field Values
TYPE_DOUBLE
public static final java.lang.String TYPE_DOUBLE
- See Also:
- Constant Field Values
TYPE_PRIMITIVE_VOID
public static final java.lang.String TYPE_PRIMITIVE_VOID
- See Also:
- Constant Field Values
TYPE_VOID
public static final java.lang.String TYPE_VOID
- See Also:
- Constant Field Values
TYPE_STRING
public static final java.lang.String TYPE_STRING
- See Also:
- Constant Field Values
TReflect
public TReflect()
- Ensure that no one can create instances of this Class.
setProperty
public static final void setProperty(java.lang.Object obj,
java.lang.String name,
java.lang.String value)
throws java.lang.SecurityException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
- Find a method with the right name
If found, call the method ( if param is int or boolean we'll convert value to
the right type before) - that means you can have setDebug(1).
USAGE:
- Throws:
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
getMethodsWithPrefix
public static final java.lang.reflect.Method[] getMethodsWithPrefix(java.lang.Class clss,
java.lang.String prefix)
getProperty
public static java.lang.Object getProperty(java.lang.Object o,
java.lang.String name)
hasMethodPrefix
public static final boolean hasMethodPrefix(java.lang.reflect.Method method,
java.lang.String prefix)
isSetMethod
public static final boolean isSetMethod(java.lang.reflect.Method method)
isGetMethod
public static final boolean isGetMethod(java.lang.reflect.Method method)
isHasMethod
public static final boolean isHasMethod(java.lang.reflect.Method method)
isIsMethod
public static final boolean isIsMethod(java.lang.reflect.Method method)