|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.utils.IntrospectionUtils
com.ge.research.acuity.utils.IntrospectionUtils
Introspection utilities for acuity ui models, with specific convienence methods for getting and setting presentation object attribute values without explicit knowledge of the attribute meaning or presentation object sub-type. These tools help us achieve a very generic methodology by which we handle the creation and reading of presentation objects.
| Constructor Summary | |
IntrospectionUtils()
|
|
| Method Summary | |
static boolean |
equalsPOParamValue(PresentationObject po,
java.lang.String param,
java.lang.Object value)
Convienence method for testing equality of the supplied value to the current value of a presentation object attribute without knowing the explicit method signature, but just knowing the parameter name. |
static ControllerInterface |
getNewControllerInterface(java.lang.String classname,
AcuityController controller)
Convienence method for instanciating a ControllerInterface
once the specific implementation class is identified. |
static ControllerInterface |
getNewControllerInterface(java.lang.String classname,
java.lang.String controllerClassname,
java.lang.String policyFile,
java.lang.String instanceFile,
java.lang.String instanceURI,
java.lang.String user,
java.lang.String pwd,
int traceLevel)
Convienence method for instanciating a ControllerInterface
once the specific implementation class is identified. |
static GraphRenderer |
getNewGraphRenderer(java.lang.String classname)
Convienence method for instanciating a GraphRenderer
once the specific implementation class is identified. |
static java.lang.Object |
getPOParamValue(PresentationObject po,
java.lang.reflect.Field f)
Convienence method for getting the current value of a presentation object attribute without knowing the explicit method signature, but just knowing the class field. |
static java.lang.Object |
getPOParamValue(PresentationObject po,
java.lang.String param)
Convienence method for getting the current value of a presentation object attribute without knowing the explicit method signature, but just knowing the parameter name. |
static void |
setPOAttribute(PresentationObject po,
PresentationParameterMap ppm,
java.util.Map poSetterMethodMap,
java.lang.String parameter,
java.lang.Object value)
This method looks at the type of data contained in the value parameter and creates an Object[] array and inserts into it values from the value parameter
and then invokes the setter method with the new values |
static void |
setPODefaultValue(PresentationObject po,
java.lang.String defaultValue)
Invokes the setDefaultValue(s) method on the presentation object (depending on its type)
using the value of defaultValue as the argument |
static void |
setSelectionPOChoices(SelectionPO po,
java.util.Map choices)
Invokes the SelectionPO.addChoice(java.lang.Object, java.lang.Object)
method on the po argument using the information contained in the choices map.
|
static java.util.Map |
setupPOSetterMethodMap(PresentationObject po)
Gets a list of the accessible methods for the presentation object (including methods defined in super classes) and determines which of those are simple "setters" and complex "setters" or "adders". |
| Methods inherited from class com.ge.research.utils.IntrospectionUtils |
getAllInheritedClasses, getAllInheritedClasses, getAllMembers, getMember, getMemberType, getMemberValue, getMemberValue, getMethod, getMethod, getNewInstance, getNewInstance, getNewInstance, getNewInstance, getPrimitiveClass, invokeMethod |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IntrospectionUtils()
| Method Detail |
public static final boolean equalsPOParamValue(PresentationObject po,
java.lang.String param,
java.lang.Object value)
po - the presentation object to useparam - the parameter name to get the value forvalue - The value of the parameter to test against the value of the parameter of the presentation object
true if the argument value and the presentation object's parameter value are the same;
false otherwise;getPOParamValue(com.ge.research.acuity.ui.PresentationObject, java.lang.String)
public static final ControllerInterface getNewControllerInterface(java.lang.String classname,
java.lang.String controllerClassname,
java.lang.String policyFile,
java.lang.String instanceFile,
java.lang.String instanceURI,
java.lang.String user,
java.lang.String pwd,
int traceLevel)
throws AcuityException,
java.lang.IllegalArgumentException
ControllerInterface
once the specific implementation class is identified.
classname - the ControllerInterface class to instantiate
ControllerInterface
AcuityException - If an error occurs creating an instance of the AcuityController
java.lang.IllegalArgumentException
public static final ControllerInterface getNewControllerInterface(java.lang.String classname,
AcuityController controller)
throws java.lang.IllegalArgumentException
ControllerInterface
once the specific implementation class is identified.
classname - the ControllerInterface class to instantiate
ControllerInterface
java.lang.IllegalArgumentExceptionpublic static final GraphRenderer getNewGraphRenderer(java.lang.String classname)
GraphRenderer
once the specific implementation class is identified.
classname - the GraphRenderer class to instantiate
GraphRenderer
public static final java.lang.Object getPOParamValue(PresentationObject po,
java.lang.reflect.Field f)
po - the presentation object to usef - the field to get the value for
null if the value is null or if some error occurs trying to obtain the current valueIntrospectionUtils.getMethod(java.lang.Class, java.lang.String, java.lang.Class[]),
com.ge.research.utils.IntrospectionUtils#invokeMethod(java.lang.reflect.Method, java.lang.Object, javba.lang.Object[])
public static final java.lang.Object getPOParamValue(PresentationObject po,
java.lang.String param)
po - the presentation object to useparam - the parameter name to get the value for
null if the value is null or if some error occurs trying to obtain the current valueIntrospectionUtils.getMemberType(java.lang.Object, java.lang.String),
IntrospectionUtils.getMethod(java.lang.Class, java.lang.String, java.lang.Class[]),
IntrospectionUtils.invokeMethod(java.lang.reflect.Method, java.lang.Object, java.lang.Object[])
public static final java.util.Map setupPOSetterMethodMap(PresentationObject po)
throws java.lang.SecurityException
po - the presentation object to introspect and find attribute setting methods for
Method
java.lang.SecurityException - If the presentation object is not accessible
public static final void setPOAttribute(PresentationObject po,
PresentationParameterMap ppm,
java.util.Map poSetterMethodMap,
java.lang.String parameter,
java.lang.Object value)
Object[] array and inserts into it values from the value parameter
and then invokes the setter method with the new values
po - the presentation object to act onppm - the presentation parameter map with desired attribute values, from the ontologypoSetterMethodMap - a map of the presentation objects settable attributes to their setter Methodsparameter - the current parameter/attribute to be setvalue - the current value for the parameter/attribute to be set to
public static final void setPODefaultValue(PresentationObject po,
java.lang.String defaultValue)
setDefaultValue(s) method on the presentation object (depending on its type)
using the value of defaultValue as the argument
po - the presentation object to usedefaultValue - the value to use for the setDefaultValue(s) method
public static final void setSelectionPOChoices(SelectionPO po,
java.util.Map choices)
SelectionPO.addChoice(java.lang.Object, java.lang.Object)
method on the po argument using the information contained in the choices map.
The contents of the map are iterated over and the addChoice method is invoked for each entry found.
po - the presentation object to usechoices - map of choice "values" to choice "display strings"
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||