public interface DataObject
extends java.io.Serializable
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.
Modifier and Type | Method and Description |
---|---|
DataObject |
createDataObject(int propertyIndex)
Returns a new
data object contained by this object using the specified property,
which must be a containment property . |
DataObject |
createDataObject(int propertyIndex,
java.lang.String namespaceURI,
java.lang.String typeName)
Returns a new
data object contained by this object using the specified property,
which must be a containment property . |
DataObject |
createDataObject(Property property)
Returns a new
data object contained by this object using the specified property,
which must be a containment property . |
DataObject |
createDataObject(Property property,
Type type)
Returns a new
data object contained by this object using the specified property,
which must be of containment type . |
DataObject |
createDataObject(java.lang.String propertyName)
Returns a new
data object contained by this object using the specified property,
which must be a containment property . |
DataObject |
createDataObject(java.lang.String propertyName,
java.lang.String namespaceURI,
java.lang.String typeName)
Returns a new
data object contained by this object using the specified property,
which must be a containment property . |
void |
delete()
Remove this object from its container and then unset all its non-
readOnly Properties. |
void |
detach()
Removes this DataObject from its container, if any.
|
java.lang.Object |
get(int propertyIndex)
Returns the value of the property at the specified index in
property list
of this object's type . |
java.lang.Object |
get(Property property)
Returns the value of the given property of this object.
|
java.lang.Object |
get(java.lang.String path)
Returns the value of a property of either this object or an object reachable from it, as identified by the
specified path.
|
java.math.BigDecimal |
getBigDecimal(int propertyIndex)
Returns the value of a
BigDecimal property identified by the specified property index. |
java.math.BigDecimal |
getBigDecimal(Property property)
Returns the value of the specified
BigDecimal property. |
java.math.BigDecimal |
getBigDecimal(java.lang.String path)
Returns the value of a
BigDecimal property identified by the specified path. |
java.math.BigInteger |
getBigInteger(int propertyIndex)
Returns the value of a
BigInteger property identified by the specified property index. |
java.math.BigInteger |
getBigInteger(Property property)
Returns the value of the specified
BigInteger property. |
java.math.BigInteger |
getBigInteger(java.lang.String path)
Returns the value of a
BigInteger property identified by the specified path. |
boolean |
getBoolean(int propertyIndex)
Returns the value of a
boolean property identified by the specified property index. |
boolean |
getBoolean(Property property)
Returns the value of the specified
boolean property. |
boolean |
getBoolean(java.lang.String path)
Returns the value of a
boolean property identified by the specified path. |
byte |
getByte(int propertyIndex)
Returns the value of a
byte property identified by the specified property index. |
byte |
getByte(Property property)
Returns the value of the specified
byte property. |
byte |
getByte(java.lang.String path)
Returns the value of a
byte property identified by the specified path. |
byte[] |
getBytes(int propertyIndex)
Returns the value of a
byte[] property identified by the specified property index. |
byte[] |
getBytes(Property property)
Returns the value of the specified
byte[] property. |
byte[] |
getBytes(java.lang.String path)
Returns the value of a
byte[] property identified by the specified path. |
ChangeSummary |
getChangeSummary()
Returns the ChangeSummary with scope covering this dataObject, or null
if there is no ChangeSummary.
|
char |
getChar(int propertyIndex)
Returns the value of a
char property identified by the specified property index. |
char |
getChar(Property property)
Returns the value of the specified
char property. |
char |
getChar(java.lang.String path)
Returns the value of a
char property identified by the specified path. |
DataObject |
getContainer()
Returns the containing
data object
or null if there is no container. |
Property |
getContainmentProperty()
Return the Property of the
data object containing this data object
or null if there is no container. |
DataGraph |
getDataGraph()
Deprecated.
|
DataObject |
getDataObject(int propertyIndex)
Returns the value of a
DataObject property identified by the specified property index. |
DataObject |
getDataObject(Property property)
Returns the value of the specified
DataObject property. |
DataObject |
getDataObject(java.lang.String path)
Returns the value of a
DataObject property identified by the specified path. |
java.util.Date |
getDate(int propertyIndex)
Returns the value of a
Date property identified by the specified property index. |
java.util.Date |
getDate(Property property)
Returns the value of the specified
Date property. |
java.util.Date |
getDate(java.lang.String path)
Returns the value of a
Date property identified by the specified path. |
double |
getDouble(int propertyIndex)
Returns the value of a
double property identified by the specified property index. |
double |
getDouble(Property property)
Returns the value of the specified
double property. |
double |
getDouble(java.lang.String path)
Returns the value of a
double property identified by the specified path. |
float |
getFloat(int propertyIndex)
Returns the value of a
float property identified by the specified property index. |
float |
getFloat(Property property)
Returns the value of the specified
float property. |
float |
getFloat(java.lang.String path)
Returns the value of a
float property identified by the specified path. |
java.util.List |
getInstanceProperties()
Returns a read-only List of the Properties currently used in this DataObject.
|
Property |
getInstanceProperty(java.lang.String propertyName)
Returns the named Property from the current instance properties,
or null if not found.
|
int |
getInt(int propertyIndex)
Returns the value of a
int property identified by the specified property index. |
int |
getInt(Property property)
Returns the value of the specified
int property. |
int |
getInt(java.lang.String path)
Returns the value of a
int property identified by the specified path. |
java.util.List |
getList(int propertyIndex)
Returns the value of a
List property identified by the specified property index. |
java.util.List |
getList(Property property)
Returns the value of the specified
List property. |
java.util.List |
getList(java.lang.String path)
Returns the value of a
List property identified by the specified path. |
long |
getLong(int propertyIndex)
Returns the value of a
long property identified by the specified property index. |
long |
getLong(Property property)
Returns the value of the specified
long property. |
long |
getLong(java.lang.String path)
Returns the value of a
long property identified by the specified path. |
Property |
getProperty(java.lang.String propertyName)
Deprecated.
replaced by
getInstanceProperty(String) in 2.1.0 |
DataObject |
getRootObject()
Returns the root
data object . |
Sequence |
getSequence()
Returns the
Sequence for this DataObject. |
Sequence |
getSequence(int propertyIndex)
Deprecated.
in 2.1.0.
|
Sequence |
getSequence(Property property)
Deprecated.
in 2.1.0.
|
Sequence |
getSequence(java.lang.String path)
Deprecated.
in 2.1.0.
|
short |
getShort(int propertyIndex)
Returns the value of a
short property identified by the specified property index. |
short |
getShort(Property property)
Returns the value of the specified
short property. |
short |
getShort(java.lang.String path)
Returns the value of a
short property identified by the specified path. |
java.lang.String |
getString(int propertyIndex)
Returns the value of a
String property identified by the specified property index. |
java.lang.String |
getString(Property property)
Returns the value of the specified
String property. |
java.lang.String |
getString(java.lang.String path)
Returns the value of a
String property identified by the specified path. |
Type |
getType()
Returns the data object's type.
|
boolean |
isSet(int propertyIndex)
Returns whether the the property at the specified index in
property list of this object's
type , is considered to be set. |
boolean |
isSet(Property property)
Returns whether the property of the object is considered to be set.
|
boolean |
isSet(java.lang.String path)
Returns whether a property of either this object or an object reachable from it, as identified by the specified path,
is considered to be set.
|
void |
set(int propertyIndex,
java.lang.Object value)
Sets the property at the specified index in
property list of this object's
type , to the specified value. |
void |
set(Property property,
java.lang.Object value)
Sets the value of the given property of the object to the new value.
|
void |
set(java.lang.String path,
java.lang.Object value)
Sets a property of either this object or an object reachable from it, as identified by the specified path,
to the specified value.
|
void |
setBigDecimal(int propertyIndex,
java.math.BigDecimal value)
Sets the value of a
BigDecimal property identified by the specified property index, to the specified value. |
void |
setBigDecimal(Property property,
java.math.BigDecimal value)
Sets the value of the specified
BigDecimal property, to the specified value. |
void |
setBigDecimal(java.lang.String path,
java.math.BigDecimal value)
Sets the value of a
BigDecimal property identified by the specified path, to the specified value. |
void |
setBigInteger(int propertyIndex,
java.math.BigInteger value)
Sets the value of a
BigInteger property identified by the specified property index, to the specified value. |
void |
setBigInteger(Property property,
java.math.BigInteger value)
Sets the value of the specified
BigInteger property, to the specified value. |
void |
setBigInteger(java.lang.String path,
java.math.BigInteger value)
Sets the value of a
BigInteger property identified by the specified path, to the specified value. |
void |
setBoolean(int propertyIndex,
boolean value)
Sets the value of a
boolean property identified by the specified property index, to the specified value. |
void |
setBoolean(Property property,
boolean value)
Sets the value of the specified
boolean property, to the specified value. |
void |
setBoolean(java.lang.String path,
boolean value)
Sets the value of a
boolean property identified by the specified path, to the specified value. |
void |
setByte(int propertyIndex,
byte value)
Sets the value of a
byte property identified by the specified property index, to the specified value. |
void |
setByte(Property property,
byte value)
Sets the value of the specified
byte property, to the specified value. |
void |
setByte(java.lang.String path,
byte value)
Sets the value of a
byte property identified by the specified path, to the specified value. |
void |
setBytes(int propertyIndex,
byte[] value)
Sets the value of a
byte[] property identified by the specified property index, to the specified value. |
void |
setBytes(Property property,
byte[] value)
Sets the value of the specified
byte[] property, to the specified value. |
void |
setBytes(java.lang.String path,
byte[] value)
Sets the value of a
byte[] property identified by the specified path, to the specified value. |
void |
setChar(int propertyIndex,
char value)
Sets the value of a
char property identified by the specified property index, to the specified value. |
void |
setChar(Property property,
char value)
Sets the value of the specified
char property, to the specified value. |
void |
setChar(java.lang.String path,
char value)
Sets the value of a
char property identified by the specified path, to the specified value. |
void |
setDataObject(int propertyIndex,
DataObject value)
Sets the value of a
DataObject property identified by the specified property index, to the specified value. |
void |
setDataObject(Property property,
DataObject value)
Sets the value of the specified
DataObject property, to the specified value. |
void |
setDataObject(java.lang.String path,
DataObject value)
Sets the value of a
DataObject property identified by the specified path, to the specified value. |
void |
setDate(int propertyIndex,
java.util.Date value)
Sets the value of a
Date property identified by the specified property index, to the specified value. |
void |
setDate(Property property,
java.util.Date value)
Sets the value of the specified
Date property, to the specified value. |
void |
setDate(java.lang.String path,
java.util.Date value)
Sets the value of a
Date property identified by the specified path, to the specified value. |
void |
setDouble(int propertyIndex,
double value)
Sets the value of a
double property identified by the specified property index, to the specified value. |
void |
setDouble(Property property,
double value)
Sets the value of the specified
double property, to the specified value. |
void |
setDouble(java.lang.String path,
double value)
Sets the value of a
double property identified by the specified path, to the specified value. |
void |
setFloat(int propertyIndex,
float value)
Sets the value of a
float property identified by the specified property index, to the specified value. |
void |
setFloat(Property property,
float value)
Sets the value of the specified
float property, to the specified value. |
void |
setFloat(java.lang.String path,
float value)
Sets the value of a
float property identified by the specified path, to the specified value. |
void |
setInt(int propertyIndex,
int value)
Sets the value of a
int property identified by the specified property index, to the specified value. |
void |
setInt(Property property,
int value)
Sets the value of the specified
int property, to the specified value. |
void |
setInt(java.lang.String path,
int value)
Sets the value of a
int property identified by the specified path, to the specified value. |
void |
setList(int propertyIndex,
java.util.List value)
Sets the value of a
List property identified by the specified property index, to the specified value. |
void |
setList(Property property,
java.util.List value)
Sets the value of the specified
List property, to the specified value. |
void |
setList(java.lang.String path,
java.util.List value)
Sets the value of a
List property identified by the specified path, to the specified value. |
void |
setLong(int propertyIndex,
long value)
Sets the value of a
long property identified by the specified property index, to the specified value. |
void |
setLong(Property property,
long value)
Sets the value of the specified
long property, to the specified value. |
void |
setLong(java.lang.String path,
long value)
Sets the value of a
long property identified by the specified path, to the specified value. |
void |
setShort(int propertyIndex,
short value)
Sets the value of a
short property identified by the specified property index, to the specified value. |
void |
setShort(Property property,
short value)
Sets the value of the specified
short property, to the specified value. |
void |
setShort(java.lang.String path,
short value)
Sets the value of a
short property identified by the specified path, to the specified value. |
void |
setString(int propertyIndex,
java.lang.String value)
Sets the value of a
String property identified by the specified property index, to the specified value. |
void |
setString(Property property,
java.lang.String value)
Sets the value of the specified
String property, to the specified value. |
void |
setString(java.lang.String path,
java.lang.String value)
Sets the value of a
String property identified by the specified path, to the specified value. |
void |
unset(int propertyIndex)
Unsets the property at the specified index in
property list of this object's type . |
void |
unset(Property property)
Unsets the property of the object.
|
void |
unset(java.lang.String path)
Unsets a property of either this object or an object reachable from it, as identified by the specified path.
|
java.lang.Object get(java.lang.String path)
path
- the path to a valid object and property.get(Property)
void set(java.lang.String path, java.lang.Object value)
path
- the path to a valid object and property.value
- the new value for the property.set(Property, Object)
boolean isSet(java.lang.String path)
path
- the path to a valid object and property.isSet(Property)
void unset(java.lang.String path)
path
- the path to a valid object and property.unset(Property)
boolean getBoolean(java.lang.String path)
boolean
property identified by the specified path.path
- the path to a valid object and property.boolean
value of the specified property.get(String)
byte getByte(java.lang.String path)
byte
property identified by the specified path.path
- the path to a valid object and property.byte
value of the specified property.get(String)
char getChar(java.lang.String path)
char
property identified by the specified path.path
- the path to a valid object and property.char
value of the specified property.get(String)
double getDouble(java.lang.String path)
double
property identified by the specified path.path
- the path to a valid object and property.double
value of the specified property.get(String)
float getFloat(java.lang.String path)
float
property identified by the specified path.path
- the path to a valid object and property.float
value of the specified property.get(String)
int getInt(java.lang.String path)
int
property identified by the specified path.path
- the path to a valid object and property.int
value of the specified property.get(String)
long getLong(java.lang.String path)
long
property identified by the specified path.path
- the path to a valid object and property.long
value of the specified property.get(String)
short getShort(java.lang.String path)
short
property identified by the specified path.path
- the path to a valid object and property.short
value of the specified property.get(String)
byte[] getBytes(java.lang.String path)
byte[]
property identified by the specified path.path
- the path to a valid object and property.byte[]
value of the specified property.get(String)
java.math.BigDecimal getBigDecimal(java.lang.String path)
BigDecimal
property identified by the specified path.path
- the path to a valid object and property.BigDecimal
value of the specified property.get(String)
java.math.BigInteger getBigInteger(java.lang.String path)
BigInteger
property identified by the specified path.path
- the path to a valid object and property.BigInteger
value of the specified property.get(String)
DataObject getDataObject(java.lang.String path)
DataObject
property identified by the specified path.path
- the path to a valid object and property.DataObject
value of the specified property.get(String)
java.util.Date getDate(java.lang.String path)
Date
property identified by the specified path.path
- the path to a valid object and property.Date
value of the specified property.get(String)
java.lang.String getString(java.lang.String path)
String
property identified by the specified path.path
- the path to a valid object and property.String
value of the specified property.get(String)
java.util.List getList(java.lang.String path)
List
property identified by the specified path.path
- the path to a valid object and property.List
value of the specified property.get(String)
Sequence getSequence(java.lang.String path)
path
- the path to a valid object and property.Sequence
value of the specified property.Returns the value of a Sequence
property identified by the specified path.
An implementation may throw an UnsupportedOperationException.
,
get(String)
void setBoolean(java.lang.String path, boolean value)
boolean
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setByte(java.lang.String path, byte value)
byte
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setChar(java.lang.String path, char value)
char
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setDouble(java.lang.String path, double value)
double
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setFloat(java.lang.String path, float value)
float
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setInt(java.lang.String path, int value)
int
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setLong(java.lang.String path, long value)
long
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setShort(java.lang.String path, short value)
short
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setBytes(java.lang.String path, byte[] value)
byte[]
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setBigDecimal(java.lang.String path, java.math.BigDecimal value)
BigDecimal
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setBigInteger(java.lang.String path, java.math.BigInteger value)
BigInteger
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setDataObject(java.lang.String path, DataObject value)
DataObject
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setDate(java.lang.String path, java.util.Date value)
Date
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setString(java.lang.String path, java.lang.String value)
String
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
void setList(java.lang.String path, java.util.List value)
List
property identified by the specified path, to the specified value.path
- the path to a valid object and property.value
- the new value for the property.set(String, Object)
,
setList(Property, List)
java.lang.Object get(int propertyIndex)
property list
of this object's type
.propertyIndex
- the index of the property.get(Property)
void set(int propertyIndex, java.lang.Object value)
property list
of this object's
type
, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(Property, Object)
boolean isSet(int propertyIndex)
property list
of this object's
type
, is considered to be set.propertyIndex
- the index of the property.isSet(Property)
void unset(int propertyIndex)
property list
of this object's type
.propertyIndex
- the index of the property.unset(Property)
boolean getBoolean(int propertyIndex)
boolean
property identified by the specified property index.propertyIndex
- the index of the property.boolean
value of the specified property.get(int)
byte getByte(int propertyIndex)
byte
property identified by the specified property index.propertyIndex
- the index of the property.byte
value of the specified property.get(int)
char getChar(int propertyIndex)
char
property identified by the specified property index.propertyIndex
- the index of the property.char
value of the specified property.get(int)
double getDouble(int propertyIndex)
double
property identified by the specified property index.propertyIndex
- the index of the property.double
value of the specified property.get(int)
float getFloat(int propertyIndex)
float
property identified by the specified property index.propertyIndex
- the index of the property.float
value of the specified property.get(int)
int getInt(int propertyIndex)
int
property identified by the specified property index.propertyIndex
- the index of the property.int
value of the specified property.get(int)
long getLong(int propertyIndex)
long
property identified by the specified property index.propertyIndex
- the index of the property.long
value of the specified property.get(int)
short getShort(int propertyIndex)
short
property identified by the specified property index.propertyIndex
- the index of the property.short
value of the specified property.get(int)
byte[] getBytes(int propertyIndex)
byte[]
property identified by the specified property index.propertyIndex
- the index of the property.byte[]
value of the specified property.get(int)
java.math.BigDecimal getBigDecimal(int propertyIndex)
BigDecimal
property identified by the specified property index.propertyIndex
- the index of the property.BigDecimal
value of the specified property.get(int)
java.math.BigInteger getBigInteger(int propertyIndex)
BigInteger
property identified by the specified property index.propertyIndex
- the index of the property.BigInteger
value of the specified property.get(int)
DataObject getDataObject(int propertyIndex)
DataObject
property identified by the specified property index.propertyIndex
- the index of the property.DataObject
value of the specified property.get(int)
java.util.Date getDate(int propertyIndex)
Date
property identified by the specified property index.propertyIndex
- the index of the property.Date
value of the specified property.get(int)
java.lang.String getString(int propertyIndex)
String
property identified by the specified property index.propertyIndex
- the index of the property.String
value of the specified property.get(int)
java.util.List getList(int propertyIndex)
List
property identified by the specified property index.propertyIndex
- the index of the property.List
value of the specified property.get(int)
Sequence getSequence(int propertyIndex)
propertyIndex
- the index of the property.Sequence
value of the specified property.Returns the value of a Sequence
property identified by the specified property index.
An implementation may throw an UnsupportedOperationException.
,
get(int)
void setBoolean(int propertyIndex, boolean value)
boolean
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setByte(int propertyIndex, byte value)
byte
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setChar(int propertyIndex, char value)
char
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setDouble(int propertyIndex, double value)
double
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setFloat(int propertyIndex, float value)
float
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setInt(int propertyIndex, int value)
int
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setLong(int propertyIndex, long value)
long
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setShort(int propertyIndex, short value)
short
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setBytes(int propertyIndex, byte[] value)
byte[]
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setBigDecimal(int propertyIndex, java.math.BigDecimal value)
BigDecimal
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setBigInteger(int propertyIndex, java.math.BigInteger value)
BigInteger
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setDataObject(int propertyIndex, DataObject value)
DataObject
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setDate(int propertyIndex, java.util.Date value)
Date
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setString(int propertyIndex, java.lang.String value)
String
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
void setList(int propertyIndex, java.util.List value)
List
property identified by the specified property index, to the specified value.propertyIndex
- the index of the property.value
- the new value for the property.set(int, Object)
,
setList(Property, List)
java.lang.Object get(Property property)
If the property is many-valued
,
the result will be a List
and each object in the List will be an instance of
the property's type
.
Otherwise the result will directly be an instance of the property's type.
property
- the property of the value to fetch.set(Property, Object)
,
unset(Property)
,
isSet(Property)
void set(Property property, java.lang.Object value)
If the property is many-valued
,
the new value must be a List
and each object in that list must be an instance of
the property's type
;
the existing contents are cleared and the contents of the new value are added.
Otherwise the new value directly must be an instance of the property's type
and it becomes the new value of the property of the object.
property
- the property of the value to set.value
- the new value for the property.unset(Property)
,
isSet(Property)
,
get(Property)
boolean isSet(Property property)
isSet() for many-valued Properties returns true if the List is not empty and false if the List is empty. For single-valued Properties it returns true if the Property has been set() and not unset(), and false otherwise. Any call to set() without a call to unset() will cause isSet() to return true, regardless of the value being set. For example, after calling set(property, property.getDefault()) on a previously unset property, isSet(property) will return true, even though the value of get(property) will be unchanged.
property
- the property in question.set(Property, Object)
,
unset(Property)
,
get(Property)
void unset(Property property)
If the property is many-valued
,
the value must be an List
and that list is cleared.
Otherwise,
the value of the property of the object
is set to the property's default value
.
The property will no longer be considered set
.
property
- the property in question.isSet(Property)
,
set(Property, Object)
,
get(Property)
boolean getBoolean(Property property)
boolean
property.property
- the property to get.boolean
value of the specified property.get(Property)
byte getByte(Property property)
byte
property.property
- the property to get.byte
value of the specified property.get(Property)
char getChar(Property property)
char
property.property
- the property to get.char
value of the specified property.get(Property)
double getDouble(Property property)
double
property.property
- the property to get.double
value of the specified property.get(Property)
float getFloat(Property property)
float
property.property
- the property to get.float
value of the specified property.get(Property)
int getInt(Property property)
int
property.property
- the property to get.int
value of the specified property.get(Property)
long getLong(Property property)
long
property.property
- the property to get.long
value of the specified property.get(Property)
short getShort(Property property)
short
property.property
- the property to get.short
value of the specified property.get(Property)
byte[] getBytes(Property property)
byte[]
property.property
- the property to get.byte[]
value of the specified property.get(Property)
java.math.BigDecimal getBigDecimal(Property property)
BigDecimal
property.property
- the property to get.BigDecimal
value of the specified property.get(Property)
java.math.BigInteger getBigInteger(Property property)
BigInteger
property.property
- the property to get.BigInteger
value of the specified property.get(Property)
DataObject getDataObject(Property property)
DataObject
property.property
- the property to get.DataObject
value of the specified property.get(Property)
java.util.Date getDate(Property property)
Date
property.property
- the property to get.Date
value of the specified property.get(Property)
java.lang.String getString(Property property)
String
property.property
- the property to get.String
value of the specified property.get(Property)
java.util.List getList(Property property)
List
property.
The List returned contains the current values.
Updates through the List interface operate on the current values of the DataObject.
Each access returns the same List object.property
- the property to get.List
value of the specified property.get(Property)
Sequence getSequence(Property property)
property
- the property to get.Sequence
value of the specified property.Returns the value of the specified Sequence
property.
An implementation may throw an UnsupportedOperationException.
,
get(Property)
void setBoolean(Property property, boolean value)
boolean
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setByte(Property property, byte value)
byte
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setChar(Property property, char value)
char
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setDouble(Property property, double value)
double
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setFloat(Property property, float value)
float
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setInt(Property property, int value)
int
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setLong(Property property, long value)
long
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setShort(Property property, short value)
short
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setBytes(Property property, byte[] value)
byte[]
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setBigDecimal(Property property, java.math.BigDecimal value)
BigDecimal
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setBigInteger(Property property, java.math.BigInteger value)
BigInteger
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setDataObject(Property property, DataObject value)
DataObject
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setDate(Property property, java.util.Date value)
Date
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setString(Property property, java.lang.String value)
String
property, to the specified value.property
- the property to set.value
- the new value for the property.set(Property, Object)
void setList(Property property, java.util.List value)
List
property, to the specified value.
The new value must be a List
and each object in that list must be an instance of
the property's type
;
the existing contents are cleared and the contents of the new value are added.
property
- the property to set.value
- the new value for the property.set(Property, Object)
DataObject createDataObject(java.lang.String propertyName)
data object
contained by this object using the specified property,
which must be a containment property
.
The type of the created object is the declared type
of the specified property.propertyName
- the name of the specified containment property.createDataObject(String, String, String)
DataObject createDataObject(int propertyIndex)
data object
contained by this object using the specified property,
which must be a containment property
.
The type of the created object is the declared type
of the specified property.propertyIndex
- the index of the specified containment property.createDataObject(int, String, String)
DataObject createDataObject(Property property)
data object
contained by this object using the specified property,
which must be a containment property
.
The type of the created object is the declared type
of the specified property.property
- the specified containment property.createDataObject(Property, Type)
DataObject createDataObject(java.lang.String propertyName, java.lang.String namespaceURI, java.lang.String typeName)
data object
contained by this object using the specified property,
which must be a containment property
.
The type of the created object is specified by the packageURI and typeName arguments.
The specified type must be a compatible target for the property identified by propertyName.propertyName
- the name of the specified containment property.namespaceURI
- the namespace URI of the package containing the type of object to be created.typeName
- the name of a type in the specified package.createDataObject(String)
,
TypeHelper.getType(java.lang.String, java.lang.String)
DataObject createDataObject(int propertyIndex, java.lang.String namespaceURI, java.lang.String typeName)
data object
contained by this object using the specified property,
which must be a containment property
.
The type of the created object is specified by the packageURI and typeName arguments.
The specified type must be a compatible target for the property identified by propertyIndex.propertyIndex
- the index of the specified containment property.namespaceURI
- the namespace URI of the package containing the type of object to be created.typeName
- the name of a type in the specified package.createDataObject(int)
,
TypeHelper.getType(java.lang.String, java.lang.String)
DataObject createDataObject(Property property, Type type)
data object
contained by this object using the specified property,
which must be of containment type
.
The type of the created object is specified by the type argument,
which must be a compatible target for the speicifed property.property
- a containment property of this object.type
- the type of object to be created.createDataObject(int)
void delete()
readOnly
Properties.
If this object is contained by a readOnly
containment property
, its non-readOnly
Properties will be unset but the object will not be removed from its container.
All DataObjects recursively contained by containment Properties
will also be deleted.DataObject getContainer()
data object
or null
if there is no container.null
.Property getContainmentProperty()
data object
containing this data object
or null
if there is no container.DataGraph getDataGraph()
data graph
for this object or null
if there isn't one.null
.Type getType()
The type defines the Properties available for reflective access.
Sequence getSequence()
Sequence
for this DataObject.
When getType().isSequencedType() == true,
the Sequence of a DataObject corresponds to the
XML elements representing the values of its Properties.
Updates through DataObject and the Lists or Sequences returned
from DataObject operate on the same data.
When getType().isSequencedType() == false, null is returned.Sequence
or null.java.util.List getInstanceProperties()
Property getInstanceProperty(java.lang.String propertyName)
propertyName
- the name of the PropertyProperty getProperty(java.lang.String propertyName)
getInstanceProperty(String)
in 2.1.0DataObject getRootObject()
data object
.ChangeSummary getChangeSummary()
void detach()