org.plasma.sdo
Interface PlasmaDataObject

All Superinterfaces:
DataObject, java.io.Serializable
All Known Subinterfaces:
Constraint, GlobalVariable, GlobalVariable, Table, Table, TableColumn, TableColumn, TableColumnComment, TableColumnConstraint, TableColumnConstraint, TableColumnKeyUsage, TableComment, TableConstraint, Version, Version, View, View, ViewColumn, ViewColumnComment, ViewComment
All Known Implementing Classes:
ConstraintImpl, CoreDataObject, GlobalVariableImpl, GlobalVariableImpl, TableColumnCommentImpl, TableColumnConstraintImpl, TableColumnConstraintImpl, TableColumnImpl, TableColumnImpl, TableColumnKeyUsageImpl, TableCommentImpl, TableConstraintImpl, TableImpl, TableImpl, VersionImpl, VersionImpl, ViewColumnCommentImpl, ViewColumnImpl, ViewCommentImpl, ViewImpl, ViewImpl

public interface PlasmaDataObject
extends DataObject

A data object is a representation of some structured data. It is the fundamental component in the SDO (Service Data Objects) package. Data objects support reflection, path-based accesss, convenience creation and deletion methods, and the ability to be part of a data graph.

Each data object holds its data as a series of Properties. Properties can be accessed by name, property index, or using the property meta object itself. A data object can also contain references to other data objects, through reference-type Properties.

A data object has a series of convenience accessors for its Properties. These methods either use a path (String), a property index, or the property's meta object itself, to identify the property. Some examples of the path-based accessors are as follows:

 DataObject company = ...;
 company.get("name");                   is the same as company.get(company.getType().getProperty("name"))
 company.set("name", "acme");
 company.get("department.0/name")       is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
                                        .n  indexes from 0 ... implies the name property of the first department
 company.get("department[1]/name")      [] indexes from 1 ... implies the name property of the first department
 company.get("department[number=123]")  returns the first department where number=123
 company.get("..")                      returns the containing data object
 company.get("/")                       returns the root containing data object

There are general accessors for Properties, i.e., get and set, as well as specific accessors for the primitive types and commonly used data types like String, Date, List, BigInteger, and BigDecimal.


Method Summary
 void accept(PlasmaDataGraphEventVisitor visitor)
          Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given visitor receiving various events for each graph node traversed.
 void accept(PlasmaDataGraphVisitor visitor)
          Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given visitor receiving "visit" events for each graph node traversed.
 void accept(PlasmaDataGraphVisitor visitor, int maxLevel)
          Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given visitor receiving "visit" events for each graph node traversed.
 void acceptDepthFirst(PlasmaDataGraphVisitor visitor)
          Begin depth-first traversal of a DataGraph with this DataObject as the graph root, the given visitor receiving "visit" events for each graph node traversed.
 void add(Property property, java.lang.Object value)
          Adds the given value to the given multi=valued property.
 boolean contains(DataObject dataObject)
          Returns true if this data object is the container for the given data object.
 java.lang.String dump()
           
 java.lang.String dumpDepthFirst()
           
 DataObject find(java.lang.String key)
           
 PlasmaDataObject getDataObject()
           
 java.util.UUID getUUID()
          Returns the UUID for this data object.
 java.lang.String getUUIDAsString()
          Returns the UUID for this data object as a character string.
 void remove()
           
 void remove(Property property, java.lang.Object value)
          Removes the given value from this data object for the given multi-valued property.
 void reset(SnapshotMap commitMap, java.lang.String username)
          Synchronizes the state of this data object to that of it's data store given the map of UUID's and associated info resulting from a successful commit.
 void resetUUID(java.util.UUID uuid)
          Resets the UUID after creation for cases where the UUID is stored externally and services creating data objects need to preserve the stored UUIDs across service calls.
 void setContainer(DataObject container)
          Sets the current container for this DataObject
 void setContainmentProperty(Property containmentProperty)
          Sets the declared reference Property within the Type for the container which is our current containment reference property
 void setDataGraph(DataGraph dataGraph)
           
 
Methods inherited from interface commonj.sdo.DataObject
createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, delete, detach, get, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChangeSummary, getChar, getChar, getChar, getContainer, getContainmentProperty, getDataGraph, getDataObject, getDataObject, getDataObject, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInstanceProperties, getInstanceProperty, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getProperty, getRootObject, getSequence, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, getType, isSet, isSet, isSet, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset, unset
 

Method Detail

setDataGraph

void setDataGraph(DataGraph dataGraph)

setContainer

void setContainer(DataObject container)
Sets the current container for this DataObject


setContainmentProperty

void setContainmentProperty(Property containmentProperty)
Sets the declared reference Property within the Type for the container which is our current containment reference property


add

void add(Property property,
         java.lang.Object value)
Adds the given value to the given multi=valued property.

Parameters:
property - the multi-valued property
value - the value to add - can be a list of values

remove

void remove(Property property,
            java.lang.Object value)
Removes the given value from this data object for the given multi-valued property.

Parameters:
property - multi-valued the property
value - the value to remove
Throws:
java.lang.UnsupportedOperationException - if the given property is not multi-valued

reset

void reset(SnapshotMap commitMap,
           java.lang.String username)
Synchronizes the state of this data object to that of it's data store given the map of UUID's and associated info resulting from a successful commit.

Parameters:
commitMap - - the map of UUID's mapped to, e.g. data store generated sequence numbers.
username - - the user who committed the modifications.

remove

void remove()

contains

boolean contains(DataObject dataObject)
Returns true if this data object is the container for the given data object.

Parameters:
dataObject - the data object
Returns:
true if this data object is the container for the given data object

getUUID

java.util.UUID getUUID()
Returns the UUID for this data object.

Returns:
the UUID for this data object.

resetUUID

void resetUUID(java.util.UUID uuid)
Resets the UUID after creation for cases where the UUID is stored externally and services creating data objects need to preserve the stored UUIDs across service calls. Refreshes the integral hash and other elements dependent on the cached UUID.

Parameters:
uuid - the UUID

getUUIDAsString

java.lang.String getUUIDAsString()
Returns the UUID for this data object as a character string.

Returns:
the UUID for this data object as a character string.

getDataObject

PlasmaDataObject getDataObject()

accept

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

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

accept

void accept(PlasmaDataGraphVisitor visitor,
            int maxLevel)
Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given visitor receiving "visit" events for each graph node traversed.

Parameters:
visitor - the graph visitor receiving traversal events
maxLevel - the maximum number of "hierarchical" levels to traverse
See Also:
DataGraph, DataObject, PlasmaDataGraph, PlasmaDataObject, PlasmaDataGraphVisitor.visit()

acceptDepthFirst

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

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

accept

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

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

find

DataObject find(java.lang.String key)

dump

java.lang.String dump()

dumpDepthFirst

java.lang.String dumpDepthFirst()


Copyright © 2013. All Rights Reserved.