Interface Model
-
- All Known Implementing Classes:
ModelImpl
public interface Model
TheModel
is the container of allDataClass
es.Each
DataClass
belongs to exact oneModel
and each Model contains a unique list ofDataClass
es.The Model provides several methods (
getXSystemClass()
) to access the system classes directly. To receive an arbitrary class use the methodgetClass(String)
. The name of the system classes can be accessed by the constantCLASS_NAME
that is defined in eachDataClass
, e.g.IntegerClass.CLASS_NAME
.Conceptually, the Model can be interpreted as the namespace of a
DataClass
. It is possible to have severalDataClass
es with the same name in the system. But they must belong to different Models.New
DataClass
es can be created by using the methodDataClass.createSubclass(String)
. The new data class will be automatically added to the Model. To remove a data class use the methodremoveClass(String)
.- Author:
- Rainer Maximini
- See Also:
DataClass
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT
Component: "cake.data.model" (@link LogComponentIdentifier#COMPONENT})static String
COMPONENT_KEY
Component-Key: "00" (LogComponentIdentifier.COMPONENT_KEY_MODEL
)static String
LOG_CANNOT_REMOVE_CLASS_WITH_SUBCLASSES
Removal of this class failed - There are still subclasses.static String
LOG_CANNOT_REMOVE_SYSTEM_CLASS
The removal of this class is not allowed.static String
LOG_CANNOT_RENAME_SYSTEM_CLASS
The renaming of this class is not allowed.static String
LOG_CLASS_NAME_ALREADY_EXIST
A class with this name already exists.static String
LOG_CLASSNAME_NOT_FOUND
This class could not be found Component:COMPONENT
Key: "0006" thisstatic String
LOG_CREATE_SYSTEMCLASSTREE
The creation of the system-classes failed at this class.static String
LOG_OBJECT_INSTANTIATION
The object could not be instantiated.static String
LOG_ROOT_CLASS_INSTANTIATION
The root-class can not be instantiated.
-
Method Summary
-
-
-
Field Detail
-
COMPONENT
static final String COMPONENT
Component: "cake.data.model" (@link LogComponentIdentifier#COMPONENT})- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key: "00" (LogComponentIdentifier.COMPONENT_KEY_MODEL
)- See Also:
- Constant Field Values
-
LOG_CANNOT_REMOVE_CLASS_WITH_SUBCLASSES
static final String LOG_CANNOT_REMOVE_CLASS_WITH_SUBCLASSES
Removal of this class failed - There are still subclasses.- Component:
COMPONENT
- Key: "0007"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_CANNOT_REMOVE_SYSTEM_CLASS
static final String LOG_CANNOT_REMOVE_SYSTEM_CLASS
The removal of this class is not allowed.- Component:
COMPONENT
- Key: "0005"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_CANNOT_RENAME_SYSTEM_CLASS
static final String LOG_CANNOT_RENAME_SYSTEM_CLASS
The renaming of this class is not allowed.- Component:
COMPONENT
- Key: "0004"
- this
- New name
- See Also:
- Constant Field Values
- Component:
-
LOG_CLASS_NAME_ALREADY_EXIST
static final String LOG_CLASS_NAME_ALREADY_EXIST
A class with this name already exists.- Component:
COMPONENT
- Key: "0001"
- this
- Classname
- See Also:
- Constant Field Values
- Component:
-
LOG_CLASSNAME_NOT_FOUND
static final String LOG_CLASSNAME_NOT_FOUND
This class could not be found- Component:
COMPONENT
- Key: "0006"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_CREATE_SYSTEMCLASSTREE
static final String LOG_CREATE_SYSTEMCLASSTREE
The creation of the system-classes failed at this class.- Component:
COMPONENT
- Key: "0003"
- this
- Superclass
- See Also:
- Constant Field Values
- Component:
-
LOG_ROOT_CLASS_INSTANTIATION
static final String LOG_ROOT_CLASS_INSTANTIATION
The root-class can not be instantiated.- Component:
COMPONENT
- Key: "0002"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_OBJECT_INSTANTIATION
static final String LOG_OBJECT_INSTANTIATION
The object could not be instantiated.- Component:
COMPONENT
- Key: "0010"
- this
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
getAggregateSystemClass
AggregateClass getAggregateSystemClass()
-
getAtomicSystemClass
AtomicClass getAtomicSystemClass()
-
getBooleanSystemClass
BooleanClass getBooleanSystemClass()
-
getByteArraySystemClass
ByteArrayClass getByteArraySystemClass()
-
getChronologicSystemClass
ChronologicClass getChronologicSystemClass()
-
getClass
<T extends DataClass> T getClass(String className)
Searches in the Model for aDataClass
with the nameclassName
.
-
getClasses
List<DataClass> getClasses()
- Returns:
- A list of all
DataClass
es of the Model. This includes the system as well as the user classes.
-
getDefinedClasses
Set<String> getDefinedClasses()
- Returns:
- A list of all defined
DataClass
es of the Model. This includes only classes defined in the Model.
-
getCollectionSystemClass
CollectionClass getCollectionSystemClass()
-
getDataSystemClass
DataClass getDataSystemClass()
-
getDateSystemClass
DateClass getDateSystemClass()
-
getDoubleSystemClass
DoubleClass getDoubleSystemClass()
-
getIntegerSystemClass
IntegerClass getIntegerSystemClass()
-
getIntervalSystemClass
IntervalClass getIntervalSystemClass()
-
getListSystemClass
ListClass getListSystemClass()
-
getNumericSystemClass
NumericClass getNumericSystemClass()
-
getURISystemClass
URIClass getURISystemClass()
-
getRootClass
DataClassImpl getRootClass()
-
getSetSystemClass
SetClass getSetSystemClass()
-
getStringSystemClass
StringClass getStringSystemClass()
-
getTimestampSystemClass
TimestampClass getTimestampSystemClass()
-
getTimeSystemClass
TimeClass getTimeSystemClass()
-
getUnionSystemClass
UnionClass getUnionSystemClass()
-
getVoidSystemClass
VoidClass getVoidSystemClass()
-
getWorkflowClass
WorkflowClass getWorkflowClass()
-
getSubWorkflowClass
SubWorkflowClass getSubWorkflowClass()
-
getDataflowWrapperClass
DataflowWrapperClass getDataflowWrapperClass()
-
getTaskClass
TaskClass getTaskClass()
-
getNodeClass
NodeClass getNodeClass()
-
getSequenceClass
SequenceClass getSequenceClass()
-
getNESTGraphClass
NESTGraphClass getNESTGraphClass()
-
getNESTSequentialWorkflowClass
NESTSequentialWorkflowClass getNESTSequentialWorkflowClass()
-
getNESTWorkflowClass
NESTWorkflowClass getNESTWorkflowClass()
-
getNESTNodeClass
NESTNodeClass getNESTNodeClass()
-
getNESTGraphItemClass
NESTGraphItemClass getNESTGraphItemClass()
-
getNESTControlflowNodeClass
NESTControlflowNodeClass getNESTControlflowNodeClass()
-
getNESTAndEndNodeClass
NESTAndEndNodeClass getNESTAndEndNodeClass()
-
getNESTAndStartNodeClass
NESTAndStartNodeClass getNESTAndStartNodeClass()
-
getNESTLoopStartNodeClass
NESTLoopStartNodeClass getNESTLoopStartNodeClass()
-
getNESTLoopEndNodeClass
NESTLoopEndNodeClass getNESTLoopEndNodeClass()
-
getNESTOrEndNodeClass
NESTOrEndNodeClass getNESTOrEndNodeClass()
-
getNESTOrStartNodeClass
NESTOrStartNodeClass getNESTOrStartNodeClass()
-
getNESTXorEndNodeClass
NESTXorEndNodeClass getNESTXorEndNodeClass()
-
getNESTXorStartNodeClass
NESTXorStartNodeClass getNESTXorStartNodeClass()
-
getNESTTaskNodeClass
NESTTaskNodeClass getNESTTaskNodeClass()
-
getNESTDataNodeClass
NESTDataNodeClass getNESTDataNodeClass()
-
getNESTWorkflowNodeClass
NESTWorkflowNodeClass getNESTWorkflowNodeClass()
-
getNESTSubWorkflowNodeClass
NESTSubWorkflowNodeClass getNESTSubWorkflowNodeClass()
-
getNESTEdgeClass
NESTEdgeClass getNESTEdgeClass()
-
getNESTControlflowEdgeClass
NESTControlflowEdgeClass getNESTControlflowEdgeClass()
-
getNESTConstraintEdgeClass
NESTConstraintEdgeClass getNESTConstraintEdgeClass()
-
getNESTDataflowEdgeClass
NESTDataflowEdgeClass getNESTDataflowEdgeClass()
-
getNESTPartOfEdgeClass
NESTPartOfEdgeClass getNESTPartOfEdgeClass()
-
overwriteMatchingDataClasses
void overwriteMatchingDataClasses(Model other)
Another data Model can be provided and all of the containingDataClass
es matching the current class hierarchy will be reused in this Model, i.e. references of theDataClass
es will be replaced and merged into the hierarchy including subClassLists and superclass references.- Parameters:
other
-
-
removeClass
void removeClass(String className) throws IllegalEditException
Removes aDataClass
from the Model. After removing, theDataClass
cannot be used any more. Reading is not possible.The
DataClass
can only be removed if no references to this class exists. For example, If the class has sub-classes or is used by anAggregateClass
in an attribute anIllegalEditException
will be thrown.- Parameters:
className
- The name of theDataClass
that should be removed from the Model.- Throws:
IllegalEditException
- is thrown if a reference from another class exists
-
addClass
void addClass(DataClass clazz) throws NameAlreadyExistsException
Adds a class to the loaded classes. This might be useful if classes need to be added at runtime.- Parameters:
clazz
- an instance ofDataClass
that should be added to the list of classes- Throws:
NameAlreadyExistsException
- if this class name already exists
-
createObject
<TCakeDataClass extends DataClass,TCakeDataObject extends DataObject> TCakeDataObject createObject(Class<TCakeDataClass> clazz1, Class<TCakeDataObject> clazz2, String className) throws ClassNotFoundException
Creates the CAKE I - object defined with the given parameters. Strongly typed return.- Type Parameters:
TCakeDataClass
- The CAKE1-DataClass, which should be used for instantiating the CAKE1-DataObject.TCakeDataObject
- The CAKE1-DataObject, which should be returned by this method.- Parameters:
clazz1
- The CAKE1-DataClass, which should be used for instantiating the CAKE1-DataObject.clazz2
- The CAKE1-DataObject, which should be returned by this method.className
- The name of the CAKE1-class, which should be instantiated. This parameters is redundant to clazz1/clazz2 because they already pindown a specific class/object to instantiate, but due to lack of time we leave it this way.- Returns:
- The requested class
- Throws:
ClassNotFoundException
-
createObject
<T extends DataObject> T createObject(String name)
Creates the CAKE I - object defined with the given parameters. Weakly typed return (you have to cast for yourself)- Type Parameters:
T
-- Parameters:
name
- The internal name of the CAKE-class to instantiate.- Returns:
- A new instantiated object.
-
addDefinedClassReference
void addDefinedClassReference(String className)
- Parameters:
className
-
-
-