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
- Author:
- Rainer Maximini
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperty
(PropertyTreeNode node) Add a property to the property tree.void
addProperty
(String name, String value) Add a property to the property tree.void
assertSameValueAsIn
(DataObject object) copy()
Makes a deep copy of the data objectvoid
deepCopy
(DataObjectImpl dataObject) getAllProperties
(String key) Searches for all property values within the property tree.Searches for all property nodes within the property tree.getId()
getModel()
Each object knows to which model it belongs.getProperty
(String key) Gets the value of the node that has the given name and is found first.String[]
To receive all properties that are set byPropertyHandler.addProperty(String, String)
use this method.getPropertyNode
(String key) Search for a property node within the whole tree of properties.Returns the propertyRootNode of the implementing object.boolean
hasClassName
(String className) Check if the object's data class has the given class name.boolean
Tests, if the implementing object has properties.boolean
hasSameValueAsIn
(DataObject object) This method makes a deep compare.boolean
hasSystemClassName
(String systemClassName) Check if the object's data class has the given system class name.boolean
boolean
isAtomic()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isDate()
boolean
isDouble()
boolean
boolean
boolean
Check if the object is an instance of the givenDataClass
or of some of its sub-classes.boolean
isList()
boolean
isMemberOf
(DataClass anotherClass) Check if this object can be referenced from the givenDataClass
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isNode()
boolean
boolean
boolean
isSet()
boolean
isString()
boolean
boolean
isTask()
boolean
isTime()
boolean
boolean
isUnion()
boolean
isURI()
boolean
isVoid()
boolean
void
removeId()
Removes the given objectId from the set of ids.removeProperty
(String name) Remove any node from the property tree.void
setDataClass
(DataClass dataClass) void
Adds the given objectId to the set of ids.void
Set the propertyRootNode of the implementing object.Returns a detailed String, if the output of the standard toString() method would be to long.toString()
toXML()
Converts the data object to XML
-
Field Details
-
objectId
-
-
Constructor Details
-
DataObjectImpl
public DataObjectImpl() -
DataObjectImpl
-
-
Method Details
-
getDataClass
- Specified by:
getDataClass
in interfaceDataObject
- Returns:
- The data class of the object.
-
setDataClass
- Specified by:
setDataClass
in interfaceDataObject
-
getId
- Specified by:
getId
in interfaceDataObject
- Returns:
- objectId of the given base *
- See Also:
-
setId
Description copied from interface:DataObject
Adds the given objectId to the set of ids.- Specified by:
setId
in interfaceDataObject
- Parameters:
objectId
- that will be added to the set of ids- See Also:
-
getModel
Description copied from interface:DataObject
Each object knows to which model it belongs.- Specified by:
getModel
in interfaceDataObject
- Returns:
- The data model to that the object belongs.
-
getPropertyRootNode
Description copied from interface:PropertyHandler
Returns the propertyRootNode of the implementing object.- Specified by:
getPropertyRootNode
in interfacePropertyHandler
- Returns:
- the propertyRootNode if set. Null otherwise.
-
setPropertyRootNode
Description copied from interface:PropertyHandler
Set the propertyRootNode of the implementing object.- Specified by:
setPropertyRootNode
in interfacePropertyHandler
- Parameters:
node
- to be used as property root node
-
getPropertyNode
Description copied from interface:PropertyHandler
Search 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:
getPropertyNode
in 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
Description copied from interface:PropertyHandler
Gets 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:
getProperty
in interfacePropertyHandler
- Parameters:
key
- The name of the property.- Returns:
- The property value or null if the property does not exists.
- See Also:
-
getPropertyNames
Description copied from interface:PropertyHandler
To 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:
getPropertyNames
in interfacePropertyHandler
- Returns:
- An array of defined property names.
-
removeProperty
Description copied from interface:PropertyHandler
Remove any node from the property tree. The first node to be found with this name, will be removed (including all children).- Specified by:
removeProperty
in 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
Description copied from interface:PropertyHandler
Add a property to the property tree. This property node (or subtree) will be added right below the generic root.- Specified by:
addProperty
in interfacePropertyHandler
- Parameters:
node
- the node to be added
-
addProperty
Description copied from interface:PropertyHandler
Add a property to the property tree. This property node (or subtree) will be added right below the generic root.- Specified by:
addProperty
in interfacePropertyHandler
- Parameters:
name
- the name of the node to addvalue
- the value of the node to add- See Also:
-
getAllPropertyNodes
Description copied from interface:PropertyHandler
Searches for all property nodes within the property tree. The result will never be null (but could be an empty set).- Specified by:
getAllPropertyNodes
in interfacePropertyHandler
- Parameters:
key
- the key of the property- Returns:
- a set with the found property nodes
-
getAllProperties
Description copied from interface:PropertyHandler
Searches for all property values within the property tree. The result will never be null (but could be an empty set).- Specified by:
getAllProperties
in interfacePropertyHandler
- Parameters:
key
- the key of the property- Returns:
- a set with the found property nodes
-
hasProperties
public boolean hasProperties()Description copied from interface:PropertyHandler
Tests, if the implementing object has properties. This can be tested by looking for a generic root node.- Specified by:
hasProperties
in interfacePropertyHandler
- Returns:
- true, if a property is set, false otherwise.
-
isAggregate
public boolean isAggregate()- Specified by:
isAggregate
in interfaceDataObject
- Returns:
true
if the data class can be casted toAggregateClass
-
isAtomic
public boolean isAtomic()- Specified by:
isAtomic
in interfaceDataObject
- Returns:
true
if the data class can be casted toAtomicClass
-
isBoolean
public boolean isBoolean()- Specified by:
isBoolean
in interfaceDataObject
- Returns:
true
if the data class can be casted toBooleanClass
-
isByteArray
public boolean isByteArray()- Specified by:
isByteArray
in interfaceDataObject
- Returns:
true
if the data class can be casted toByteArrayClass
-
isChronologic
public boolean isChronologic()- Specified by:
isChronologic
in interfaceDataObject
- Returns:
true
if the data class can be casted toChronologicClass
-
isCollection
public boolean isCollection()- Specified by:
isCollection
in interfaceDataObject
- Returns:
true
if the data class can be casted toCollectionClass
-
isDate
public boolean isDate()- Specified by:
isDate
in interfaceDataObject
- Returns:
true
if the data class can be casted toDateClass
-
isDouble
public boolean isDouble()- Specified by:
isDouble
in interfaceDataObject
- Returns:
true
if the data class can be casted toDoubleClass
-
isInteger
public boolean isInteger()- Specified by:
isInteger
in interfaceDataObject
- Returns:
true
if the data class can be casted toIntegerClass
-
isInterval
public boolean isInterval()- Specified by:
isInterval
in interfaceDataObject
- Returns:
true
if the data class can be casted toIntervalClass
-
isTask
public boolean isTask()- Specified by:
isTask
in interfaceDataObject
- Returns:
true
if the data class can be casted toTaskClass
-
isNode
public boolean isNode()- Specified by:
isNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNodeClass
-
isDataReference
public boolean isDataReference()- Specified by:
isDataReference
in interfaceDataObject
- Returns:
true
if the data class can be casted toDataReferenceClass
-
isWorkflow
public boolean isWorkflow()- Specified by:
isWorkflow
in interfaceDataObject
- Returns:
true
if the data class can be casted toWorkflowClass
-
isSubWorkflow
public boolean isSubWorkflow()- Specified by:
isSubWorkflow
in interfaceDataObject
- Returns:
true
if the data class can be casted toSubWorkflowClass
-
isNESTGraph
public boolean isNESTGraph()- Specified by:
isNESTGraph
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTGraphClass
-
isNESTSequentialWorkflow
public boolean isNESTSequentialWorkflow()- Specified by:
isNESTSequentialWorkflow
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTSequentialWorkflowClass
-
isNESTWorkflow
public boolean isNESTWorkflow()- Specified by:
isNESTWorkflow
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTWorkflowClass
-
isNESTNode
public boolean isNESTNode()- Specified by:
isNESTNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTNodeClass
-
isNESTDataNode
public boolean isNESTDataNode()- Specified by:
isNESTDataNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTDataNodeClass
-
isNESTTaskNode
public boolean isNESTTaskNode()- Specified by:
isNESTTaskNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTTaskNodeClass
-
isNESTSequenceNode
public boolean isNESTSequenceNode()- Specified by:
isNESTSequenceNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTTaskNodeClass
orNESTControlflowNodeClass
-
isNESTWorkflowNode
public boolean isNESTWorkflowNode()- Specified by:
isNESTWorkflowNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTWorkflowNodeClass
-
isNESTSubWorkflowNode
public boolean isNESTSubWorkflowNode()- Specified by:
isNESTSubWorkflowNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTSubWorkflowNodeClass
-
isNESTControlflowNode
public boolean isNESTControlflowNode()- Specified by:
isNESTControlflowNode
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTControlflowNodeClass
-
isNESTEdge
public boolean isNESTEdge()- Specified by:
isNESTEdge
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTEdgeClass
-
isNESTDataflowEdge
public boolean isNESTDataflowEdge()- Specified by:
isNESTDataflowEdge
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTDataflowEdgeClass
-
isNESTControlflowEdge
public boolean isNESTControlflowEdge()- Specified by:
isNESTControlflowEdge
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTControlflowEdgeClass
-
isNESTConstraintEdge
public boolean isNESTConstraintEdge()- Specified by:
isNESTConstraintEdge
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTConstraintEdgeClass
-
isNESTPartOfEdge
public boolean isNESTPartOfEdge()- Specified by:
isNESTPartOfEdge
in interfaceDataObject
- Returns:
true
if the data class can be casted toNESTPartOfEdgeClass
-
isSequence
public boolean isSequence()- Specified by:
isSequence
in interfaceDataObject
- Returns:
true
if the data class can be casted toSequenceClass
-
isDataflowWrapper
public boolean isDataflowWrapper()- Specified by:
isDataflowWrapper
in interfaceDataObject
- Returns:
true
if the data class can be casted toDataflowWrapperClass
-
isKindOf
Description copied from interface:DataObject
Check if the object is an instance of the givenDataClass
or of some of its sub-classes.- Specified by:
isKindOf
in interfaceDataObject
- Returns:
true
if the data class of this object is a subclass of the given class.
-
hasSystemClassName
Description copied from interface:DataObject
Check if the object's data class has the given system class name.- Specified by:
hasSystemClassName
in interfaceDataObject
- Parameters:
systemClassName
- system class name- Returns:
true
if the data class of this object has the given system class name.
-
hasClassName
Description copied from interface:DataObject
Check if the object's data class has the given class name.- Specified by:
hasClassName
in interfaceDataObject
- Parameters:
className
- class name- Returns:
true
if the data class of this object has the given class name.
-
isList
public boolean isList()- Specified by:
isList
in interfaceDataObject
- Returns:
true
if the data class can be casted toListClass
-
isMemberOf
Description copied from interface:DataObject
Check if this object can be referenced from the givenDataClass
- Specified by:
isMemberOf
in interfaceDataObject
- Returns:
true
if the data class of this objects is used in the given class.
-
isNumeric
public boolean isNumeric()- Specified by:
isNumeric
in interfaceDataObject
- Returns:
true
if the data class can be casted toNumericClass
-
isURI
public boolean isURI()- Specified by:
isURI
in interfaceDataObject
- Returns:
true
if the data class can be casted toURIClass
-
isSet
public boolean isSet()- Specified by:
isSet
in interfaceDataObject
- Returns:
true
if the data class can be casted toSetClass
-
isString
public boolean isString()- Specified by:
isString
in interfaceDataObject
- Returns:
true
if the data class can be casted toStringClass
-
isTime
public boolean isTime()- Specified by:
isTime
in interfaceDataObject
- Returns:
true
if the data class can be casted toTimeClass
-
isTimestamp
public boolean isTimestamp()- Specified by:
isTimestamp
in interfaceDataObject
- Returns:
true
if the data class can be casted toTimestampClass
-
isUnion
public boolean isUnion()- Specified by:
isUnion
in interfaceDataObject
- Returns:
true
if the data class can be casted toUnionClass
-
isVoid
public boolean isVoid()- Specified by:
isVoid
in interfaceDataObject
- Returns:
true
if the data class can be casted toVoidClass
-
removeId
public void removeId()Description copied from interface:DataObject
Removes the given objectId from the set of ids. If the given objectId not exists or is null nothing will happen.- Specified by:
removeId
in interfaceDataObject
-
toString
-
deepCopy
-
copy
Description copied from interface:DataObject
Makes a deep copy of the data object- Specified by:
copy
in interfaceDataObject
- Returns:
- deep copy of the data object
-
toXML
Description copied from interface:DataObject
Converts the data object to XML- Specified by:
toXML
in interfaceDataObject
- Returns:
- XML String of the data object
-
toDetailedString
Description copied from interface:DataObject
Returns a detailed String, if the output of the standard toString() method would be to long.- Specified by:
toDetailedString
in interfaceDataObject
- Returns:
-
assertSameValueAsIn
- Specified by:
assertSameValueAsIn
in interfaceDataObject
- Throws:
AssertSameValueAsInException
-
hasSameValueAsIn
Description copied from interface:DataObject
This method makes a deep compare. For atomic objects this is equal to theequal
method. For sets, lists, aggregates, and others a deeper comparision is performed.- Specified by:
hasSameValueAsIn
in interfaceDataObject
- Parameters:
object
- The object to compare.- Returns:
true
if the givenobject
has the same value(s) as this one.
-