Package oms3

Class 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 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 annotation
        lazy - 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 -
      • rangeCheck

        public static void rangeCheck​(Object comp,
                                      boolean in,
                                      boolean out)
                               throws Exception
        Throws:
        Exception