|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PlasmaDataObject
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)
|
| Method Detail |
|---|
void setDataGraph(DataGraph dataGraph)
void setContainer(DataObject container)
void setContainmentProperty(Property containmentProperty)
void add(Property property,
java.lang.Object value)
property - the multi-valued propertyvalue - the value to add - can be a list of values
void remove(Property property,
java.lang.Object value)
property - multi-valued the propertyvalue - the value to remove
java.lang.UnsupportedOperationException - if the given property
is not multi-valued
void reset(SnapshotMap commitMap,
java.lang.String username)
commitMap - - the map of UUID's mapped to, e.g. data store
generated sequence numbers.username - - the user who committed the modifications.void remove()
boolean contains(DataObject dataObject)
dataObject - the data object
java.util.UUID getUUID()
void resetUUID(java.util.UUID uuid)
uuid - the UUIDjava.lang.String getUUIDAsString()
PlasmaDataObject getDataObject()
void accept(PlasmaDataGraphVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()
void accept(PlasmaDataGraphVisitor visitor,
int maxLevel)
visitor - the graph visitor receiving traversal eventsmaxLevel - the maximum number of "hierarchical" levels to traverseDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()void acceptDepthFirst(PlasmaDataGraphVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()void accept(PlasmaDataGraphEventVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()DataObject find(java.lang.String key)
java.lang.String dump()
java.lang.String dumpDepthFirst()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||