Class ModelImpl
java.lang.Object
de.uni_trier.wi2.procake.data.model.impl.ModelImpl
- All Implemented Interfaces:
Model
ModelImpl class.
- Author:
- Rainer Maximini
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.data.model.Model
LOG_CANNOT_REMOVE_CLASS_WITH_SUBCLASSES, LOG_CANNOT_REMOVE_SYSTEM_CLASS, LOG_CANNOT_RENAME_SYSTEM_CLASS, LOG_CLASS_NAME_ALREADY_EXIST, LOG_CLASSNAME_NOT_FOUND, LOG_CREATE_SYSTEMCLASSTREE, LOG_OBJECT_INSTANTIATION, LOG_ROOT_CLASS_INSTANTIATION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a class to the loaded classes.void
addDefinedClassReference
(String className) protected boolean
containsClassName
(String name) containsClassName.<TCakeDataClass extends DataClass,
TCakeDataObject extends DataObject>
TCakeDataObjectcreateObject
(Class<TCakeDataClass> clazz1, Class<TCakeDataObject> clazz2, String className) Creates the CAKE I - object defined with the given parameters.<T extends DataObject>
TcreateObject
(String name) Creates the CAKE I - object defined with the given parameters.<T extends DataClass>
TSearches in the Model for aDataClass
with the nameclassName
.void
overwriteMatchingDataClasses
(Model oldModel) 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.void
overwriteSubClasses
(DataClass currentRootClass, List<DataClass> oldSubClasses) Replaces all old subclasses in the new model if they match the hierarchy of currentRootClass.protected void
removeClass
(DataClass newClass) removeClass.void
removeClass
(String newClass) Removes aDataClass
from the Model.protected void
renameClass
(String oldName, String newName) renameClass.
-
Constructor Details
-
ModelImpl
public ModelImpl()Constructor for ModelImpl.
-
-
Method Details
-
addClass
Adds a class to the loaded classes. This might be useful if classes need to be added at runtime.- Specified by:
addClass
in interfaceModel
- Parameters:
newClass
- an instance ofDataClass
that should be added to the list of classes- Throws:
NameAlreadyExistsException
- if this class name already exists
-
containsClassName
containsClassName.
- Parameters:
name
- aString
object- Returns:
- a boolean
-
getAggregateSystemClass
- Specified by:
getAggregateSystemClass
in interfaceModel
-
getAtomicSystemClass
- Specified by:
getAtomicSystemClass
in interfaceModel
-
getBooleanSystemClass
- Specified by:
getBooleanSystemClass
in interfaceModel
-
getByteArraySystemClass
- Specified by:
getByteArraySystemClass
in interfaceModel
-
getChronologicSystemClass
- Specified by:
getChronologicSystemClass
in interfaceModel
-
getClass
Searches in the Model for aDataClass
with the nameclassName
. -
getRootClass
- Specified by:
getRootClass
in interfaceModel
-
getClasses
- Specified by:
getClasses
in interfaceModel
- Returns:
- A list of all
DataClass
es of the Model. This includes the system as well as the user classes.
-
getDefinedClasses
- Specified by:
getDefinedClasses
in interfaceModel
- Returns:
- A list of all defined
DataClass
es of the Model. This includes only classes defined in the Model.
-
addDefinedClassReference
- Specified by:
addDefinedClassReference
in interfaceModel
-
getCollectionSystemClass
- Specified by:
getCollectionSystemClass
in interfaceModel
-
getUnionSystemClass
- Specified by:
getUnionSystemClass
in interfaceModel
-
getDataSystemClass
- Specified by:
getDataSystemClass
in interfaceModel
-
getDateSystemClass
- Specified by:
getDateSystemClass
in interfaceModel
-
getDoubleSystemClass
- Specified by:
getDoubleSystemClass
in interfaceModel
-
getIntegerSystemClass
- Specified by:
getIntegerSystemClass
in interfaceModel
-
getIntervalSystemClass
- Specified by:
getIntervalSystemClass
in interfaceModel
-
getListSystemClass
- Specified by:
getListSystemClass
in interfaceModel
-
getNodeClass
- Specified by:
getNodeClass
in interfaceModel
-
getNumericSystemClass
- Specified by:
getNumericSystemClass
in interfaceModel
-
getURISystemClass
- Specified by:
getURISystemClass
in interfaceModel
-
getSequenceClass
- Specified by:
getSequenceClass
in interfaceModel
-
getSetSystemClass
- Specified by:
getSetSystemClass
in interfaceModel
-
getStringSystemClass
- Specified by:
getStringSystemClass
in interfaceModel
-
getTaskClass
- Specified by:
getTaskClass
in interfaceModel
-
getTimestampSystemClass
- Specified by:
getTimestampSystemClass
in interfaceModel
-
getTimeSystemClass
- Specified by:
getTimeSystemClass
in interfaceModel
-
getVoidSystemClass
- Specified by:
getVoidSystemClass
in interfaceModel
-
getWorkflowClass
- Specified by:
getWorkflowClass
in interfaceModel
-
getSubWorkflowClass
- Specified by:
getSubWorkflowClass
in interfaceModel
-
getDataflowWrapperClass
- Specified by:
getDataflowWrapperClass
in interfaceModel
-
getNESTGraphClass
- Specified by:
getNESTGraphClass
in interfaceModel
-
getNESTSequentialWorkflowClass
- Specified by:
getNESTSequentialWorkflowClass
in interfaceModel
-
getNESTWorkflowClass
- Specified by:
getNESTWorkflowClass
in interfaceModel
-
getNESTNodeClass
- Specified by:
getNESTNodeClass
in interfaceModel
-
getNESTGraphItemClass
- Specified by:
getNESTGraphItemClass
in interfaceModel
-
getNESTControlflowNodeClass
- Specified by:
getNESTControlflowNodeClass
in interfaceModel
-
getNESTAndEndNodeClass
- Specified by:
getNESTAndEndNodeClass
in interfaceModel
-
getNESTAndStartNodeClass
- Specified by:
getNESTAndStartNodeClass
in interfaceModel
-
getNESTLoopStartNodeClass
- Specified by:
getNESTLoopStartNodeClass
in interfaceModel
-
getNESTLoopEndNodeClass
- Specified by:
getNESTLoopEndNodeClass
in interfaceModel
-
getNESTOrEndNodeClass
- Specified by:
getNESTOrEndNodeClass
in interfaceModel
-
getNESTOrStartNodeClass
- Specified by:
getNESTOrStartNodeClass
in interfaceModel
-
getNESTXorEndNodeClass
- Specified by:
getNESTXorEndNodeClass
in interfaceModel
-
getNESTXorStartNodeClass
- Specified by:
getNESTXorStartNodeClass
in interfaceModel
-
getNESTTaskNodeClass
- Specified by:
getNESTTaskNodeClass
in interfaceModel
-
getNESTDataNodeClass
- Specified by:
getNESTDataNodeClass
in interfaceModel
-
getNESTWorkflowNodeClass
- Specified by:
getNESTWorkflowNodeClass
in interfaceModel
-
getNESTSubWorkflowNodeClass
- Specified by:
getNESTSubWorkflowNodeClass
in interfaceModel
-
getNESTEdgeClass
- Specified by:
getNESTEdgeClass
in interfaceModel
-
getNESTControlflowEdgeClass
- Specified by:
getNESTControlflowEdgeClass
in interfaceModel
-
getNESTConstraintEdgeClass
- Specified by:
getNESTConstraintEdgeClass
in interfaceModel
-
getNESTDataflowEdgeClass
- Specified by:
getNESTDataflowEdgeClass
in interfaceModel
-
getNESTPartOfEdgeClass
- Specified by:
getNESTPartOfEdgeClass
in interfaceModel
-
removeClass
removeClass.
- Parameters:
newClass
- aDataClass
object- Throws:
IllegalEditException
- if any.
-
removeClass
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.- Specified by:
removeClass
in interfaceModel
- Parameters:
newClass
- The name of theDataClass
that should be removed from the Model.- Throws:
IllegalEditException
- is thrown if a reference from another class exists
-
renameClass
protected void renameClass(String oldName, String newName) throws NameAlreadyExistsException, IllegalEditException renameClass.
- Parameters:
oldName
- aString
objectnewName
- aString
object- Throws:
NameAlreadyExistsException
- if any.IllegalEditException
- if any.
-
createObject
public <TCakeDataClass extends DataClass,TCakeDataObject extends DataObject> TCakeDataObject createObject(Class<TCakeDataClass> clazz1, Class<TCakeDataObject> clazz2, String className) throws ProCAKEClassNotFoundException Creates the CAKE I - object defined with the given parameters. Strongly typed return.- Specified by:
createObject
in interfaceModel
- 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:
ProCAKEClassNotFoundException
-
overwriteMatchingDataClasses
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.- Specified by:
overwriteMatchingDataClasses
in interfaceModel
-
overwriteSubClasses
Replaces all old subclasses in the new model if they match the hierarchy of currentRootClass.The new class hierarchy is assumed to be the 'correct hierarchy'. The new hierarchy will be obtained whilst keeping all previous data class references that are already present.
- Parameters:
currentRootClass
- The new root data class which is assumed to be having the 'correct' class hierarchy and any matching class from the old class hierarchy will be merged into this class hierarchyoldSubClasses
- The old subclasses which get merged into the new class hierarchy
-
createObject
Creates the CAKE I - object defined with the given parameters. Weakly typed return (you have to cast for yourself)- Specified by:
createObject
in interfaceModel
- Parameters:
name
- The internal name of the CAKE-class to instantiate.- Returns:
- A new instantiated object.
-