|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jbind.util.reflect.ReflectUtil
Static utility methods for the generator.
Method Summary | |
static java.lang.String |
getTypeName(java.lang.Class aClass)
Returns the type name of the specified class. |
static java.lang.Class |
getWrapperClass(java.lang.Class aClass)
|
static java.util.List |
removeSubClasses(java.util.Collection aClasses)
Removes all classes from the specified collection that have a (real) super class in the collection. |
static void |
setMembers(java.lang.Object anObject,
java.util.Map aMap)
Tries to set the members of an object by their setter-methods if there is a corresponding value in the map. |
static java.util.List |
sortClasses(java.util.Collection aClasses)
Sorts the classes according to their subclass relationship. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String getTypeName(java.lang.Class aClass)
public static java.util.List removeSubClasses(java.util.Collection aClasses)
aClasses
- The classes that are considered. (required)
public static java.util.List sortClasses(java.util.Collection aClasses)
aClasses
- The classes to sort. (required)
public static final java.lang.Class getWrapperClass(java.lang.Class aClass)
public static void setMembers(java.lang.Object anObject, java.util.Map aMap) throws java.lang.Exception
The method proceeds by iterating over all methods of the object selecting those whose method names have the prefix "set". The member name is derived as the remaining part of the method name (possibly an upper and lower case first letter). For each such method it is tested the map contains a value for the corresponding member name and if the method needs a single parameter to set the member. If both conditions are true, it is tested if the value in the map is assignment compatible with the parameter class of the setter method. If this is not the case than it is tried to construct a suitable parameter object from the value. Finally the setter method is called.
anObject
- (required).aMap
- (required). The values that are set are removed from
the map. Therefore the success of the method may be checked by testing
the map for emptiness.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |