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
DataClass
The DataClass
is 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubclass
(DataClass subclass) Adds a givenn subclass to the subclassList.void
This method checks if the data class can be instantiated.createSubclass
(String name) This method creates none system sub classes that are defined by the user.void
To instantiate classes it is necessary to know if the class can be edited further.getModel()
Each data class knows theModel
to that the class belongs.getName()
Each data class has a name that must be unique in theModel
.Class<? extends DataObject>
getObjectClass.This methods returns an array of all direct sub classes of this class.Each data class has a super class from that the class is inherited.Sometimes it can be necessary to have the inheritance hierarchy of the class.Each data class belongs to a system class with a unique name.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.boolean
includeClass
(DataClass anotherClass) This method checks if the data class contains a reference to another data class.boolean
isAbstract.boolean
isAggregate.boolean
isAtomic()
isAtomic.boolean
isBoolean.boolean
isByteArray.boolean
isCake2DataReference.boolean
isChronologic.boolean
isCollection.boolean
isControlflowItem.boolean
isDataflowWrapper.boolean
isDate()
isDate.boolean
isDouble()
isDouble.boolean
isEditable.boolean
To instantiate a class it is not allowed that the class is editable or abstract.boolean
isInteger.boolean
isInterval.boolean
isList()
isList.boolean
isNESTConstraintEdge.boolean
isNESTControlflowEdge.boolean
isNESTControlflowNode.boolean
isNESTDataflowEdge.boolean
isNESTDataNode.boolean
isNESTEdge.boolean
isNESTGraph.boolean
isNESTGraphItem.boolean
isNESTNode.boolean
isNESTPartOfEdge.boolean
isNESTSequenceNode.boolean
isNESTSequentialWorkflow.boolean
isNESTSubWorkflowNode.boolean
isNESTTaskNode.boolean
isNESTWorkflow.boolean
isNESTWorkflowNode.boolean
isNode()
isNode.boolean
isNumeric.boolean
isParentItem.boolean
isSequence.boolean
isSet()
isSet.boolean
isString()
isString.boolean
isSubclassOf
(DataClass anotherClass) Checks if this class is inherited fromanotherClass
or from a sub class ofanotherClass
.boolean
isSubWorkflow.boolean
isSystemClass.boolean
isTask()
isTask.boolean
isTime()
isTime.boolean
isTimestamp.boolean
isUnion()
isUnion.boolean
isURI()
isURI.boolean
isVoid()
isVoid.boolean
isWorkflow.boolean
isWorkflowItem.Creates a newDataObject
and initialize it.void
removeSubclass
(DataClass subclass) Removes a subclass from the subclassList.void
setAbstract
(boolean value) It is possible to model abstract user classes.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, setPropertyRootNode
-
Field Details
-
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:
-
LOG_ABSTRACT_CLASS_NOT_INSTANTIABLE
- See Also:
-
LOG_ABSTRACT_SYSTEM_SUBCLASS_CREATION_FAILED
- See Also:
-
LOG_CLASS_NOT_EDITABLE
- See Also:
-
LOG_CLASS_NOT_INSTANTIABLE
- See Also:
-
LOG_EDITABLE_CLASS_NOT_INSTANTIABLE
- See Also:
-
LOG_FINISH_EDIT_FAILED
- See Also:
-
LOG_GET_SUPERCLASSES_FAILED
- See Also:
-
LOG_SUBCLASS_CREATION_FAILED
- See Also:
-
-
Method Details
-
checkInstantiability
This 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 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)
.- Parameters:
name
- The uniqe name of the new sub class.- Returns:
- The new sub class.
- Throws:
IllegalInstantiationException
NameAlreadyExistsException
- See Also:
-
addSubclass
Adds a givenn subclass to the subclassList.- Parameters:
subclass
- The subclass which gets added to the subclassList
-
removeSubclass
Removes a subclass from the subclassList.- Parameters:
subclass
- The subclass which gets removed from the subclassList
-
finishEditing
To 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 theModel
to that the class belongs.- Returns:
- The
Model
of 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
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 classnull
will be returned.- Returns:
- The parent class or super class of this class or
null
if 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
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.
- Parameters:
anotherClass
- The data class that has to be checked for references- Returns:
true
if the data class contains a reference to the giveanotherClass
.
-
isAbstract
boolean isAbstract()isAbstract.
- Returns:
true
if the class is abstract and can not be instantiated
-
setAbstract
It 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
-true
if the user class should be an abstract class.- Throws:
IllegalEditException
- if any.
-
isAggregate
boolean isAggregate()isAggregate.
- Returns:
true
if the data class can be casted toAggregateClass
-
isAtomic
boolean isAtomic()isAtomic.
- Returns:
true
if the data class can be casted toAtomicClass
-
isBoolean
boolean isBoolean()isBoolean.
- Returns:
true
if the data class can be casted toBooleanClass
-
isByteArray
boolean isByteArray()isByteArray.
- Returns:
true
if the data class can be casted toByteArrayClass
-
isChronologic
boolean isChronologic()isChronologic.
- Returns:
true
if the data class can be casted toChronologicClass
-
isCollection
boolean isCollection()isCollection.
- Returns:
true
if the data class can be casted toCollectionClass
-
isDate
boolean isDate()isDate.
- Returns:
true
if the data class can be casted toDateClass
-
isDouble
boolean isDouble()isDouble.
- Returns:
true
if the data class can be casted toDoubleClass
-
isEditable
boolean isEditable()isEditable.
- Returns:
true
if 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:
true
if this class can be instantiated.
-
isInteger
boolean isInteger()isInteger.
- Returns:
true
if the data class can be casted toIntegerClass
-
isInterval
boolean isInterval()isInterval.
- Returns:
true
if the data class can be casted toIntervalClass
-
isList
boolean isList()isList.
- Returns:
true
if the data class can be casted toListClass
-
isNumeric
boolean isNumeric()isNumeric.
- Returns:
true
if the data class can be casted toNumericClass
-
isURI
boolean isURI()isURI.
- Returns:
true
if the data class can be casted toURIClass
-
isSet
boolean isSet()isSet.
- Returns:
true
if the data class can be casted toSetClass
-
isString
boolean isString()isString.
- Returns:
true
if the data class can be casted toStringClass
-
isSubclassOf
Checks if this class is inherited fromanotherClass
or from a sub class ofanotherClass
.- Parameters:
anotherClass
- aDataClass
object- Returns:
true
if this class is a subclass ofanotherClass
-
isSystemClass
boolean isSystemClass()isSystemClass.
- Returns:
true
if this class is a system class.
-
isTime
boolean isTime()isTime.
- Returns:
true
if the data class can be casted toTimeClass
-
isTimestamp
boolean isTimestamp()isTimestamp.
- Returns:
true
if the data class can be casted toTimestampClass
-
isUnion
boolean isUnion()isUnion.
- Returns:
true
if the data class can be casted toUnionClass
-
isVoid
boolean isVoid()isVoid.
- Returns:
true
if the data class can be casted toVoidClass
-
isTask
boolean isTask()isTask.
- Returns:
true
if the data class can be casted toTaskClass
-
isWorkflowItem
boolean isWorkflowItem()isWorkflowItem.
- Returns:
true
if the data class can be casted toAbstractWorkflowItemClass
-
isSubWorkflow
boolean isSubWorkflow()isSubWorkflow.
- Returns:
true
if the data class can be casted toSubWorkflowClass
-
isControlflowItem
boolean isControlflowItem()isControlflowItem.
- Returns:
true
if the data class can be casted toControlflowItemClass
-
isParentItem
boolean isParentItem()isParentItem.
- Returns:
true
if the data class can be casted toParentItemClass
-
isWorkflow
boolean isWorkflow()isWorkflow.
- Returns:
true
if the data class can be casted toWorkflowClass
-
isSequence
boolean isSequence()isSequence.
- Returns:
true
if the data class can be casted toSequenceClass
-
isNode
boolean isNode()isNode.
- Returns:
true
if the data class can be casted toNodeClass
-
isDataflowWrapper
boolean isDataflowWrapper()isDataflowWrapper.
- Returns:
true
if the data class can be casted toDataflowWrapperClass
-
isNESTNode
boolean isNESTNode()isNESTNode.
- Returns:
true
if the data class can be casted toNESTNodeClass
-
isNESTEdge
boolean isNESTEdge()isNESTEdge.
- Returns:
true
if the data class can be casted toNESTEdgeClass
-
isNESTGraph
boolean isNESTGraph()isNESTGraph.
- Returns:
true
if the data class can be casted toNESTGraphClass
-
isNESTSequentialWorkflow
boolean isNESTSequentialWorkflow()isNESTSequentialWorkflow.
- Returns:
true
if the data class can be casted toNESTSequentialWorkflowClass
-
isNESTWorkflow
boolean isNESTWorkflow()isNESTWorkflow.
- Returns:
true
if the data class can be casted toNESTWorkflowClass
-
isNESTGraphItem
boolean isNESTGraphItem()isNESTGraphItem.
- Returns:
true
if the data class can be casted toNESTGraphItemClass
-
isNESTConstraintEdge
boolean isNESTConstraintEdge()isNESTConstraintEdge.
- Returns:
true
if the data class can be casted toNESTConstraintEdgeClass
-
isNESTControlflowEdge
boolean isNESTControlflowEdge()isNESTControlflowEdge.
- Returns:
true
if the data class can be casted toNESTControlflowEdgeClass
-
isNESTControlflowNode
boolean isNESTControlflowNode()isNESTControlflowNode.
- Returns:
true
if the data class can be casted toNESTControlflowNodeClass
-
isNESTDataflowEdge
boolean isNESTDataflowEdge()isNESTDataflowEdge.
- Returns:
true
if the data class can be casted toNESTDataflowEdgeClass
-
isNESTDataNode
boolean isNESTDataNode()isNESTDataNode.
- Returns:
true
if the data class can be casted toNESTDataNodeClass
-
isNESTPartOfEdge
boolean isNESTPartOfEdge()isNESTPartOfEdge.
- Returns:
true
if the data class can be casted toNESTPartOfEdgeClass
-
isNESTTaskNode
boolean isNESTTaskNode()isNESTTaskNode.
- Returns:
true
if the data class can be casted toNESTTaskNodeClass
-
isNESTSequenceNode
boolean isNESTSequenceNode()isNESTSequenceNode.
- Returns:
true
if the data class can be casted toNESTTaskNodeClass
orNESTControlflowNodeClass
-
isCake2DataReference
boolean isCake2DataReference()isCake2DataReference.
- Returns:
true
if the data class can be casted toDataReferenceClass
-
isNESTWorkflowNode
boolean isNESTWorkflowNode()isNESTWorkflowNode.
- Returns:
true
if the data class can be casted toNESTWorkflowNodeClass
-
isNESTSubWorkflowNode
boolean isNESTSubWorkflowNode()isNESTSubWorkflowNode.
- Returns:
true
if the data class can be casted toNESTSubWorkflowNodeClass
-
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
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
The name of a data class must be unique in the data model. If this is not the case, theNameAlreadyExistsException
will 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:
IllegalEditException
NameAlreadyExistsException
-