Class DataObjectImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
-
- All Implemented Interfaces:
DataObject,PropertyHandler
- Direct Known Subclasses:
AbstractWorkflowItemObjectImpl,AggregateObjectImpl,AtomicObjectImpl,CollectionObjectImpl,IntervalObjectImpl,NESTGraphItemObjectImpl,NESTGraphObjectImpl,VoidObjectImpl
public abstract class DataObjectImpl extends Object implements DataObject
- Author:
- Rainer Maximini
-
-
Constructor Summary
Constructors Constructor Description DataObjectImpl()DataObjectImpl(DataClass dataClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(PropertyTreeNode node)Add a property to the property tree.voidaddProperty(String name, String value)Add a property to the property tree.voidassertSameValueAsIn(DataObject object)DataObjectcopy()Makes a deep copy of the data objectvoiddeepCopy(DataObjectImpl dataObject)List<String>getAllProperties(String key)Searches for all property values within the property tree.List<PropertyTreeNode>getAllPropertyNodes(String key)Searches for all property nodes within the property tree.DataClassgetDataClass()StringgetId()ModelgetModel()Each object knows to which model it belongs.StringgetProperty(String key)Gets the value of the node that has the given name and is found first.String[]getPropertyNames()To receive all properties that are set byPropertyHandler.addProperty(String, String)use this method.PropertyTreeNodegetPropertyNode(String key)Search for a property node within the whole tree of properties.PropertyTreeNodegetPropertyRootNode()Returns the propertyRootNode of the implementing object.booleanhasClassName(String className)Check if the object's data class has the given class name.booleanhasProperties()Tests, if the implementing object has properties.booleanhasSameValueAsIn(DataObject object)This method makes a deep compare.booleanhasSystemClassName(String systemClassName)Check if the object's data class has the given system class name.booleanisAggregate()booleanisAtomic()booleanisBoolean()booleanisByteArray()booleanisChronologic()booleanisCollection()booleanisDataflowWrapper()booleanisDataReference()booleanisDate()booleanisDouble()booleanisInteger()booleanisInterval()booleanisKindOf(DataClass anotherClass)Check if the object is an instance of the givenDataClassor of some of its sub-classes.booleanisList()booleanisMemberOf(DataClass anotherClass)Check if this object can be referenced from the givenDataClassbooleanisNESTConstraintEdge()booleanisNESTControlflowEdge()booleanisNESTControlflowNode()booleanisNESTDataflowEdge()booleanisNESTDataNode()booleanisNESTEdge()booleanisNESTGraph()booleanisNESTNode()booleanisNESTPartOfEdge()booleanisNESTSequenceNode()booleanisNESTSequentialWorkflow()booleanisNESTSubWorkflowNode()booleanisNESTTaskNode()booleanisNESTWorkflow()booleanisNESTWorkflowNode()booleanisNode()booleanisNumeric()booleanisSequence()booleanisSet()booleanisString()booleanisSubWorkflow()booleanisTask()booleanisTime()booleanisTimestamp()booleanisUnion()booleanisURI()booleanisVoid()booleanisWorkflow()voidremoveId()Removes the given objectId from the set of ids.StringremoveProperty(String name)Remove any node from the property tree.voidsetDataClass(DataClass dataClass)voidsetId(String objectId)Adds the given objectId to the set of ids.StringtoDetailedString()Returns a detailed String, if the output of the standard toString() method would be to long.StringtoString()StringtoXML()Converts the data object to XML
-
-
-
Field Detail
-
objectId
protected String objectId
-
-
Constructor Detail
-
DataObjectImpl
public DataObjectImpl()
-
DataObjectImpl
public DataObjectImpl(DataClass dataClass)
-
-
Method Detail
-
getDataClass
public DataClass getDataClass()
- Specified by:
getDataClassin interfaceDataObject- Returns:
- The data class of the object.
-
setDataClass
public void setDataClass(DataClass dataClass)
- Specified by:
setDataClassin interfaceDataObject
-
getId
public String getId()
- Specified by:
getIdin interfaceDataObject- Returns:
- objectId of the given base *
- See Also:
de.uni_trier.wi2.procake.data.object
-
setId
public void setId(String objectId)
Description copied from interface:DataObjectAdds the given objectId to the set of ids.- Specified by:
setIdin interfaceDataObject- Parameters:
objectId- that will be added to the set of ids- See Also:
de.uni_trier.wi2.procake.data.object
-
getModel
public Model getModel()
Description copied from interface:DataObjectEach object knows to which model it belongs.- Specified by:
getModelin interfaceDataObject- Returns:
- The data model to that the object belongs.
-
getPropertyRootNode
public PropertyTreeNode getPropertyRootNode()
Description copied from interface:PropertyHandlerReturns the propertyRootNode of the implementing object.- Specified by:
getPropertyRootNodein interfacePropertyHandler- Returns:
- the propertyRootNode if set. Null otherwise.
-
getPropertyNode
public PropertyTreeNode getPropertyNode(String key)
Description copied from interface:PropertyHandlerSearch for a property node within the whole tree of properties. The first node with a given name will be returned. The generic root node cannot be returned. The used search algorithm to iterate the property tree is BFS.- Specified by:
getPropertyNodein interfacePropertyHandler- Parameters:
key- the name of the property to search for- Returns:
- the found property node, or null, if there are no properties or no node has this key
-
getProperty
public String getProperty(String key)
Description copied from interface:PropertyHandlerGets the value of the node that has the given name and is found first. If the property does not exists, null will be returned.- Specified by:
getPropertyin interfacePropertyHandler- Parameters:
key- The name of the property.- Returns:
- The property value or null if the property does not exists.
- See Also:
PropertyHandler.getPropertyNode(String)
-
getPropertyNames
public String[] getPropertyNames()
Description copied from interface:PropertyHandlerTo receive all properties that are set byPropertyHandler.addProperty(String, String)use this method. Every name contained in the complete tree will be considered. The result will never be null.- Specified by:
getPropertyNamesin interfacePropertyHandler- Returns:
- An array of defined property names.
-
removeProperty
public String removeProperty(String name)
Description copied from interface:PropertyHandlerRemove any node from the property tree. The first node to be found with this name, will be removed (including all children).- Specified by:
removePropertyin interfacePropertyHandler- Parameters:
name- the name of the node to be removed- Returns:
- the value of the removed node, or null, if no node could be removed
-
addProperty
public void addProperty(PropertyTreeNode node)
Description copied from interface:PropertyHandlerAdd a property to the property tree. This property node (or subtree) will be added right below the generic root.- Specified by:
addPropertyin interfacePropertyHandler- Parameters:
node- the node to be added
-
addProperty
public void addProperty(String name, String value)
Description copied from interface:PropertyHandlerAdd a property to the property tree. This property node (or subtree) will be added right below the generic root.- Specified by:
addPropertyin interfacePropertyHandler- Parameters:
name- the name of the node to addvalue- the value of the node to add- See Also:
PropertyHandler.addProperty(PropertyTreeNode)
-
getAllPropertyNodes
public List<PropertyTreeNode> getAllPropertyNodes(String key)
Description copied from interface:PropertyHandlerSearches for all property nodes within the property tree. The result will never be null (but could be an empty set).- Specified by:
getAllPropertyNodesin interfacePropertyHandler- Parameters:
key- the key of the property- Returns:
- a set with the found property nodes
-
getAllProperties
public List<String> getAllProperties(String key)
Description copied from interface:PropertyHandlerSearches for all property values within the property tree. The result will never be null (but could be an empty set).- Specified by:
getAllPropertiesin interfacePropertyHandler- Parameters:
key- the key of the property- Returns:
- a set with the found property nodes
-
hasProperties
public boolean hasProperties()
Description copied from interface:PropertyHandlerTests, if the implementing object has properties. This can be tested by looking for a generic root node.- Specified by:
hasPropertiesin interfacePropertyHandler- Returns:
- true, if a property is set, false otherwise.
-
isAggregate
public boolean isAggregate()
- Specified by:
isAggregatein interfaceDataObject- Returns:
trueif the data class can be casted toAggregateClass
-
isAtomic
public boolean isAtomic()
- Specified by:
isAtomicin interfaceDataObject- Returns:
trueif the data class can be casted toAtomicClass
-
isBoolean
public boolean isBoolean()
- Specified by:
isBooleanin interfaceDataObject- Returns:
trueif the data class can be casted toBooleanClass
-
isByteArray
public boolean isByteArray()
- Specified by:
isByteArrayin interfaceDataObject- Returns:
trueif the data class can be casted toByteArrayClass
-
isChronologic
public boolean isChronologic()
- Specified by:
isChronologicin interfaceDataObject- Returns:
trueif the data class can be casted toChronologicClass
-
isCollection
public boolean isCollection()
- Specified by:
isCollectionin interfaceDataObject- Returns:
trueif the data class can be casted toCollectionClass
-
isDate
public boolean isDate()
- Specified by:
isDatein interfaceDataObject- Returns:
trueif the data class can be casted toDateClass
-
isDouble
public boolean isDouble()
- Specified by:
isDoublein interfaceDataObject- Returns:
trueif the data class can be casted toDoubleClass
-
isInteger
public boolean isInteger()
- Specified by:
isIntegerin interfaceDataObject- Returns:
trueif the data class can be casted toIntegerClass
-
isInterval
public boolean isInterval()
- Specified by:
isIntervalin interfaceDataObject- Returns:
trueif the data class can be casted toIntervalClass
-
isTask
public boolean isTask()
- Specified by:
isTaskin interfaceDataObject- Returns:
trueif the data class can be casted toTaskClass
-
isNode
public boolean isNode()
- Specified by:
isNodein interfaceDataObject- Returns:
trueif the data class can be casted toNodeClass
-
isDataReference
public boolean isDataReference()
- Specified by:
isDataReferencein interfaceDataObject- Returns:
trueif the data class can be casted toDataReferenceClass
-
isWorkflow
public boolean isWorkflow()
- Specified by:
isWorkflowin interfaceDataObject- Returns:
trueif the data class can be casted toWorkflowClass
-
isSubWorkflow
public boolean isSubWorkflow()
- Specified by:
isSubWorkflowin interfaceDataObject- Returns:
trueif the data class can be casted toSubWorkflowClass
-
isNESTGraph
public boolean isNESTGraph()
- Specified by:
isNESTGraphin interfaceDataObject- Returns:
trueif the data class can be casted toNESTGraphClass
-
isNESTSequentialWorkflow
public boolean isNESTSequentialWorkflow()
- Specified by:
isNESTSequentialWorkflowin interfaceDataObject- Returns:
trueif the data class can be casted toNESTSequentialWorkflowClass
-
isNESTWorkflow
public boolean isNESTWorkflow()
- Specified by:
isNESTWorkflowin interfaceDataObject- Returns:
trueif the data class can be casted toNESTWorkflowClass
-
isNESTNode
public boolean isNESTNode()
- Specified by:
isNESTNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTNodeClass
-
isNESTDataNode
public boolean isNESTDataNode()
- Specified by:
isNESTDataNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTDataNodeClass
-
isNESTTaskNode
public boolean isNESTTaskNode()
- Specified by:
isNESTTaskNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTTaskNodeClass
-
isNESTSequenceNode
public boolean isNESTSequenceNode()
- Specified by:
isNESTSequenceNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTTaskNodeClassorNESTControlflowNodeClass
-
isNESTWorkflowNode
public boolean isNESTWorkflowNode()
- Specified by:
isNESTWorkflowNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTWorkflowNodeClass
-
isNESTSubWorkflowNode
public boolean isNESTSubWorkflowNode()
- Specified by:
isNESTSubWorkflowNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTSubWorkflowNodeClass
-
isNESTControlflowNode
public boolean isNESTControlflowNode()
- Specified by:
isNESTControlflowNodein interfaceDataObject- Returns:
trueif the data class can be casted toNESTControlflowNodeClass
-
isNESTEdge
public boolean isNESTEdge()
- Specified by:
isNESTEdgein interfaceDataObject- Returns:
trueif the data class can be casted toNESTEdgeClass
-
isNESTDataflowEdge
public boolean isNESTDataflowEdge()
- Specified by:
isNESTDataflowEdgein interfaceDataObject- Returns:
trueif the data class can be casted toNESTDataflowEdgeClass
-
isNESTControlflowEdge
public boolean isNESTControlflowEdge()
- Specified by:
isNESTControlflowEdgein interfaceDataObject- Returns:
trueif the data class can be casted toNESTControlflowEdgeClass
-
isNESTConstraintEdge
public boolean isNESTConstraintEdge()
- Specified by:
isNESTConstraintEdgein interfaceDataObject- Returns:
trueif the data class can be casted toNESTConstraintEdgeClass
-
isNESTPartOfEdge
public boolean isNESTPartOfEdge()
- Specified by:
isNESTPartOfEdgein interfaceDataObject- Returns:
trueif the data class can be casted toNESTPartOfEdgeClass
-
isSequence
public boolean isSequence()
- Specified by:
isSequencein interfaceDataObject- Returns:
trueif the data class can be casted toSequenceClass
-
isDataflowWrapper
public boolean isDataflowWrapper()
- Specified by:
isDataflowWrapperin interfaceDataObject- Returns:
trueif the data class can be casted toDataflowWrapperClass
-
isKindOf
public boolean isKindOf(DataClass anotherClass)
Description copied from interface:DataObjectCheck if the object is an instance of the givenDataClassor of some of its sub-classes.- Specified by:
isKindOfin interfaceDataObject- Returns:
trueif the data class of this object is a subclass of the given class.
-
hasSystemClassName
public boolean hasSystemClassName(String systemClassName)
Description copied from interface:DataObjectCheck if the object's data class has the given system class name.- Specified by:
hasSystemClassNamein interfaceDataObject- Parameters:
systemClassName- system class name- Returns:
trueif the data class of this object has the given system class name.
-
hasClassName
public boolean hasClassName(String className)
Description copied from interface:DataObjectCheck if the object's data class has the given class name.- Specified by:
hasClassNamein interfaceDataObject- Parameters:
className- class name- Returns:
trueif the data class of this object has the given class name.
-
isList
public boolean isList()
- Specified by:
isListin interfaceDataObject- Returns:
trueif the data class can be casted toListClass
-
isMemberOf
public boolean isMemberOf(DataClass anotherClass)
Description copied from interface:DataObjectCheck if this object can be referenced from the givenDataClass- Specified by:
isMemberOfin interfaceDataObject- Returns:
trueif the data class of this objects is used in the given class.
-
isNumeric
public boolean isNumeric()
- Specified by:
isNumericin interfaceDataObject- Returns:
trueif the data class can be casted toNumericClass
-
isURI
public boolean isURI()
- Specified by:
isURIin interfaceDataObject- Returns:
trueif the data class can be casted toURIClass
-
isSet
public boolean isSet()
- Specified by:
isSetin interfaceDataObject- Returns:
trueif the data class can be casted toSetClass
-
isString
public boolean isString()
- Specified by:
isStringin interfaceDataObject- Returns:
trueif the data class can be casted toStringClass
-
isTime
public boolean isTime()
- Specified by:
isTimein interfaceDataObject- Returns:
trueif the data class can be casted toTimeClass
-
isTimestamp
public boolean isTimestamp()
- Specified by:
isTimestampin interfaceDataObject- Returns:
trueif the data class can be casted toTimestampClass
-
isUnion
public boolean isUnion()
- Specified by:
isUnionin interfaceDataObject- Returns:
trueif the data class can be casted toUnionClass
-
isVoid
public boolean isVoid()
- Specified by:
isVoidin interfaceDataObject- Returns:
trueif the data class can be casted toVoidClass
-
removeId
public void removeId()
Description copied from interface:DataObjectRemoves the given objectId from the set of ids. If the given objectId not exists or is null nothing will happen.- Specified by:
removeIdin interfaceDataObject
-
deepCopy
public void deepCopy(DataObjectImpl dataObject)
-
copy
public DataObject copy()
Description copied from interface:DataObjectMakes a deep copy of the data object- Specified by:
copyin interfaceDataObject- Returns:
- deep copy of the data object
-
toXML
public String toXML()
Description copied from interface:DataObjectConverts the data object to XML- Specified by:
toXMLin interfaceDataObject- Returns:
- XML String of the data object
-
toDetailedString
public String toDetailedString()
Description copied from interface:DataObjectReturns a detailed String, if the output of the standard toString() method would be to long.- Specified by:
toDetailedStringin interfaceDataObject- Returns:
-
assertSameValueAsIn
public void assertSameValueAsIn(DataObject object) throws AssertSameValueAsInException
- Specified by:
assertSameValueAsInin interfaceDataObject- Throws:
AssertSameValueAsInException
-
hasSameValueAsIn
public boolean hasSameValueAsIn(DataObject object)
Description copied from interface:DataObjectThis method makes a deep compare. For atomic objects this is equal to theequalmethod. For sets, lists, aggregates, and others a deeper comparision is performed.- Specified by:
hasSameValueAsInin interfaceDataObject- Parameters:
object- The object to compare.- Returns:
trueif the givenobjecthas the same value(s) as this one.
-
-