Package oms3
Class ComponentAccess
- java.lang.Object
-
- oms3.ComponentAccess
-
public class ComponentAccess extends Object
Component Access. This class manages reflective access to components internals for the purpose of their integration into a model.- Version:
- $Id$
- Author:
- od (odavid@colostate.edu)
-
-
Constructor Summary
Constructors Constructor Description ComponentAccess(Object cmd)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanadjustOutputPath(File outputDir, Object comp, Logger log)Adjust the output path.static voidcallAnnotated(Object o, Class<? extends Annotation> ann, boolean lazy)Call an method by Annotation.static Objectconv(Object inpValue, Class<?> fieldType)static PropertiescreateDefault(Object comp)Create a default parameter setstatic Stringdump(Object comp)ObjectgetComponent()Get the component that is wrapped in this access proxystatic ClassinfoClass(Class cmp)Get the info class for a component objectAccessinput(String field)Get a single input field.Collection<Access>inputs()Get the all the inputs.Accessoutput(String field)get a single output field.Collection<Access>outputs()Get the all the outputs.static voidrangeCheck(Object comp, boolean in, boolean out)static booleansetInputData(Map<String,Object> inp, Object comp, Logger log)Set the input data as map.
-
-
-
Constructor Detail
-
ComponentAccess
public ComponentAccess(Object cmd)
-
-
Method Detail
-
getComponent
public Object getComponent()
Get the component that is wrapped in this access proxy- Returns:
- the component
-
inputs
public Collection<Access> inputs()
Get the all the inputs.- Returns:
- list of input field access objects
-
outputs
public Collection<Access> outputs()
Get the all the outputs.- Returns:
- list of output field assess objects
-
input
public Access input(String field)
Get a single input field.- Parameters:
field- the name of the field- Returns:
- the input access object
-
output
public Access output(String field)
get a single output field.- Parameters:
field-- Returns:
- the output Field access object
-
callAnnotated
public static void callAnnotated(Object o, Class<? extends Annotation> ann, boolean lazy)
Call an method by Annotation.- Parameters:
o- the object to call.ann- the annotationlazy- if true, the a missing annotation is OK. if false the annotation has to be present or a Runtime exception is thrown.
-
infoClass
public static Class infoClass(Class cmp)
Get the info class for a component object- Parameters:
cmp-- Returns:
- the class that contains the annotations.
-
adjustOutputPath
public static boolean adjustOutputPath(File outputDir, Object comp, Logger log)
Adjust the output path.- Parameters:
outputDir-comp-log-- Returns:
- true is adjusted, false otherwise.
-
createDefault
public static Properties createDefault(Object comp)
Create a default parameter set- Parameters:
comp-- Returns:
- the default properties
-
setInputData
public static boolean setInputData(Map<String,Object> inp, Object comp, Logger log)
Set the input data as map.- Parameters:
inp-comp-log-
-
-