Interface DataClass
-
- All Superinterfaces:
PropertyHandler
- All Known Subinterfaces:
AbstractWorkflowItemClass,AggregateClass,AtomicClass,BooleanClass,ByteArrayClass,ChronologicClass,CollectionClass,ControlflowItemClass,DataflowWrapperClass,DataReferenceClass,DateClass,DoubleClass,IntegerClass,IntervalClass,ListClass,NESTAndEndNodeClass,NESTAndStartNodeClass,NESTConstraintEdgeClass,NESTControlflowEdgeClass,NESTControlflowNodeClass,NESTDataflowEdgeClass,NESTDataNodeClass,NESTEdgeClass,NESTGraphClass,NESTGraphItemClass,NESTLoopEndNodeClass,NESTLoopStartNodeClass,NESTNodeClass,NESTOrEndNodeClass,NESTOrStartNodeClass,NESTPartOfEdgeClass,NESTSequenceNodeClass,NESTSequentialWorkflowClass,NESTSubWorkflowNodeClass,NESTTaskNodeClass,NESTWorkflowClass,NESTWorkflowNodeClass,NESTXorEndNodeClass,NESTXorStartNodeClass,NodeClass,NumericClass,ParentItemClass,SequenceClass,SetClass,StatusableClass,StringClass,SubWorkflowClass,TaskClass,TimeClass,TimestampClass,UnionClass,URIClass,VoidClass,WorkflowClass
- All Known Implementing Classes:
AbstractDataClassImpl,AbstractWorkflowItemClassImpl,AggregateClassImpl,AtomicClassImpl,BooleanClassImpl,ByteArrayClassImpl,ChronologicClassImpl,CollectionClassImpl,ControlflowItemClassImpl,DataClassImpl,DataflowWrapperClassImpl,DataReferenceClassImpl,DateClassImpl,DoubleClassImpl,IntegerClassImpl,IntervalClassImpl,ListClassImpl,NESTAndEndNodeClassImpl,NESTAndStartNodeClassImpl,NESTConstraintEdgeClassImpl,NESTControlflowEdgeClassImpl,NESTControlflowNodeClassImpl,NESTDataflowEdgeClassImpl,NESTDataNodeClassImpl,NESTEdgeClassImpl,NESTGraphClassImpl,NESTGraphItemClassImpl,NESTLoopEndNodeClassImpl,NESTLoopStartNodeClassImpl,NESTNodeClassImpl,NESTOrEndNodeClassImpl,NESTOrStartNodeClassImpl,NESTPartOfEdgeClassImpl,NESTSequenceNodeClassImpl,NESTSequentialWorkflowClassImpl,NESTSubWorkflowNodeClassImpl,NESTTaskNodeClassImpl,NESTWorkflowClassImpl,NESTWorkflowNodeClassImpl,NESTXorEndNodeClassImpl,NESTXorStartNodeClassImpl,NodeClassImpl,NumericClassImpl,ParentItemClassImpl,SequenceClassImpl,SetClassImpl,StatusableClassImpl,StringClassImpl,SubWorkflowClassImpl,TaskClassImpl,TimeClassImpl,TimeStampClassImpl,UnionClassImpl,URIClassImpl,VoidClassImpl,WorkflowClassImpl
public interface DataClass extends PropertyHandler
DataClass
The
DataClassis the root of all classes in the data model.Some Constraints
- Subclasses can only be declared as finish if all superclasses are not editable.
- The name must be unique in the
Model
- Author:
- rmaximi
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASS_NAMEThe name of the class.static StringCOMPONENTComponent: "cake.data.model" (LogComponentIdentifier.COMPONENT)static StringCOMPONENT_KEYComponent-Key: "01" (LogComponentIdentifier.COMPONENT_KEY_DATACLASS)static StringLOG_ABSTRACT_CLASS_NOT_INSTANTIABLEAttempting to instantiate an abstract class - abstract classes can not be instantiated.static StringLOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILEDThe creation of a subclass failed, because abstract system subclasses can not be subclassed.static StringLOG_CLASS_NOT_EDITABLEThis class is not editable.static StringLOG_CLASS_NOT_INSTANTIABLEThis class is not instantiable.static StringLOG_EDITABLE_CLASS_NOT_INSTANTIABLEAttempting to instantiate an editable class - editable classes can not be instantiated.static StringLOG_FINISH_EDIT_FAILEDFinish editing failed, because the super-class is still editable.static StringLOG_GET_SUPERCLASSES_FAILEDCould not get all superclasses.static StringLOG_SUBCLASS_CREATION_FAILEDSubclass-creation failed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSubclass(DataClass subclass)Adds a givenn subclass to the subclassList.voidcheckInstantiability()This method checks if the data class can be instantiated.DataClasscreateSubclass(String name)This method creates none system sub classes that are defined by the user.voidfinishEditing()To instantiate classes it is necessary to know if the class can be edited further.ModelgetModel()Each data class knows theModelto that the class belongs.StringgetName()Each data class has a name that must be unique in theModel.Class<? extends DataObject>getObjectClass()getObjectClass.List<DataClass>getSubClasses()This methods returns an array of all direct sub classes of this class.DataClassgetSuperClass()Each data class has a super class from that the class is inherited.DataClass[]getSuperClasses()Sometimes it can be necessary to have the inheritance hierarchy of the class.StringgetSystemClassName()Each data class belongs to a system class with a unique name.DataClassgetSystemSuperClass()Instead of receiving the super class of this class (getSuperClass()) this class returns the first super class in the class hierarchy that is a system class.booleanincludeClass(DataClass anotherClass)This method checks if the data class contains a reference to another data class.booleanisAbstract()isAbstract.booleanisAggregate()isAggregate.booleanisAtomic()isAtomic.booleanisBoolean()isBoolean.booleanisByteArray()isByteArray.booleanisCake2DataReference()isCake2DataReference.booleanisChronologic()isChronologic.booleanisCollection()isCollection.booleanisControlflowItem()isControlflowItem.booleanisDataflowWrapper()isDataflowWrapper.booleanisDate()isDate.booleanisDouble()isDouble.booleanisEditable()isEditable.booleanisInstantiable()To instantiate a class it is not allowed that the class is editable or abstract.booleanisInteger()isInteger.booleanisInterval()isInterval.booleanisList()isList.booleanisNESTConstraintEdge()isNESTConstraintEdge.booleanisNESTControlflowEdge()isNESTControlflowEdge.booleanisNESTControlflowNode()isNESTControlflowNode.booleanisNESTDataflowEdge()isNESTDataflowEdge.booleanisNESTDataNode()isNESTDataNode.booleanisNESTEdge()isNESTEdge.booleanisNESTGraph()isNESTGraph.booleanisNESTGraphItem()isNESTGraphItem.booleanisNESTNode()isNESTNode.booleanisNESTPartOfEdge()isNESTPartOfEdge.booleanisNESTSequenceNode()isNESTSequenceNode.booleanisNESTSequentialWorkflow()isNESTSequentialWorkflow.booleanisNESTSubWorkflowNode()isNESTSubWorkflowNode.booleanisNESTTaskNode()isNESTTaskNode.booleanisNESTWorkflow()isNESTWorkflow.booleanisNESTWorkflowNode()isNESTWorkflowNode.booleanisNode()isNode.booleanisNumeric()isNumeric.booleanisParentItem()isParentItem.booleanisSequence()isSequence.booleanisSet()isSet.booleanisString()isString.booleanisSubclassOf(DataClass anotherClass)Checks if this class is inherited fromanotherClassor from a sub class ofanotherClass.booleanisSubWorkflow()isSubWorkflow.booleanisSystemClass()isSystemClass.booleanisTask()isTask.booleanisTime()isTime.booleanisTimestamp()isTimestamp.booleanisUnion()isUnion.booleanisURI()isURI.booleanisVoid()isVoid.booleanisWorkflow()isWorkflow.booleanisWorkflowItem()isWorkflowItem.DataObjectnewObject()Creates a newDataObjectand initialize it.voidremoveSubclass(DataClass subclass)Removes a subclass from the subclassList.voidsetAbstract(boolean value)It is possible to model abstract user classes.StringsetName(String name)The name of a data class must be unique in the data model.-
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty
-
-
-
-
Field Detail
-
CLASS_NAME
static final String CLASS_NAME
The name of the class. This name should be used inModel.getClass(String)to receive the system class. The value is * "Data" .- See Also:
- Constant Field Values
-
COMPONENT
static final String COMPONENT
Component: "cake.data.model" (LogComponentIdentifier.COMPONENT)- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key: "01" (LogComponentIdentifier.COMPONENT_KEY_DATACLASS)- See Also:
- Constant Field Values
-
LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE
static final String LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE
Attempting to instantiate an abstract class - abstract classes can not be instantiated.- Component:
COMPONENT - Key: "0102"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED
static final String LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED
The creation of a subclass failed, because abstract system subclasses can not be subclassed.- Component:
COMPONENT - Key: "0108"
- this
- Subclass
- See Also:
- Constant Field Values
- Component:
-
LOG_CLASS_NOT_EDITABLE
static final String LOG_CLASS_NOT_EDITABLE
This class is not editable.- Component:
COMPONENT - Key: "0106"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_CLASS_NOT_INSTANTIABLE
static final String LOG_CLASS_NOT_INSTANTIABLE
This class is not instantiable.- Component:
COMPONENT - Key: "0101"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_EDITABLE_CLASS_NOT_INSTANTIABLE
static final String LOG_EDITABLE_CLASS_NOT_INSTANTIABLE
Attempting to instantiate an editable class - editable classes can not be instantiated.- Component:
COMPONENT - Key: "0103"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_FINISH_EDIT_FAILED
static final String LOG_FINISH_EDIT_FAILED
Finish editing failed, because the super-class is still editable.- Component:
COMPONENT - Key: "0104"
- this
- See Also:
- Constant Field Values
- Component:
-
LOG_GET_SUPERCLASSES_FAILED
static final String LOG_GET_SUPERCLASSES_FAILED
Could not get all superclasses.- Component:
COMPONENT - Key: "0107"
- this
- Superclass causing this error
- See Also:
- Constant Field Values
- Component:
-
LOG_SUBCLASS_CREATION_FAILED
static final String LOG_SUBCLASS_CREATION_FAILED
Subclass-creation failed.- Component:
COMPONENT - Key: "0105"
- this
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
checkInstantiability
void checkInstantiability() throws IllegalInstantiationExceptionThis method checks if the data class can be instantiated.- Throws:
IllegalInstantiationException
-
createSubclass
DataClass createSubclass(String name) throws IllegalInstantiationException, NameAlreadyExistsException
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 aIllegalInstantiationExceptionwill be thrown.Each data class has a unique name. This name must be given to this method. If the name already exists, a
NameAlreadyExistsExceptionwill 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).- Parameters:
name- The uniqe name of the new sub class.- Returns:
- The new sub class.
- Throws:
IllegalInstantiationExceptionNameAlreadyExistsException- See Also:
Model.removeClass(String)
-
addSubclass
void addSubclass(DataClass subclass)
Adds a givenn subclass to the subclassList.- Parameters:
subclass- The subclass which gets added to the subclassList
-
removeSubclass
void removeSubclass(DataClass subclass)
Removes a subclass from the subclassList.- Parameters:
subclass- The subclass which gets removed from the subclassList
-
finishEditing
void finishEditing() throws ClassHierarchyConsistencyExceptionTo instantiate classes it is necessary to know if the class can be edited further. Only finished classes can be instantiated. Therefore, it is necessary to call this method to tell the system that the class is ready defined. Nevertheless, finishing a class can fail because of an inconsistency in the class hierarchy. One of the superclasses is not consistence with this class.- Throws:
ClassHierarchyConsistencyException- if any.
-
getModel
Model getModel()
Each data class knows theModelto that the class belongs.- Returns:
- The
Modelof the data class.
-
getName
String getName()
Each data class has a name that must be unique in theModel.- Returns:
- the unique name of the data class
-
getSystemClassName
String getSystemClassName()
Each data class belongs to a system class with a unique name.- Returns:
- the unique system class name
-
getSubClasses
List<DataClass> getSubClasses()
This methods returns an array of all direct sub classes of this class. This does not include system classes or sub sub classes and so on. Only the direct ones.- Returns:
- An array of sub classes for this DataClasses or an empty array but never null.
-
getSuperClass
DataClass getSuperClass()
Each data class has a super class from that the class is inherited. This class can be get with this method. If this method is used on the root data classnullwill be returned.- Returns:
- The parent class or super class of this class or
nullif this class is the root class.
-
getSuperClasses
DataClass[] getSuperClasses()
Sometimes it can be necessary to have the inheritance hierarchy of the class. This hierarchy can be accessed with this method.- Returns:
- All super classes in the class hierarchy including the system super classes.
-
getSystemSuperClass
DataClass getSystemSuperClass()
Instead of receiving the super class of this class (getSuperClass()) this class returns the first super class in the class hierarchy that is a system class.- Returns:
- The first system super class in the class hierarchy.
-
includeClass
boolean includeClass(DataClass anotherClass)
This method checks if the data class contains a reference to another data class.Some data classes contain other data classes. For example,
AggregateClasses contain as attribute type other data classes orCollectionClasses 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.
- Parameters:
anotherClass- The data class that has to be checked for references- Returns:
trueif the data class contains a reference to the giveanotherClass.
-
isAbstract
boolean isAbstract()
isAbstract.
- Returns:
trueif the class is abstract and can not be instantiated
-
setAbstract
void setAbstract(boolean value) throws IllegalEditExceptionIt is possible to model abstract user classes. The default is that a user class is not abstract. But in special cases it can be useful to change this behavior.- Parameters:
value-trueif the user class should be an abstract class.- Throws:
IllegalEditException- if any.
-
isAggregate
boolean isAggregate()
isAggregate.
- Returns:
trueif the data class can be casted toAggregateClass
-
isAtomic
boolean isAtomic()
isAtomic.
- Returns:
trueif the data class can be casted toAtomicClass
-
isBoolean
boolean isBoolean()
isBoolean.
- Returns:
trueif the data class can be casted toBooleanClass
-
isByteArray
boolean isByteArray()
isByteArray.
- Returns:
trueif the data class can be casted toByteArrayClass
-
isChronologic
boolean isChronologic()
isChronologic.
- Returns:
trueif the data class can be casted toChronologicClass
-
isCollection
boolean isCollection()
isCollection.
- Returns:
trueif the data class can be casted toCollectionClass
-
isDate
boolean isDate()
isDate.
- Returns:
trueif the data class can be casted toDateClass
-
isDouble
boolean isDouble()
isDouble.
- Returns:
trueif the data class can be casted toDoubleClass
-
isEditable
boolean isEditable()
isEditable.
- Returns:
trueif the class can be edited
-
isInstantiable
boolean isInstantiable()
To instantiate a class it is not allowed that the class is editable or abstract. Some system classes are also not instantiable- Returns:
trueif this class can be instantiated.
-
isInteger
boolean isInteger()
isInteger.
- Returns:
trueif the data class can be casted toIntegerClass
-
isInterval
boolean isInterval()
isInterval.
- Returns:
trueif the data class can be casted toIntervalClass
-
isList
boolean isList()
isList.
- Returns:
trueif the data class can be casted toListClass
-
isNumeric
boolean isNumeric()
isNumeric.
- Returns:
trueif the data class can be casted toNumericClass
-
isURI
boolean isURI()
isURI.
- Returns:
trueif the data class can be casted toURIClass
-
isSet
boolean isSet()
isSet.
- Returns:
trueif the data class can be casted toSetClass
-
isString
boolean isString()
isString.
- Returns:
trueif the data class can be casted toStringClass
-
isSubclassOf
boolean isSubclassOf(DataClass anotherClass)
Checks if this class is inherited fromanotherClassor from a sub class ofanotherClass.- Parameters:
anotherClass- aDataClassobject- Returns:
trueif this class is a subclass ofanotherClass
-
isSystemClass
boolean isSystemClass()
isSystemClass.
- Returns:
trueif this class is a system class.
-
isTime
boolean isTime()
isTime.
- Returns:
trueif the data class can be casted toTimeClass
-
isTimestamp
boolean isTimestamp()
isTimestamp.
- Returns:
trueif the data class can be casted toTimestampClass
-
isUnion
boolean isUnion()
isUnion.
- Returns:
trueif the data class can be casted toUnionClass
-
isVoid
boolean isVoid()
isVoid.
- Returns:
trueif the data class can be casted toVoidClass
-
isTask
boolean isTask()
isTask.
- Returns:
trueif the data class can be casted toTaskClass
-
isWorkflowItem
boolean isWorkflowItem()
isWorkflowItem.
- Returns:
trueif the data class can be casted toAbstractWorkflowItemClass
-
isSubWorkflow
boolean isSubWorkflow()
isSubWorkflow.
- Returns:
trueif the data class can be casted toSubWorkflowClass
-
isControlflowItem
boolean isControlflowItem()
isControlflowItem.
- Returns:
trueif the data class can be casted toControlflowItemClass
-
isParentItem
boolean isParentItem()
isParentItem.
- Returns:
trueif the data class can be casted toParentItemClass
-
isWorkflow
boolean isWorkflow()
isWorkflow.
- Returns:
trueif the data class can be casted toWorkflowClass
-
isSequence
boolean isSequence()
isSequence.
- Returns:
trueif the data class can be casted toSequenceClass
-
isNode
boolean isNode()
isNode.
- Returns:
trueif the data class can be casted toNodeClass
-
isDataflowWrapper
boolean isDataflowWrapper()
isDataflowWrapper.
- Returns:
trueif the data class can be casted toDataflowWrapperClass
-
isNESTNode
boolean isNESTNode()
isNESTNode.
- Returns:
trueif the data class can be casted toNESTNodeClass
-
isNESTEdge
boolean isNESTEdge()
isNESTEdge.
- Returns:
trueif the data class can be casted toNESTEdgeClass
-
isNESTGraph
boolean isNESTGraph()
isNESTGraph.
- Returns:
trueif the data class can be casted toNESTGraphClass
-
isNESTSequentialWorkflow
boolean isNESTSequentialWorkflow()
isNESTSequentialWorkflow.
- Returns:
trueif the data class can be casted toNESTSequentialWorkflowClass
-
isNESTWorkflow
boolean isNESTWorkflow()
isNESTWorkflow.
- Returns:
trueif the data class can be casted toNESTWorkflowClass
-
isNESTGraphItem
boolean isNESTGraphItem()
isNESTGraphItem.
- Returns:
trueif the data class can be casted toNESTGraphItemClass
-
isNESTConstraintEdge
boolean isNESTConstraintEdge()
isNESTConstraintEdge.
- Returns:
trueif the data class can be casted toNESTConstraintEdgeClass
-
isNESTControlflowEdge
boolean isNESTControlflowEdge()
isNESTControlflowEdge.
- Returns:
trueif the data class can be casted toNESTControlflowEdgeClass
-
isNESTControlflowNode
boolean isNESTControlflowNode()
isNESTControlflowNode.
- Returns:
trueif the data class can be casted toNESTControlflowNodeClass
-
isNESTDataflowEdge
boolean isNESTDataflowEdge()
isNESTDataflowEdge.
- Returns:
trueif the data class can be casted toNESTDataflowEdgeClass
-
isNESTDataNode
boolean isNESTDataNode()
isNESTDataNode.
- Returns:
trueif the data class can be casted toNESTDataNodeClass
-
isNESTPartOfEdge
boolean isNESTPartOfEdge()
isNESTPartOfEdge.
- Returns:
trueif the data class can be casted toNESTPartOfEdgeClass
-
isNESTTaskNode
boolean isNESTTaskNode()
isNESTTaskNode.
- Returns:
trueif the data class can be casted toNESTTaskNodeClass
-
isNESTSequenceNode
boolean isNESTSequenceNode()
isNESTSequenceNode.
- Returns:
trueif the data class can be casted toNESTTaskNodeClassorNESTControlflowNodeClass
-
isCake2DataReference
boolean isCake2DataReference()
isCake2DataReference.
- Returns:
trueif the data class can be casted toDataReferenceClass
-
isNESTWorkflowNode
boolean isNESTWorkflowNode()
isNESTWorkflowNode.
- Returns:
trueif the data class can be casted toNESTWorkflowNodeClass
-
isNESTSubWorkflowNode
boolean isNESTSubWorkflowNode()
isNESTSubWorkflowNode.
- Returns:
trueif the data class can be casted toNESTSubWorkflowNodeClass
-
newObject
DataObject newObject() throws IllegalInstantiationException
Creates a newDataObjectand initialize it.DataObjects can not be created directly because they depend on theDataClassthat defines the object.The creation of a new object is only be possible if
checkInstantiability()throws no exception.- Returns:
- a new
DataObject - Throws:
IllegalInstantiationException- is thrown if it is not possible to create an object this data class
-
getObjectClass
Class<? extends DataObject> getObjectClass()
getObjectClass.
- Returns:
- Class of the corresponding data object
-
setName
String setName(String name) throws IllegalEditException, NameAlreadyExistsException
The name of a data class must be unique in the data model. If this is not the case, theNameAlreadyExistsExceptionwill be thrown. To rename the data class tthis method can be used, too.- Parameters:
name- A unique name of the data class.- Returns:
- The name of the class.
- Throws:
IllegalEditExceptionNameAlreadyExistsException
-
-