org.plasma.sdo.core
Class CoreDataGraph

java.lang.Object
  extended by org.plasma.sdo.core.CoreDataGraph
All Implemented Interfaces:
DataGraph, java.io.Serializable, PlasmaDataGraph

public class CoreDataGraph
extends java.lang.Object
implements PlasmaDataGraph

See Also:
Serialized Form

Constructor Summary
CoreDataGraph()
           
CoreDataGraph(PlasmaDataObject root)
           
 
Method Summary
 void accept(PlasmaDataGraphEventVisitor visitor)
          Begin breadth-first traversal of this DataGraph, the given visitor receiving various events for each graph node traversed.
 void accept(PlasmaDataGraphVisitor visitor)
          Begin breadth-first traversal of this DataGraph, the given visitor receiving "visit" events for each graph node traversed.
 void acceptDepthFirst(PlasmaDataGraphVisitor visitor)
          Begin depth-first traversal of this DataGraph, the given visitor receiving "visit" events for each graph node traversed.
 DataObject createRootObject(java.lang.String namespaceURI, java.lang.String typeName)
          Creates a new root data object of the specified type.
 DataObject createRootObject(Type type)
          Returns the root data object of this data graph.
 java.lang.String dump()
           
 java.lang.String dumpDepthFirst()
           
 ChangeSummary getChangeSummary()
          Returns the change summary associated with this data graph.
 java.lang.Object getId()
          Returns an object to be used and managed by client Data Access Services as an identifier for a Data Graph.
 java.lang.String getPath(DataObject dataObject)
          Calculates and returns the path relative to the data-graph root for the given data object.
 DataObject getRootObject()
          Returns the root data object of this data graph.
 Type getType(java.lang.String uri, java.lang.String typeName)
          Returns the type with the given the URI, or contained by the resource at the given URI, and with the given name.
 java.util.UUID getUUID()
          Returns the UUID for this data graph, which is the same UUID used for the root Data Object.
 java.lang.String getUUIDAsString()
          Returns the UUID for this data graph, which is the same UUID used for the root Data Object, as a character string.
 DataObject removeRootObject()
          Detaches and returns the root data object of this data graph.
 void setId(java.lang.Object id)
          Sets an object to be used and managed by client Data Access Services as an identifier for a Data Graph.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoreDataGraph

public CoreDataGraph()

CoreDataGraph

public CoreDataGraph(PlasmaDataObject root)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getUUID

public java.util.UUID getUUID()
Returns the UUID for this data graph, which is the same UUID used for the root Data Object.

Specified by:
getUUID in interface PlasmaDataGraph
Returns:
the UUID for this data graph, which is the same UUID used for the root Data Object.

getUUIDAsString

public java.lang.String getUUIDAsString()
Returns the UUID for this data graph, which is the same UUID used for the root Data Object, as a character string.

Specified by:
getUUIDAsString in interface PlasmaDataGraph
Returns:
the UUID for this data graph, which is the same UUID used for the root Data Object, as a character string.

setId

public void setId(java.lang.Object id)
Sets an object to be used and managed by client Data Access Services as an identifier for a Data Graph.

Specified by:
setId in interface PlasmaDataGraph
Parameters:
id - the identifier

getId

public java.lang.Object getId()
Returns an object to be used and managed by client Data Access Services as an identifier for a Data Graph.

Specified by:
getId in interface PlasmaDataGraph
Returns:
the identifier

createRootObject

public DataObject createRootObject(java.lang.String namespaceURI,
                                   java.lang.String typeName)
Creates a new root data object of the specified type. An exception is thrown if a root object exists.

Specified by:
createRootObject in interface DataGraph
Parameters:
namespaceURI - namespace of the type.
typeName - name of the type.
Returns:
the new root.
Throws:
java.lang.IllegalStateException - if the root object already exists.
See Also:
createRootObject(Type), getType(String, String)

createRootObject

public DataObject createRootObject(Type type)
Returns the root data object of this data graph.

Specified by:
createRootObject in interface DataGraph
Parameters:
type - the type of the new root.
Returns:
the root data object.
See Also:
DataObject.getDataGraph()

getChangeSummary

public ChangeSummary getChangeSummary()
Returns the change summary associated with this data graph.

Specified by:
getChangeSummary in interface DataGraph
Returns:
the change summary.
See Also:
ChangeSummary.getDataGraph()

getRootObject

public DataObject getRootObject()
Returns the root data object of this data graph.

Specified by:
getRootObject in interface DataGraph
Returns:
the root data object.
See Also:
DataObject.getDataGraph()

removeRootObject

public DataObject removeRootObject()
Detaches and returns the root data object of this data graph.

Specified by:
removeRootObject in interface PlasmaDataGraph
Returns:
the root data object.
See Also:
DataObject.getDataGraph()

getType

public Type getType(java.lang.String uri,
                    java.lang.String typeName)
Returns the type with the given the URI, or contained by the resource at the given URI, and with the given name.

Specified by:
getType in interface DataGraph
Parameters:
uri - the namespace URI of a type or the location URI of a resource containing a type.
typeName - name of a type.
Returns:
the type with the corresponding namespace and name.

getPath

public java.lang.String getPath(DataObject dataObject)
Calculates and returns the path relative to the data-graph root for the given data object.

Specified by:
getPath in interface PlasmaDataGraph
Parameters:
dataObject - the target data object
Returns:
the path string

accept

public void accept(PlasmaDataGraphVisitor visitor)
Begin breadth-first traversal of this DataGraph, the given visitor receiving "visit" events for each graph node traversed.

Specified by:
accept in interface PlasmaDataGraph
Parameters:
visitor - the graph visitor receiving traversal events
See Also:
DataGraph, DataObject, PlasmaDataGraph, PlasmaDataObject, PlasmaDataGraphVisitor.visit()

acceptDepthFirst

public void acceptDepthFirst(PlasmaDataGraphVisitor visitor)
Begin depth-first traversal of this DataGraph, the given visitor receiving "visit" events for each graph node traversed.

Specified by:
acceptDepthFirst in interface PlasmaDataGraph
Parameters:
visitor - the graph visitor receiving traversal events
See Also:
DataGraph, DataObject, PlasmaDataGraph, PlasmaDataObject, PlasmaDataGraphVisitor.visit()

accept

public void accept(PlasmaDataGraphEventVisitor visitor)
Begin breadth-first traversal of this DataGraph, the given visitor receiving various events for each graph node traversed.

Specified by:
accept in interface PlasmaDataGraph
Parameters:
visitor - the graph visitor receiving traversal events
See Also:
DataGraph, DataObject, PlasmaDataGraph, PlasmaDataObject, PlasmaDataGraphEventVisitor.start(), PlasmaDataGraphEventVisitor.end()

dump

public java.lang.String dump()
Specified by:
dump in interface PlasmaDataGraph

dumpDepthFirst

public java.lang.String dumpDepthFirst()
Specified by:
dumpDepthFirst in interface PlasmaDataGraph


Copyright © 2013. All Rights Reserved.