Interface LOAD

All Known Implementing Classes:
LOADImpl

public interface LOAD
The LOAD utility provides a hook from hand written Java loaders into the instance population of a component.
  • Method Summary

    Modifier and Type
    Method
    Description
    call_function(String function_name, Object... args)
    Invoke an xtUML domain function in the same component which originally created the instance of LOAD.
    create(String key_letters)
    Create an xtUML class instance.
    void
    load(String java_class, String[] args)
    Create a new loader with a given set of arguments and kick off the loading process.
    void
    load2(String[] args)
    Kick off the loading process with the given set of arguments.
    void
    relate(Object inst1, Object inst2, int rel_num, String phrase)
    Relate two xtUML instances together across the given relationship.
    void
    relate_using(Object inst1, Object inst2, Object link, int rel_num, String phrase)
    Relate three xtUML instances together across the given associative relationship.
    void
    set_attribute(Object instance, String attribute_name, Object value)
    Set the value of an attribute on an instance of an xtUML class.
    void
    Set the default loader for the utility.
  • Method Details

    • load

      void load(String java_class, String[] args) throws XtumlException
      Create a new loader with a given set of arguments and kick off the loading process. An instance of the class specified by the java_class parameter is created. The specified class is expected to implement the IGenericLoader interface. Once created, the load method of the loader will be invoked, passing args and an instance of the LOAD class to link call back in to the instance population.
      Parameters:
      java_class - the fully qualified class name of the loader class to create
      args - the list of arguments to pass to the loader class
      Throws:
      XtumlException - if the class specified by java_class cannot be loaded or if it does not implement the IGenericLoader interface or if the loader itself throws an error
      See Also:
    • load2

      void load2(String[] args) throws XtumlException
      Kick off the loading process with the given set of arguments. The load method of the loader will be invoked, passing args and an instance of the LOAD class to link call back in to the instance population.
      Parameters:
      args - the list of arguments to pass to the loader class
      Throws:
      XtumlException - if the loader itself throws an error
      See Also:
    • setDefaultLoader

      void setDefaultLoader(IGenericLoader loader)
      Set the default loader for the utility.
      Parameters:
      loader - the new default loader
      See Also:
    • create

      Object create(String key_letters) throws XtumlException
      Create an xtUML class instance.
      Parameters:
      key_letters - the key letters of the xtUML class
      Returns:
      an instance handle to the newly created class instance
      Throws:
      XtumlException - if no class with matching key letters can be found in the component
    • relate

      void relate(Object inst1, Object inst2, int rel_num, String phrase) throws XtumlException
      Relate two xtUML instances together across the given relationship. For non-reflexive relationships, inst1 and inst2 are interchangeable and the value of phrase has no effect. It may be null. For reflexive relationships, inst1 and inst2 will "read across" according to the value of phrase with the same semantics as OAL.
      Parameters:
      inst1 - the first instance to relate
      inst2 - the second instance to relate
      rel_num - the relationship number to create
      phrase - the text phrase used to disambiguate relates of reflexive relationships
      Throws:
      XtumlException - if the relationship specified does not exist between inst1 and inst2 or if the act of relating the instances results in a model integrity violation
    • relate_using

      void relate_using(Object inst1, Object inst2, Object link, int rel_num, String phrase) throws XtumlException
      Relate three xtUML instances together across the given associative relationship. For non-reflexive relationships, inst1 and inst2 are interchangeable and the value of phrase has no effect. It may be null. For reflexive relationships, inst1 and inst2 will "read across" according to the value of phrase with the same semantics as OAL.
      Parameters:
      inst1 - the first instance to relate
      inst2 - the second instance to relate
      link - the associative instance to relate
      rel_num - the relationship number to create
      phrase - the text phrase used to disambiguate relates of reflexive relationships
      Throws:
      XtumlException - if the relationship specified does not exist between inst1 and inst2 or if the act of relating the instances results in a model integrity violation
    • set_attribute

      void set_attribute(Object instance, String attribute_name, Object value) throws XtumlException
      Set the value of an attribute on an instance of an xtUML class.
      Parameters:
      instance - the model class instance
      attribute_name - the name of the attribute to set
      value - the value to assign to the specified attribute
      Throws:
      XtumlException - if the specified attribute does not exist on the class or if the type of the passed value is not compatible with the attribute type
    • call_function

      Object call_function(String function_name, Object... args) throws XtumlException
      Invoke an xtUML domain function in the same component which originally created the instance of LOAD.
      Parameters:
      function_name - The name of the domain function to invoke
      args - The argument list in modeled order
      Returns:
      The result of the function invocation or null for functions with void return type
      Throws:
      XtumlException - if the a domain function could not be found with the given names, or if the number of arguments or types of arguments mismatch