Interface LOAD
-
- All Known Implementing Classes:
LOADImpl
public interface LOADThe LOAD utility provides a hook from hand written Java loaders into the instance population of a component.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectcall_function(String function_name, Object... args)Invoke an xtUML domain function in the same component which originally created the instance ofLOAD.Objectcreate(String key_letters)Create an xtUML class instance.voidload(String java_class, String[] args)Create a new loader with a given set of arguments and kick off the loading process.voidrelate(Object inst1, Object inst2, int rel_num, String phrase)Relate two xtUML instances together across the given relationship.voidrelate_using(Object inst1, Object inst2, Object link, int rel_num, String phrase)Relate three xtUML instances together across the given associative relationship.voidset_attribute(Object instance, String attribute_name, Object value)Set the value of an attribute on an instance of an xtUML class.
-
-
-
Method Detail
-
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 thejava_classparameter is created. The specified class is expected to implement theIGenericLoaderinterface. Once created, theloadmethod of the loader will be invoked, passingargsand an instance of theLOADclass to link call back in to the instance population.- Parameters:
java_class- the fully qualified class name of the loader class to createargs- the list of arguments to pass to the loader class- Throws:
XtumlException- if the class specified byjava_classcannot be loaded or if it does not implement theIGenericLoaderinterface- See Also:
IGenericLoader
-
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,inst1andinst2are interchangeable and the value ofphrasehas no effect. It may benull. For reflexive relationships,inst1andinst2will "read across" according to the value ofphrasewith the same semantics as OAL.- Parameters:
inst1- the first instance to relateinst2- the second instance to relaterel_num- the relationship number to createphrase- 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,inst1andinst2are interchangeable and the value ofphrasehas no effect. It may benull. For reflexive relationships,inst1andinst2will "read across" according to the value ofphrasewith the same semantics as OAL.- Parameters:
inst1- the first instance to relateinst2- the second instance to relatelink- the associative instance to relaterel_num- the relationship number to createphrase- 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 instanceattribute_name- the name of the attribute to setvalue- 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 ofLOAD.- Parameters:
function_name- The name of the domain function to invokeargs- The argument list in modeled order- Returns:
- The result of the function invocation or
nullfor 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
-
-