| java.lang.Object org.jaffa.persistence.engines.jdbcengine.util.Introspection
Introspection | public class Introspection (Code) | | Helper class for introspecting Domain objects.
|
Method Summary | |
public static Field | getAccessibleField(Class clazz, String fieldName, Class datatype) This method will introspect the input class for for a Field object having the same name as the input fieldName.
If no Field is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Field will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the Field object is to be found. Parameters: datatype - This is an optional input. | public static Method | getAccessorMethod(Class clazz, String fieldName, Class datatype) This method will introspect the input class for an accessor Method object - getFieldName() or isFieldName()
If no Method is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Method will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the accessor is to be found. Parameters: datatype - This is an optional input. | public static Map | getAccessors(Class clazz, Map fields, Map members) This will introspect the input Class for an AccessibleObject, for each of the input fieldName passed in the 'fields' Map.
For each fieldName, this method will introspect the input class for an AccessibleObject in the following order.
1- If an entry exists for the fieldName in the members Map, search for a Field object having the same name as that memberName
2- Else search for a Method object - getFieldName() or isFieldName()
3- If no AccessibleObject is found, then recursively call itself for each parent class.
It will return a Map of key=fieldName/value=Field/Method object pairs.
The returnType of the Field/Method will have to match the type passed in the input 'fields' Map.
NOTE: An inaccessible Field/Method will be forced to be accessible !!
No exception is raised, in case an appropriate method is not found for a fieldName.
The calling class can always compare the size of the input Map with the Map returned by this method,
and raise suitable exceptions.
Parameters: clazz - The class to be introspected. Parameters: fields - The key of this HashMap is the name of the field (String) and the value is the data type (String). Parameters: members - This map will contain the fields which are to be introspected by using member variables as opposed to getters/setters. | public static Method | getMutatorMethod(Class clazz, String fieldName, Class datatype) This method will introspect the input class for a mutator Method object - setFieldName().
If no Method is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Method will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the mutator is to be found. Parameters: datatype - This is an optional input. | public static Map | getMutators(Class clazz, Map fields, Map members) This will introspect the input Class for an AccessibleObject, for each of the input fieldName passed in the 'fields' Map.
For each fieldName, this method will introspect the input class for an AccessibleObject in the following order.
1- If an entry exists for the fieldName in the members Map, search for a Field object having the same name as that memberName
2- Else search for a Method object - setFieldName(Object obj)
3- If no AccessibleObject is found, then recursively call itself for each parent class.
It will return a Map of key=fieldName/value=Field/Method object pairs.
The returnType/paramter of the Field/Method will have to match the type passed in the input 'fields' Map.
NOTE: An inaccessible Field/Method will be forced to be accessible !!
No exception is raised, in case an appropriate method is not found for a fieldName.
The calling class can always compare the size of the input Map with the Map returned by this method,
and raise suitable exceptions.
Parameters: clazz - The class to be introspected. Parameters: fields - The key of this HashMap is the name of the field (String) and the value is the data type (String). Parameters: members - This map will contain the fields which are to be introspected by using member variables as opposed to getters/setters. |
getAccessibleField | public static Field getAccessibleField(Class clazz, String fieldName, Class datatype)(Code) | | This method will introspect the input class for for a Field object having the same name as the input fieldName.
If no Field is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Field will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the Field object is to be found. Parameters: datatype - This is an optional input. If passed then it'll ensure that the Field object has the correct signature. the for a Field object having the same name as the input fieldName. A null is returned, in case the field doesn't exist. |
getAccessorMethod | public static Method getAccessorMethod(Class clazz, String fieldName, Class datatype)(Code) | | This method will introspect the input class for an accessor Method object - getFieldName() or isFieldName()
If no Method is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Method will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the accessor is to be found. Parameters: datatype - This is an optional input. If passed then it'll ensure that the accessor has the correct signature. the accessor Method for the property. A null is returned, in case the property doesn't exist. |
getAccessors | public static Map getAccessors(Class clazz, Map fields, Map members)(Code) | | This will introspect the input Class for an AccessibleObject, for each of the input fieldName passed in the 'fields' Map.
For each fieldName, this method will introspect the input class for an AccessibleObject in the following order.
1- If an entry exists for the fieldName in the members Map, search for a Field object having the same name as that memberName
2- Else search for a Method object - getFieldName() or isFieldName()
3- If no AccessibleObject is found, then recursively call itself for each parent class.
It will return a Map of key=fieldName/value=Field/Method object pairs.
The returnType of the Field/Method will have to match the type passed in the input 'fields' Map.
NOTE: An inaccessible Field/Method will be forced to be accessible !!
No exception is raised, in case an appropriate method is not found for a fieldName.
The calling class can always compare the size of the input Map with the Map returned by this method,
and raise suitable exceptions.
Parameters: clazz - The class to be introspected. Parameters: fields - The key of this HashMap is the name of the field (String) and the value is the data type (String). Parameters: members - This map will contain the fields which are to be introspected by using member variables as opposed to getters/setters. The key of this HashMap is the name of the field (String) and the value is the memberName (String). a map of key=fieldName/value=Field/Method object pairs. |
getMutatorMethod | public static Method getMutatorMethod(Class clazz, String fieldName, Class datatype)(Code) | | This method will introspect the input class for a mutator Method object - setFieldName().
If no Method is found, then it'll recursively call itself for each parent class.
NOTE: An inaccessible Method will be forced to be accessible !!
Parameters: clazz - The class to be introspected. Parameters: fieldName - The fieldName for which the mutator is to be found. Parameters: datatype - This is an optional input. If passed then it'll ensure that the mutator has the correct signature. the mutator Method for the property. A null is returned, in case the property doesn't exist. |
getMutators | public static Map getMutators(Class clazz, Map fields, Map members)(Code) | | This will introspect the input Class for an AccessibleObject, for each of the input fieldName passed in the 'fields' Map.
For each fieldName, this method will introspect the input class for an AccessibleObject in the following order.
1- If an entry exists for the fieldName in the members Map, search for a Field object having the same name as that memberName
2- Else search for a Method object - setFieldName(Object obj)
3- If no AccessibleObject is found, then recursively call itself for each parent class.
It will return a Map of key=fieldName/value=Field/Method object pairs.
The returnType/paramter of the Field/Method will have to match the type passed in the input 'fields' Map.
NOTE: An inaccessible Field/Method will be forced to be accessible !!
No exception is raised, in case an appropriate method is not found for a fieldName.
The calling class can always compare the size of the input Map with the Map returned by this method,
and raise suitable exceptions.
Parameters: clazz - The class to be introspected. Parameters: fields - The key of this HashMap is the name of the field (String) and the value is the data type (String). Parameters: members - This map will contain the fields which are to be introspected by using member variables as opposed to getters/setters. The key of this HashMap is the name of the field (String) and the value is the memberName (String). a map of key=fieldName/value=Field/Method object pairs. |
|
|