Class ModelImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.model.impl.ModelImpl
-
-
Field Summary
-
Fields inherited from interface de.uni_trier.wi2.procake.data.model.Model
COMPONENT, COMPONENT_KEY, 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
Constructors Constructor Description ModelImpl()Constructor for ModelImpl.
-
Method Summary
-
-
-
Method Detail
-
addClass
public void addClass(DataClass newClass) throws NameAlreadyExistsException
Adds a class to the loaded classes. This might be useful if classes need to be added at runtime.- Specified by:
addClassin interfaceModel- Parameters:
newClass- an instance ofDataClassthat should be added to the list of classes- Throws:
NameAlreadyExistsException- if this class name already exists
-
containsClassName
protected boolean containsClassName(String name)
containsClassName.
- Parameters:
name- aStringobject- Returns:
- a boolean
-
getAggregateSystemClass
public AggregateClass getAggregateSystemClass()
- Specified by:
getAggregateSystemClassin interfaceModel
-
getAtomicSystemClass
public AtomicClass getAtomicSystemClass()
- Specified by:
getAtomicSystemClassin interfaceModel
-
getBooleanSystemClass
public BooleanClass getBooleanSystemClass()
- Specified by:
getBooleanSystemClassin interfaceModel
-
getByteArraySystemClass
public ByteArrayClass getByteArraySystemClass()
- Specified by:
getByteArraySystemClassin interfaceModel
-
getChronologicSystemClass
public ChronologicClass getChronologicSystemClass()
- Specified by:
getChronologicSystemClassin interfaceModel
-
getClass
public <T extends DataClass> T getClass(String className)
Searches in the Model for aDataClasswith the nameclassName.
-
getRootClass
public DataClassImpl getRootClass()
- Specified by:
getRootClassin interfaceModel
-
getClasses
public List<DataClass> getClasses()
- Specified by:
getClassesin interfaceModel- Returns:
- A list of all
DataClasses of the Model. This includes the system as well as the user classes.
-
getDefinedClasses
public Set<String> getDefinedClasses()
- Specified by:
getDefinedClassesin interfaceModel- Returns:
- A list of all defined
DataClasses of the Model. This includes only classes defined in the Model.
-
addDefinedClassReference
public void addDefinedClassReference(String className)
- Specified by:
addDefinedClassReferencein interfaceModel
-
getCollectionSystemClass
public CollectionClass getCollectionSystemClass()
- Specified by:
getCollectionSystemClassin interfaceModel
-
getUnionSystemClass
public UnionClass getUnionSystemClass()
- Specified by:
getUnionSystemClassin interfaceModel
-
getDataSystemClass
public DataClass getDataSystemClass()
- Specified by:
getDataSystemClassin interfaceModel
-
getDateSystemClass
public DateClass getDateSystemClass()
- Specified by:
getDateSystemClassin interfaceModel
-
getDoubleSystemClass
public DoubleClass getDoubleSystemClass()
- Specified by:
getDoubleSystemClassin interfaceModel
-
getIntegerSystemClass
public IntegerClass getIntegerSystemClass()
- Specified by:
getIntegerSystemClassin interfaceModel
-
getIntervalSystemClass
public IntervalClass getIntervalSystemClass()
- Specified by:
getIntervalSystemClassin interfaceModel
-
getListSystemClass
public ListClass getListSystemClass()
- Specified by:
getListSystemClassin interfaceModel
-
getNodeClass
public NodeClass getNodeClass()
- Specified by:
getNodeClassin interfaceModel
-
getNumericSystemClass
public NumericClass getNumericSystemClass()
- Specified by:
getNumericSystemClassin interfaceModel
-
getURISystemClass
public URIClass getURISystemClass()
- Specified by:
getURISystemClassin interfaceModel
-
getSequenceClass
public SequenceClass getSequenceClass()
- Specified by:
getSequenceClassin interfaceModel
-
getSetSystemClass
public SetClass getSetSystemClass()
- Specified by:
getSetSystemClassin interfaceModel
-
getStringSystemClass
public StringClass getStringSystemClass()
- Specified by:
getStringSystemClassin interfaceModel
-
getTaskClass
public TaskClass getTaskClass()
- Specified by:
getTaskClassin interfaceModel
-
getTimestampSystemClass
public TimestampClass getTimestampSystemClass()
- Specified by:
getTimestampSystemClassin interfaceModel
-
getTimeSystemClass
public TimeClass getTimeSystemClass()
- Specified by:
getTimeSystemClassin interfaceModel
-
getVoidSystemClass
public VoidClass getVoidSystemClass()
- Specified by:
getVoidSystemClassin interfaceModel
-
getWorkflowClass
public WorkflowClass getWorkflowClass()
- Specified by:
getWorkflowClassin interfaceModel
-
getSubWorkflowClass
public SubWorkflowClass getSubWorkflowClass()
- Specified by:
getSubWorkflowClassin interfaceModel
-
getDataflowWrapperClass
public DataflowWrapperClass getDataflowWrapperClass()
- Specified by:
getDataflowWrapperClassin interfaceModel
-
getNESTGraphClass
public NESTGraphClass getNESTGraphClass()
- Specified by:
getNESTGraphClassin interfaceModel
-
getNESTSequentialWorkflowClass
public NESTSequentialWorkflowClass getNESTSequentialWorkflowClass()
- Specified by:
getNESTSequentialWorkflowClassin interfaceModel
-
getNESTWorkflowClass
public NESTWorkflowClass getNESTWorkflowClass()
- Specified by:
getNESTWorkflowClassin interfaceModel
-
getNESTNodeClass
public NESTNodeClass getNESTNodeClass()
- Specified by:
getNESTNodeClassin interfaceModel
-
getNESTGraphItemClass
public NESTGraphItemClass getNESTGraphItemClass()
- Specified by:
getNESTGraphItemClassin interfaceModel
-
getNESTControlflowNodeClass
public NESTControlflowNodeClass getNESTControlflowNodeClass()
- Specified by:
getNESTControlflowNodeClassin interfaceModel
-
getNESTAndEndNodeClass
public NESTAndEndNodeClass getNESTAndEndNodeClass()
- Specified by:
getNESTAndEndNodeClassin interfaceModel
-
getNESTAndStartNodeClass
public NESTAndStartNodeClass getNESTAndStartNodeClass()
- Specified by:
getNESTAndStartNodeClassin interfaceModel
-
getNESTLoopStartNodeClass
public NESTLoopStartNodeClass getNESTLoopStartNodeClass()
- Specified by:
getNESTLoopStartNodeClassin interfaceModel
-
getNESTLoopEndNodeClass
public NESTLoopEndNodeClass getNESTLoopEndNodeClass()
- Specified by:
getNESTLoopEndNodeClassin interfaceModel
-
getNESTOrEndNodeClass
public NESTOrEndNodeClass getNESTOrEndNodeClass()
- Specified by:
getNESTOrEndNodeClassin interfaceModel
-
getNESTOrStartNodeClass
public NESTOrStartNodeClass getNESTOrStartNodeClass()
- Specified by:
getNESTOrStartNodeClassin interfaceModel
-
getNESTXorEndNodeClass
public NESTXorEndNodeClass getNESTXorEndNodeClass()
- Specified by:
getNESTXorEndNodeClassin interfaceModel
-
getNESTXorStartNodeClass
public NESTXorStartNodeClass getNESTXorStartNodeClass()
- Specified by:
getNESTXorStartNodeClassin interfaceModel
-
getNESTTaskNodeClass
public NESTTaskNodeClass getNESTTaskNodeClass()
- Specified by:
getNESTTaskNodeClassin interfaceModel
-
getNESTDataNodeClass
public NESTDataNodeClass getNESTDataNodeClass()
- Specified by:
getNESTDataNodeClassin interfaceModel
-
getNESTWorkflowNodeClass
public NESTWorkflowNodeClass getNESTWorkflowNodeClass()
- Specified by:
getNESTWorkflowNodeClassin interfaceModel
-
getNESTSubWorkflowNodeClass
public NESTSubWorkflowNodeClass getNESTSubWorkflowNodeClass()
- Specified by:
getNESTSubWorkflowNodeClassin interfaceModel
-
getNESTEdgeClass
public NESTEdgeClass getNESTEdgeClass()
- Specified by:
getNESTEdgeClassin interfaceModel
-
getNESTControlflowEdgeClass
public NESTControlflowEdgeClass getNESTControlflowEdgeClass()
- Specified by:
getNESTControlflowEdgeClassin interfaceModel
-
getNESTConstraintEdgeClass
public NESTConstraintEdgeClass getNESTConstraintEdgeClass()
- Specified by:
getNESTConstraintEdgeClassin interfaceModel
-
getNESTDataflowEdgeClass
public NESTDataflowEdgeClass getNESTDataflowEdgeClass()
- Specified by:
getNESTDataflowEdgeClassin interfaceModel
-
getNESTPartOfEdgeClass
public NESTPartOfEdgeClass getNESTPartOfEdgeClass()
- Specified by:
getNESTPartOfEdgeClassin interfaceModel
-
removeClass
protected void removeClass(DataClass newClass) throws IllegalEditException
removeClass.
- Parameters:
newClass- aDataClassobject- Throws:
IllegalEditException- if any.
-
removeClass
public void removeClass(String newClass) throws IllegalEditException
Removes aDataClassfrom the Model. After removing, theDataClasscannot be used any more. Reading is not possible.The
DataClasscan only be removed if no references to this class exists. For example, If the class has sub-classes or is used by anAggregateClassin an attribute anIllegalEditExceptionwill be thrown.- Specified by:
removeClassin interfaceModel- Parameters:
newClass- The name of theDataClassthat 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- aStringobjectnewName- aStringobject- 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 ClassNotFoundException
Creates the CAKE I - object defined with the given parameters. Strongly typed return.- Specified by:
createObjectin 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:
ClassNotFoundException
-
overwriteMatchingDataClasses
public void overwriteMatchingDataClasses(Model oldModel)
Another data Model can be provided and all of the containingDataClasses matching the current class hierarchy will be reused in this Model, i.e. references of theDataClasses will be replaced and merged into the hierarchy including subClassLists and superclass references.- Specified by:
overwriteMatchingDataClassesin interfaceModel
-
overwriteSubClasses
public void overwriteSubClasses(DataClass currentRootClass, List<DataClass> oldSubClasses)
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
public <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)- Specified by:
createObjectin interfaceModel- Parameters:
name- The internal name of the CAKE-class to instantiate.- Returns:
- A new instantiated object.
-
-