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 TypeMethodDescriptioncall_function
(String function_name, Object... args) Invoke an xtUML domain function in the same component which originally created the instance ofLOAD
.Create an xtUML class instance.void
Create a new loader with a given set of arguments and kick off the loading process.void
Kick off the loading process with the given set of arguments.void
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
setDefaultLoader
(IGenericLoader loader) Set the default loader for the utility.
-
Method Details
-
load
Create a new loader with a given set of arguments and kick off the loading process. An instance of the class specified by thejava_class
parameter is created. The specified class is expected to implement theIGenericLoader
interface. Once created, theload
method of the loader will be invoked, passingargs
and an instance of theLOAD
class 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_class
cannot be loaded or if it does not implement theIGenericLoader
interface or if the loader itself throws an error- See Also:
-
load2
Kick off the loading process with the given set of arguments. Theload
method of the loader will be invoked, passingargs
and an instance of theLOAD
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
Set the default loader for the utility.- Parameters:
loader
- the new default loader- See Also:
-
create
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
Relate two xtUML instances together across the given relationship. For non-reflexive relationships,inst1
andinst2
are interchangeable and the value ofphrase
has no effect. It may benull
. For reflexive relationships,inst1
andinst2
will "read across" according to the value ofphrase
with 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,inst1
andinst2
are interchangeable and the value ofphrase
has no effect. It may benull
. For reflexive relationships,inst1
andinst2
will "read across" according to the value ofphrase
with 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
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
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
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
-