Class UnionClassImpl
- All Implemented Interfaces:
UnionClass
,DataClass
,PropertyHandler
UnionClassImpl class.
- Author:
- Rainer Maximini
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
CLASS_NAME, LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE, LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED, LOG_CLASS_NOT_EDITABLE, LOG_CLASS_NOT_INSTANTIABLE, LOG_EDITABLE_CLASS_NOT_INSTANTIABLE, LOG_FINISH_EDIT_FAILED, LOG_GET_SUPERCLASSES_FAILED, LOG_SUBCLASS_CREATION_FAILED
Fields inherited from interface de.uni_trier.wi2.procake.data.model.base.UnionClass
CLASS_NAME, LOG_EQUAL_ELEMENTCLASS, LOG_MISSING_ELEMENTCLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an additionalDataClass
to the list of data classesvoid
This method only checks if it is possible to finish the class and does not change any internal status.void
conformToModel
(Model other) Checks the list of data classes whether they conform to given model.createSubclass
(String name) This method creates none system sub classes that are defined by the user.protected void
createSystemSubClasses.getClasses.boolean
Checks if the givenDataClass
dataClass
is a member of the union.boolean
includeClass
(DataClass other) This method checks if the data class contains a reference to another data class.boolean
isUnion()
isUnion.Creates a newDataObject
and initialize it.void
Removes aDataClass
from the list of data classes.Methods inherited from class de.uni_trier.wi2.procake.data.model.impl.AbstractDataClassImpl
addProperty, addProperty, addSubclass, addSubClass, beSystemClass, checkEditability, checkInstantiability, clearSubClasses, createSystemClassTree, finishEditing, getAllProperties, getAllPropertyNodes, getModel, getName, getObjectClass, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, getRootClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, hasProperties, isAbstract, isAdaptationCase, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTAdaptationQuery, isNESTAdaptationRule, isNESTAdaptationSession, isNESTAdaptationStep, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTQuery, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isURI, isVoid, isWorkflow, isWorkflowCase, isWorkflowItem, removeProperty, removeSubclass, removeSubClass, setAbstract, setName, setPropertyRootNode, setSuperClass, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.data.model.DataClass
addSubclass, checkInstantiability, finishEditing, getModel, getName, getObjectClass, getSubClasses, getSuperClass, getSuperClasses, getSystemClassName, getSystemSuperClass, isAbstract, isAggregate, isAtomic, isBoolean, isByteArray, isCake2DataReference, isChronologic, isCollection, isControlflowItem, isDataflowWrapper, isDate, isDouble, isEditable, isInstantiable, isInteger, isInterval, isList, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTGraphItem, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isParentItem, isSequence, isSet, isString, isSubclassOf, isSubWorkflow, isSystemClass, isTask, isTime, isTimestamp, isURI, isVoid, isWorkflow, isWorkflowItem, removeSubclass, setAbstract, setName
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty, setPropertyRootNode
-
Constructor Details
-
UnionClassImpl
public UnionClassImpl()Constructor for UnionClassImpl.
-
-
Method Details
-
add
Adds an additionalDataClass
to the list of data classes- Specified by:
add
in interfaceUnionClass
- Parameters:
dataClass
- The new data class. If the data class is already in the list the new one will be ignored.- Throws:
IllegalEditException
-
checkFinishEditing
This method only checks if it is possible to finish the class and does not change any internal status. To initialize internal caches use the methodAbstractDataClassImpl.finishEditing()
.Sub classes are allowed to overwrite this method with own code but they must follow some instructions. It is very important to call the
AbstractDataClassImpl.checkFinishEditing()
method in the super class. This can be done before or after the own check methods. But it is advisable to implement the methods like inAbstractDataClassImpl.finishEditing()
where first the super class is called. For example:protected void checkFinishEditing() throws ClassHierarchyConsistencyException { super.checkFinishEditing(); // put your code here }
- Overrides:
checkFinishEditing
in classAbstractDataClassImpl
- Throws:
ClassHierarchyConsistencyException
- See Also:
-
createSystemSubClasses
protected void createSystemSubClasses()createSystemSubClasses.
- Specified by:
createSystemSubClasses
in classAbstractDataClassImpl
-
getClasses
getClasses.
- Specified by:
getClasses
in interfaceUnionClass
- Returns:
- an array of all
DataClass
es. - See Also:
-
hasClass
Checks if the givenDataClass
dataClass
is a member of the union.- Specified by:
hasClass
in interfaceUnionClass
- Parameters:
dataClass
- TheDataClass
that should be checked.- Returns:
true
if thedataClass
is a member of the union.
-
includeClass
This method checks if the data class contains a reference to another data class.Some data classes contain other data classes. For example,
AggregateClass
es contain as attribute type other data classes orCollectionClass
es have one element type which is also a data class.To prevent an infinite loop, this method does not recursive navigates through all element classes. Only the element of the class are checked but not, if the elements include the given anotherClass.
- Specified by:
includeClass
in interfaceDataClass
- Overrides:
includeClass
in classAbstractDataClassImpl
- Parameters:
other
- The data class that has to be checked for references- Returns:
true
if the data class contains a reference to the giveanotherClass
.
-
isUnion
public boolean isUnion()isUnion.
- Specified by:
isUnion
in interfaceDataClass
- Overrides:
isUnion
in classAbstractDataClassImpl
- Returns:
true
if the data class can be casted toUnionClass
-
remove
Removes aDataClass
from the list of data classes. If the data class is not in the list of data classes nothing will happen.- Specified by:
remove
in interfaceUnionClass
- Parameters:
dataClass
- The data class that should be removed.- Throws:
IllegalEditException
-
newObject
Creates a newDataObject
and initialize it.DataObject
s can not be created directly because they depend on theDataClass
that defines the object.The creation of a new object is only be possible if
DataClass.checkInstantiability()
throws no exception.- Specified by:
newObject
in interfaceDataClass
- Overrides:
newObject
in classAbstractDataClassImpl
- Returns:
- a new
DataObject
- Throws:
IllegalInstantiationException
- is thrown if it is not possible to create an object this data class
-
createSubclass
This method creates none system sub classes that are defined by the user. It is not possible to create sub-classes for abstract system classes. In that case aIllegalInstantiationException
will be thrown.Each data class has a unique name. This name must be given to this method. If the name already exists, a
NameAlreadyExistsException
will be thrown. The name can be used to access the data class from the data model by using the methodModel.getClass(String)
.The class is automatically added to the model. To remove the class again you must use the method
Model.removeClass(String)
.- Specified by:
createSubclass
in interfaceDataClass
- Overrides:
createSubclass
in classAbstractDataClassImpl
- Parameters:
name
- The uniqe name of the new sub class.- Returns:
- The new sub class.
- See Also:
-
conformToModel
Checks the list of data classes whether they conform to given model. IfDataClass
es are used which are present in the given model but with different reference, they will be replaced.- Parameters:
other
- The other data model to which this union class should conform to
-