-A change summary is used to record changes to DataObjects,
- allowing applications to efficiently and incrementally update back-end storage when required.
-
getOldValue(DataObject dataObject,
- Property property)
-
-
- Returns a setting for the specified property
- representing the property value of the given dataObject
- at the point when logging began.
-
-
-
- java.util.List
-
getOldValues(DataObject dataObject)
-
-
- Returns a list of settings
- that represent the property values of the given dataObject
- at the point when logging began.
Returns a list consisting of all the data objects that have been changed while logging.
-
- The new and modified objects in the List are references to objects
- associated with this ChangeSummary.
- The deleted objects in the List are references to objects
- at the time that event logging was enabled;
-
Each changed object must have exactly one of the following methods return true:
- isCreated,
- isDeleted, or
- isModified.
-
Returns whether or not the specified data object was created while logging.
- Any object that was added to the scope
- but was not in the scope when logging began,
- will be considered created.
-
Returns whether or not the specified data object was deleted while logging.
- Any object that is not in scope but was in scope when logging began
- will be considered deleted.
-
Returns a list of settings
- that represent the property values of the given dataObject
- at the point when logging began.
-
In the case of a deleted object,
- the List will include settings for all the Properties.
-
An old value setting indicates the value at the
- point logging begins. A setting is only produced for
- modified objects if
- either the old value differs from the current value or
- if the isSet differs from the current value.
-
An implementation that requires logging may throw an UnsupportedOperationException.
- Turns change logging off. No operation occurs if logging is already off.
-
Returns whether or not the specified data object was updated while logging.
- An object that was contained in the scope when logging began
- and remains in the scope when logging ends will be considered potentially modified.
-
An object considered modified must have at least one old value setting.
-
Returns the ChangeSummary root DataObject - the object from which
- changes are tracked.
- When a DataGraph is used, this is the same as getDataGraph().getRootObject().
-
Returns the value of the sequence for the data object
- at the point when logging began.
-
-
-
Parameters:
dataObject - the object in question.
-
Returns:
the old containment property.
-
-
-
-
-
-undoChanges
-
-void undoChanges()
-
-
This method is intended for use by service implementations only.
- Undoes all changes in the log to restore the tree of
- DataObjects to its original state when logging began.
- isLogging() is unchanged. The log is cleared.
-
-A data graph is used to package a graph of data objects along with their
- metadata, that is, data describing the data.
- A data graph also contains a change summary
- which is used to record changes made to the objects in the graph.
-
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.
-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.
-
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.
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.
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.
-
-
-
-
-
-
-
-
-
-
-
-Method Detail
-
-
-
-
-get
-
-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.
-
Returns the value of the given property of this object.
-
- 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.
-
Sets the value of the given property of the object to the new 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.
-
- 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.
-
Returns the value of the specified 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.
-
Sets the value of the specified 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.
-
Returns a new 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.
-
-
-
-
-
-
Parameters:
propertyName - the name of the specified containment property.
-
Returns a new 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.
-
-
-
-
-
-
Parameters:
propertyIndex - the index of the specified containment property.
-
Returns a new 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.
-
Returns a new 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.
-
-
-
-
-
-
Parameters:
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.
-
Returns a new 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.
-
-
-
-
-
-
Parameters:
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.
-
Returns a new 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.
-
Remove this object from its container and then unset all its non-readOnly Properties.
- If this object is contained by a readOnlycontainment 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.
-
Returns the 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.
-
-
-
-
-
-
-
Returns:
the Sequence or null.
-
-
-
-
-
-getInstanceProperties
-
-java.util.List getInstanceProperties()
-
-
Returns a read-only List of the Properties currently used in this DataObject.
- This list will contain all of the Properties in getType().getProperties()
- and any Properties where isSet(property) is true.
- For example, Properties resulting from the use of
- open or mixed XML content are present if allowed by the Type.
- the List does not contain duplicates.
- The order of the Properties in the List begins with getType().getProperties()
- and the order of the remaining Properties is determined by the implementation.
- The same list will be returned unless the DataObject is updated so that
- the contents of the List change.
-
-
-
-
-
-
-
Returns:
the List of Properties currently used in this DataObject.
Returns the ChangeSummary with scope covering this dataObject, or null
- if there is no ChangeSummary.
-
-
-
-
-
-
-
Returns:
the ChangeSummary with scope covering this dataObject, or null.
-
-
-
-
-
-detach
-
-void detach()
-
-
Removes this DataObject from its container, if any.
- Same as
- getContainer().getList(getContainmentProperty()).remove(this) or
- getContainer().unset(getContainmentProperty())
- depending on getContainmentProperty().isMany() respectively.
-
Returns the default value this Property will have in a data object where the Property hasn't been set.
-
-
-
-
Returns:
the default value.
-
-
-
-
-
-isReadOnly
-
-boolean isReadOnly()
-
-
Returns true if values for this Property cannot be modified using the SDO APIs.
- When true, DataObject.set(Property property, Object value) throws an exception.
- Values may change due to other factors, such as services operating on DataObjects.
-
-
-
-
Returns:
true if values for this Property cannot be modified.
-A sequence is a heterogeneous list of properties and corresponding values.
- It represents an ordered arbitrary mixture of data values from more than one property of a data object.
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- void
-
add(int index,
- int propertyIndex,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property index and value
- at the specified entry index.
-
-
-
- boolean
-
add(int propertyIndex,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property index and value
- to the end of the entries.
-
-
-
- void
-
add(int index,
- Property property,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property and value
- at the specified entry index.
-
-
-
- void
-
add(int index,
- java.lang.String text)
-
-
- Adds a new entry with the SDO text Property
- at the given index.
-
-
-
- void
-
add(int index,
- java.lang.String propertyName,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property name and value
- at the specified entry index.
-
-
-
- boolean
-
add(Property property,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property and value
- to the end of the entries.
-
-
-
- void
-
add(java.lang.String text)
-
-
- Adds a new entry with the SDO text Property
- to the end of the Sequence.
-
-
-
- boolean
-
add(java.lang.String propertyName,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property name and value
- to the end of the entries.
Indicates if this Type specifies DataTypes (true) or DataObjects (false).
- When false, any object that is an instance of this type
- also implements the DataObject interface.
- True for simple types such as Strings and numbers.
- For any object:
-
true if Type specifies DataTypes, false for DataObjects.
-
-
-
-
-
-isOpen
-
-boolean isOpen()
-
-
Indicates if this Type allows any form of open content. If false,
- dataObject.getInstanceProperties() must be the same as
- dataObject.getType().getProperties() for any DataObject dataObject of this Type.
-
-
-
-
Returns:
true if this Type allows open content.
-
-
-
-
-
-isSequenced
-
-boolean isSequenced()
-
-
Indicates if this Type specifies Sequenced DataObjects.
- Sequenced DataObjects are used when the order of values
- between Properties must be preserved.
- When true, a DataObject will return a Sequence. For example,
-
true if this Type specifies Sequenced DataObjects.
-
-
-
-
-
-isAbstract
-
-boolean isAbstract()
-
-
Indicates if this Type is abstract. If true, this Type cannot be
- instantiated. Abstract types cannot be used in DataObject or
- DataFactory create methods.
-
-
-
-
Returns:
true if this Type is abstract.
-
-
-
-
-
-getBaseTypes
-
-java.util.List getBaseTypes()
-
-
Returns the List of base Types for this Type. The List is empty
- if there are no base Types. XSD , , and
- Java extends keyword are mapped to this list.
-
-
-
-
Returns:
the List of base Types for this Type.
-
-
-
-
-
-getDeclaredProperties
-
-java.util.List getDeclaredProperties()
-
-
Returns the Properties declared in this Type as opposed to
- those declared in base Types.
-
ChangeSummary.getOldValue(DataObject dataObject,
- Property property)
-
-
- Returns a setting for the specified property
- representing the property value of the given dataObject
- at the point when logging began.
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(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.
ChangeSummary.getOldValue(DataObject dataObject,
- Property property)
-
-
- Returns a setting for the specified property
- representing the property value of the given dataObject
- at the point when logging began.
-
-
-
- java.util.List
-
ChangeSummary.getOldValues(DataObject dataObject)
-
-
- Returns a list of settings
- that represent the property values of the given dataObject
- at the point when logging began.
-
-
-
- boolean
-
ChangeSummary.isCreated(DataObject dataObject)
-
-
- Returns whether or not the specified data object was created while logging.
-
-
-
- boolean
-
ChangeSummary.isDeleted(DataObject dataObject)
-
-
- Returns whether or not the specified data object was deleted while logging.
-
-
-
- boolean
-
ChangeSummary.isModified(DataObject dataObject)
-
-
- Returns whether or not the specified data object was updated while logging.
-
-
-
- void
-
DataObject.setDataObject(int propertyIndex,
- DataObject value)
-
-
- Sets the value of a DataObject property identified by the specified property index, to the specified value.
-
-
-
- void
-
DataObject.setDataObject(Property property,
- DataObject value)
-
-
- Sets the value of the specified DataObject property, to the specified value.
-
-
-
- void
-
DataObject.setDataObject(java.lang.String path,
- DataObject value)
-
-
- Sets the value of a DataObject property identified by the specified path, to the specified value.
CopyHelper.copy(DataObject dataObject)
-
-
- Create a deep copy of the DataObject tree:
- Copies the dataObject and all its contained
- DataObjects recursively.
CopyHelper.copyShallow(DataObject dataObject)
-
-
- Create a shallow copy of the DataObject dataObject:
- Creates a new DataObject copiedDataObject with the same values
- as the source dataObject for each property where
- property.getType().isDataType() is true.
DataFactory.create(java.lang.String uri,
- java.lang.String typeName)
-
-
- Create a DataObject of the Type specified by typeName with the given package uri.
CopyHelper.copy(DataObject dataObject)
-
-
- Create a deep copy of the DataObject tree:
- Copies the dataObject and all its contained
- DataObjects recursively.
CopyHelper.copyShallow(DataObject dataObject)
-
-
- Create a shallow copy of the DataObject dataObject:
- Creates a new DataObject copiedDataObject with the same values
- as the source dataObject for each property where
- property.getType().isDataType() is true.
XMLHelper.createDocument(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName)
-
-
- Creates an XMLDocument with the specified XML rootElement for the DataObject.
TypeHelper.define(DataObject type)
-
-
- Define the DataObject as a Type.
-
-
-
- boolean
-
EqualityHelper.equal(DataObject dataObject1,
- DataObject dataObject2)
-
-
- Two DataObjects are equal(Deep) if they are equalShallow,
- all their compared Properties are equal, and all reachable DataObjects in their
- graphs excluding containers are equal.
-
-
-
- boolean
-
EqualityHelper.equalShallow(DataObject dataObject1,
- DataObject dataObject2)
-
-
- Two DataObjects are equalShallow if
- they have the same Type
- and all their compared Properties are equal.
-
-
-
- java.lang.String
-
XMLHelper.save(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName)
-
-
- Returns the DataObject saved as an XML document with the specified root element.
-
-
-
- void
-
XMLHelper.save(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName,
- java.io.OutputStream outputStream)
-
-
- Saves the DataObject as an XML document with the specified root element.
Sequence.add(int index,
- Property property,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property and value
- at the specified entry index.
-
-
-
- boolean
-
Sequence.add(Property property,
- java.lang.Object value)
-
-
- Adds a new entry with the specified property and value
- to the end of the entries.
ChangeSummary.getOldValue(DataObject dataObject,
- Property property)
-
-
- Returns a setting for the specified property
- representing the property value of the given dataObject
- at the point when logging began.
DataObject.getSequence(Property property)
-
-
- Returns the value of the specified Sequence property.
-
-
-
- short
-
DataObject.getShort(Property property)
-
-
- Returns the value of the specified short property.
-
-
-
- java.lang.String
-
DataObject.getString(Property property)
-
-
- Returns the value of the specified String property.
-
-
-
- boolean
-
DataObject.isSet(Property property)
-
-
- Returns whether the property of the object is considered to be set.
-
-
-
- void
-
DataObject.set(Property property,
- java.lang.Object value)
-
-
- Sets the value of the given property of the object to the new value.
-
-
-
- void
-
DataObject.setBigDecimal(Property property,
- java.math.BigDecimal value)
-
-
- Sets the value of the specified BigDecimal property, to the specified value.
-
-
-
- void
-
DataObject.setBigInteger(Property property,
- java.math.BigInteger value)
-
-
- Sets the value of the specified BigInteger property, to the specified value.
-
-
-
- void
-
DataObject.setBoolean(Property property,
- boolean value)
-
-
- Sets the value of the specified boolean property, to the specified value.
-
-
-
- void
-
DataObject.setByte(Property property,
- byte value)
-
-
- Sets the value of the specified byte property, to the specified value.
-
-
-
- void
-
DataObject.setBytes(Property property,
- byte[] value)
-
-
- Sets the value of the specified byte[] property, to the specified value.
-
-
-
- void
-
DataObject.setChar(Property property,
- char value)
-
-
- Sets the value of the specified char property, to the specified value.
-
-
-
- void
-
DataObject.setDataObject(Property property,
- DataObject value)
-
-
- Sets the value of the specified DataObject property, to the specified value.
-
-
-
- void
-
DataObject.setDate(Property property,
- java.util.Date value)
-
-
- Sets the value of the specified Date property, to the specified value.
-
-
-
- void
-
DataObject.setDouble(Property property,
- double value)
-
-
- Sets the value of the specified double property, to the specified value.
-
-
-
- void
-
DataObject.setFloat(Property property,
- float value)
-
-
- Sets the value of the specified float property, to the specified value.
-
-
-
- void
-
DataObject.setInt(Property property,
- int value)
-
-
- Sets the value of the specified int property, to the specified value.
-
-
-
- void
-
DataObject.setList(Property property,
- java.util.List value)
-
-
- Sets the value of the specified List property, to the specified value.
-
-
-
- void
-
DataObject.setLong(Property property,
- long value)
-
-
- Sets the value of the specified long property, to the specified value.
-
-
-
- void
-
DataObject.setShort(Property property,
- short value)
-
-
- Sets the value of the specified short property, to the specified value.
-
-
-
- void
-
DataObject.setString(Property property,
- java.lang.String value)
-
-
- Sets the value of the specified String property, to the specified value.
-
-
-
- void
-
DataObject.unset(Property property)
-
-
- Unsets the property of the object.
XSDHelper.getGlobalProperty(java.lang.String uri,
- java.lang.String propertyName,
- boolean isElement)
-
-
- Returns the Property defined by the named global element or attribute
- in the targetNamespace uri, or null if not found.
DataGraph.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.
TypeHelper.getType(java.lang.String uri,
- java.lang.String typeName)
-
-
- Return the Type specified by typeName with the given uri,
- or null if not found.
copyShallow(DataObject dataObject)
-
-
- Create a shallow copy of the DataObject dataObject:
- Creates a new DataObject copiedDataObject with the same values
- as the source dataObject for each property where
- property.getType().isDataType() is true.
Create a shallow copy of the DataObject dataObject:
- Creates a new DataObject copiedDataObject with the same values
- as the source dataObject for each property where
- property.getType().isDataType() is true.
- The value of such a Property property in copiedDataObject is:
- dataObject.get(property) for single-valued Properties
- (copiedDataObject.get(property) equals() dataObject.get(property)), or
- a List where each member is equal to the member at the
- same index in dataObject for multi-valued Properties
- copiedDataObject.getList(property).get(i) equals() dataObject.getList(property).get(i)
- The copied Object is unset for each Property where
- property.getType().isDataType() is false
- since they are not copied.
- Read-only properties are copied.
- A copied object shares metadata with the source object
- sourceDO.getType() == copiedDO.getType()
- If a ChangeSummary is part of the source DataObject
- the copy has a new, empty ChangeSummary.
- Logging state is the same as the source ChangeSummary.
-
Create a deep copy of the DataObject tree:
- Copies the dataObject and all its contained
- DataObjects recursively.
- Values of Properties are copied as in shallow copy,
- and values of Properties where
- property.getType().isDataType() is false
- are copied where each value copied must be a
- DataObject contained by the source dataObject.
- If a DataObject is outside the DataObject tree and the
- property is bidirectional, then the DataObject is skipped.
- If a DataObject is outside the DataObject tree and the
- property is unidirectional, then the same DataObject is referenced.
- Read-only properties are copied.
- If any DataObject referenced is not in the containment
- tree an IllegalArgumentException is thrown.
- If a ChangeSummary is part of the copy tree the new
- ChangeSummary refers to objects in the new DataObject tree.
- Logging state is the same as the source ChangeSummary.
-
-
-
Parameters:
dataObject - to be copied.
-
Returns:
copy of dataObject
-
Throws:
-
java.lang.IllegalArgumentException - if any referenced DataObject
- is not part of the containment tree.
Create a DataObject supporting the given interface.
- InterfaceClass is the interface for the DataObject's Type.
- The DataObject created is an instance of the interfaceClass.
-
-
-
Parameters:
interfaceClass - is the interface for the DataObject's Type.
-
Returns:
the created DataObject.
-
Throws:
-
java.lang.IllegalArgumentException - if the instanceClass does
- not correspond to a Type this factory can instantiate.
toCalendar(java.lang.String dateString)
-
-
- Convert from a String representation of an SDO date type to a Calendar using the
- default locale.
-
-
-
- java.util.Calendar
-
toCalendar(java.lang.String dateString,
- java.util.Locale locale)
-
-
- Convert from a String representation of an SDO date type to a Calendar using the
- specified locale, or the default locale if the locale is null.
-
-
-
- java.util.Date
-
toDate(java.lang.String dateString)
-
-
- Convert from a String representation of an SDO date type to a Date.
-
-
-
- java.lang.String
-
toDateTime(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the DateTime type.
-
-
-
- java.lang.String
-
toDateTime(java.util.Date date)
-
-
- Convert from a Date to a String representation of the DateTime type.
-
-
-
- java.lang.String
-
toDay(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the Day type.
-
-
-
- java.lang.String
-
toDay(java.util.Date date)
-
-
- Convert from a Date to a String representation of the Day type.
-
-
-
- java.lang.String
-
toDuration(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the Duration type.
-
-
-
- java.lang.String
-
toDuration(java.util.Date date)
-
-
- Convert from a Date to a String representation of the Duration type.
-
-
-
- java.lang.String
-
toMonth(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the Month type.
-
-
-
- java.lang.String
-
toMonth(java.util.Date date)
-
-
- Convert from a Date to a String representation of the Month type.
-
-
-
- java.lang.String
-
toMonthDay(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the MonthDay type.
-
-
-
- java.lang.String
-
toMonthDay(java.util.Date date)
-
-
- Convert from a Date to a String representation of the MonthDay type.
-
-
-
- java.lang.String
-
toTime(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the Time type.
-
-
-
- java.lang.String
-
toTime(java.util.Date date)
-
-
- Convert from a Date to a String representation of the Time type.
-
-
-
- java.lang.String
-
toYear(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the Year type.
-
-
-
- java.lang.String
-
toYear(java.util.Date date)
-
-
- Convert from a Date to a String representation of the Year type.
-
-
-
- java.lang.String
-
toYearMonth(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the YearMonth type.
-
-
-
- java.lang.String
-
toYearMonth(java.util.Date date)
-
-
- Convert from a Date to a String representation of the YearMonth type.
-
-
-
- java.lang.String
-
toYearMonthDay(java.util.Calendar calendar)
-
-
- Convert from a Calendar to a String representation of the YearMonthDay type.
-
-
-
- java.lang.String
-
toYearMonthDay(java.util.Date date)
-
-
- Convert from a Date to a String representation of the YearMonthDay type.
equal(DataObject dataObject1,
- DataObject dataObject2)
-
-
- Two DataObjects are equal(Deep) if they are equalShallow,
- all their compared Properties are equal, and all reachable DataObjects in their
- graphs excluding containers are equal.
-
-
-
- boolean
-
equalShallow(DataObject dataObject1,
- DataObject dataObject2)
-
-
- Two DataObjects are equalShallow if
- they have the same Type
- and all their compared Properties are equal.
Two DataObjects are equalShallow if
- they have the same Type
- and all their compared Properties are equal.
- The set of Properties compared are the
- instance properties
- where property.getType().isDataType() is true
- and property.getType() is not ChangeSummaryType.
- Two of these Property values are equal if they are both not
- set, or set to an equal value
- dataObject1.get(property).equals(dataObject2.get(property))
- If the type is a sequenced type, the sequence entries must be the same.
- For each entry x in the sequence where the property is used in the comparison,
- dataObject1.getSequence().getValue(x).equals(
- dataObject2.getSequence().getValue(x)) and
- dataObject1.getSequence().getProperty(x) ==
- dataObject2.getSequence().getProperty(x)
- must be true.
-
- Returns true the objects have the same Type and all values of all compared Properties are equal.
-
-
-
Parameters:
dataObject1 - DataObject to be compared
dataObject2 - DataObject to be compared
-
Returns:
true the objects have the same Type and all values of all compared Properties are equal.
Two DataObjects are equal(Deep) if they are equalShallow,
- all their compared Properties are equal, and all reachable DataObjects in their
- graphs excluding containers are equal.
- The set of Properties compared are the
- instance properties
- where property.getType().isDataType() is false,
- and is not a container property, ie !property.getOpposite().isContainment()
- Two of these Property values are equal if they are both not
- set, or all the DataObjects
- they refer to are equal in the
- context of dataObject1 and dataObject2.
- Note that properties to a containing DataObject are not compared
- which means two DataObject trees can be equal even if their containers are not equal.
- If the type is a sequenced type, the sequence entries must be the same.
- For each entry x in the sequence where the property is used in the comparison,
- equal(dataObject1.getSequence().getValue(x),
- dataObject2.getSequence().getValue(x)) and
- dataObject1.getSequence().getProperty(x) ==
- dataObject2.getSequence().getProperty(x)
- must be true.
-
- A DataObject directly or indirectly referenced by dataObject1 or dataObject2
- can only be equal to exactly one DataObject directly or indirectly referenced
- by dataObject1 or dataObject2, respectively.
- This ensures that dataObject1 and dataObject2 are equal if the graph formed by
- all their referenced DataObjects have the same shape.
-
- Returns true if the trees of DataObjects are equal(Deep).
-
-Look up a Type given the uri and typeName or interfaceClass.
- SDO Types are available through the
- getType("commonj.sdo", typeName) method.
- Defines Types from DataObjects.
-
-Represents an XML Document containing a tree of DataObjects.
-
- An example XMLDocument fragment is:
-
-
-
- created from this XML Schema fragment:
-
-
-
-
- Upon loading this XMLDocument:
- DataObject is an instance of Type PurchaseOrderType.
- RootElementURI is null because the XSD has no targetNamespace URI.
- RootElementName is purchaseOrder.
- Encoding is null because the document did not specify an encoding.
- XMLDeclaration is true because the document contained an XML declaration.
- XMLVersion is 1.0
- SchemaLocation and noNamespaceSchemaLocation are null because they are
- not specified in the document.
-
- When saving the root element, if the type of the root dataObject is not the
- type of global element specified by rootElementURI and rootElementName,
- or if a global element does not exist for rootElementURI and rootElementName,
- then an xsi:type declaration is written to record the root DataObject's Type.
-
- When loading the root element and an xsi:type declaration is found
- it is used as the type of the root DataObject. In this case,
- if validation is not being performed, it is not an error if the
- rootElementName is not a global element.
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- java.lang.String
-
getEncoding()
-
-
- Return the XML encoding of the document, or null if not specified.
-
-
-
- java.lang.String
-
getNoNamespaceSchemaLocation()
-
-
- Return the value of the noNamespaceSchemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if not present.
getRootObject()
-
-
- Return the root DataObject for the XMLDocument.
-
-
-
- java.lang.String
-
getSchemaLocation()
-
-
- Return the value of the schemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if not present.
-
-
-
- java.lang.String
-
getXMLVersion()
-
-
- Return the XML version of the document, or null if not specified.
-
-
-
- boolean
-
isXMLDeclaration()
-
-
- Return the XML declaration of the document.
-
-
-
- void
-
setEncoding(java.lang.String encoding)
-
-
- Set the XML encoding of the document, or null if not specified.
-
-
-
- void
-
setNoNamespaceSchemaLocation(java.lang.String schemaLocation)
-
-
- Sets the value of the noNamespaceSchemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if it should not be present.
-
-
-
- void
-
setSchemaLocation(java.lang.String schemaLocation)
-
-
- Sets the value of the schemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if it should not be present.
-
-
-
- void
-
setXMLDeclaration(boolean xmlDeclaration)
-
-
- Set the XML declaration version of the document.
-
-
-
- void
-
setXMLVersion(java.lang.String xmlVersion)
-
-
- Set the XML version of the document, or null if not specified.
Return the targetNamespace URI for the root element.
- If there is no targetNamespace URI, the value is null.
- The root element is a global element of the XML Schema
- with a type compatible to the DataObject.
-
-
-
-
Returns:
the targetNamespace URI for the root element.
-
-
-
-
-
-getRootElementName
-
-java.lang.String getRootElementName()
-
-
Return the name of the root element.
- The root element is a global element of the XML Schema
- with a type compatible to the DataObject.
-
-
-
-
Returns:
the name of the root element.
-
-
-
-
-
-getEncoding
-
-java.lang.String getEncoding()
-
-
Return the XML encoding of the document, or null if not specified.
- The default value is "UTF-8".
- Specification of other values is implementation-dependent.
-
-
-
-
Returns:
the XML encoding of the document, or null if not specified.
-
-
-
-
-
-setEncoding
-
-void setEncoding(java.lang.String encoding)
-
-
Set the XML encoding of the document, or null if not specified.
-
-
-
Parameters:
encoding -
-
-
-
-
-
-isXMLDeclaration
-
-boolean isXMLDeclaration()
-
-
Return the XML declaration of the document. If true,
- XMLHelper save() will produce a declaration of the form:
-
- Encoding will be suppressed if getEncoding() is null.
- The default value is true.
-
-
-
-
Returns:
the XML declaration of the document.
-
-
-
-
-
-setXMLDeclaration
-
-void setXMLDeclaration(boolean xmlDeclaration)
-
-
Set the XML declaration version of the document.
-
-
-
Parameters:
xmlDeclaration - the XML declaration version of the document.
-
-
-
-
-
-getXMLVersion
-
-java.lang.String getXMLVersion()
-
-
Return the XML version of the document, or null if not specified.
- The default value is "1.0".
- Specification of other values is implementation-dependent.
-
-
-
-
Returns:
the XML version of the document, or null if not specified.
-
-
-
-
-
-setXMLVersion
-
-void setXMLVersion(java.lang.String xmlVersion)
-
-
Set the XML version of the document, or null if not specified.
-
-
-
Parameters:
xmlVersion - the XML version of the document, or null if not specified.
-
-
-
-
-
-getSchemaLocation
-
-java.lang.String getSchemaLocation()
-
-
Return the value of the schemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if not present.
-
-
-
-
Returns:
the value of the schemaLocation declaration,
- or null if not present.
Sets the value of the schemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if it should not be present.
-
-
-
Parameters:
schemaLocation - the value of the schemaLocation declaration, or null.
-
-
-
-
-
-getNoNamespaceSchemaLocation
-
-java.lang.String getNoNamespaceSchemaLocation()
-
-
Return the value of the noNamespaceSchemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if not present.
-
-
-
-
Returns:
the value of the noNamespaceSchemaLocation declaration,
- or null if not present.
Sets the value of the noNamespaceSchemaLocation declaration
- for the http://www.w3.org/2001/XMLSchema-instance namespace in the
- root element, or null if it should not be present.
-
-
-
Parameters:
schemaLocation - the value of the noNamespaceSchemaLocation declaration, or null.
createDocument(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName)
-
-
- Creates an XMLDocument with the specified XML rootElement for the DataObject.
load(java.io.InputStream inputStream,
- java.lang.String locationURI,
- java.lang.Object options)
-
-
- Creates and returns an XMLDocument from the inputStream.
load(java.io.Reader inputReader,
- java.lang.String locationURI,
- java.lang.Object options)
-
-
- Creates and returns an XMLDocument from the inputReader.
load(java.lang.String inputString)
-
-
- Creates and returns an XMLDocument from the input String.
-
-
-
- java.lang.String
-
save(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName)
-
-
- Returns the DataObject saved as an XML document with the specified root element.
-
-
-
- void
-
save(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName,
- java.io.OutputStream outputStream)
-
-
- Saves the DataObject as an XML document with the specified root element.
-
-
-
- void
-
save(XMLDocument xmlDocument,
- java.io.OutputStream outputStream,
- java.lang.Object options)
-
-
- Serializes an XMLDocument as an XML document into the outputStream.
-
-
-
- void
-
save(XMLDocument xmlDocument,
- java.io.Writer outputWriter,
- java.lang.Object options)
-
-
- Serializes an XMLDocument as an XML document into the outputWriter.
Creates and returns an XMLDocument from the input String.
- By default does not perform XSD validation.
- Same as
- load(new StringReader(inputString), null, null);
-
-
-
Parameters:
inputString - specifies the String to read from
-
Returns:
the new XMLDocument loaded
-
Throws:
-
java.lang.RuntimeException - for errors in XML parsing or
- implementation-specific validation.
Creates and returns an XMLDocument from the inputStream.
- The InputStream will be closed after reading.
- By default does not perform XSD validation.
- Same as
- load(inputStream, null, null);
-
-
-
Parameters:
inputStream - specifies the InputStream to read from
-
Returns:
the new XMLDocument loaded
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.RuntimeException - for errors in XML parsing or
- implementation-specific validation.
Creates and returns an XMLDocument from the inputStream.
- The InputStream will be closed after reading.
- By default does not perform XSD validation.
-
-
-
Parameters:
inputStream - specifies the InputStream to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
-
Returns:
the new XMLDocument loaded
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.RuntimeException - for errors in XML parsing or
- implementation-specific validation.
Creates and returns an XMLDocument from the inputReader.
- The InputStream will be closed after reading.
- By default does not perform XSD validation.
-
-
-
Parameters:
inputReader - specifies the Reader to read from
locationURI - specifies the URI of the document for relative schema locations
options - implementation-specific options.
-
Returns:
the new XMLDocument loaded
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.RuntimeException - for errors in XML parsing or
- implementation-specific validation.
Returns the DataObject saved as an XML document with the specified root element.
- Same as
- StringWriter stringWriter = new StringWriter();
- save(createDocument(dataObject, rootElementURI, rootElementName),
- stringWriter, null);
- stringWriter.toString();
-
-
-
Parameters:
dataObject - specifies DataObject to be saved
rootElementURI - the Target Namespace URI of the root XML element
rootElementName - the Name of the root XML element
-
Returns:
the saved XML document as a string
-
Throws:
-
java.lang.IllegalArgumentException - if the dataObject tree
- is not closed or has no container.
Saves the DataObject as an XML document with the specified root element.
- Same as
- save(createDocument(dataObject, rootElementURI, rootElementName),
- outputStream, null);
-
-
-
Parameters:
dataObject - specifies DataObject to be saved
rootElementURI - the Target Namespace URI of the root XML element
rootElementName - the Name of the root XML element
outputStream - specifies the OutputStream to write to.
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.IllegalArgumentException - if the dataObject tree
- is not closed or has no container.
Serializes an XMLDocument as an XML document into the outputStream.
- If the DataObject's Type was defined by an XSD, the serialization
- will follow the XSD.
- Otherwise the serialization will follow the format as if an XSD
- were generated as defined by the SDO specification.
- The OutputStream will be flushed after writing.
- Does not perform validation to ensure compliance with an XSD.
-
-
-
Parameters:
xmlDocument - specifies XMLDocument to be saved
outputStream - specifies the OutputStream to write to.
options - implementation-specific options.
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.IllegalArgumentException - if the dataObject tree
- is not closed or has no container.
Serializes an XMLDocument as an XML document into the outputWriter.
- If the DataObject's Type was defined by an XSD, the serialization
- will follow the XSD.
- Otherwise the serialization will follow the format as if an XSD
- were generated as defined by the SDO specification.
- The OutputStream will be flushed after writing.
- Does not perform validation to ensure compliance with an XSD.
-
-
-
Parameters:
xmlDocument - specifies XMLDocument to be saved
outputWriter - specifies the Writer to write to.
options - implementation-specific options.
-
Throws:
-
java.io.IOException - for stream exceptions.
-
java.lang.IllegalArgumentException - if the dataObject tree
- is not closed or has no container.
-Provides access to additional information when the
- Type or Property is defined by an XML Schema (XSD).
- Methods return null/false otherwise or if the information is unavailable.
- Defines Types from an XSD.
-
getGlobalProperty(java.lang.String uri,
- java.lang.String propertyName,
- boolean isElement)
-
-
- Returns the Property defined by the named global element or attribute
- in the targetNamespace uri, or null if not found.
-
-
-
- java.lang.String
-
getLocalName(Property property)
-
-
- Returns the local name as declared in the XSD.
-
-
-
- java.lang.String
-
getLocalName(Type type)
-
-
- Returns the local name as declared in the XSD.
Returns true if the property is declared as an attribute in the XSD.
- Returns false if not known or for advanced cases.
- It is possible for both isAttribute and isElement to return false
- but they will not both return true.
-
-
-
Parameters:
property - to identify if an attribute.
-
Returns:
true if the property is declared as an attribute in the XSD.
Returns true if the property is declared as an element in the XSD.
- Returns false if not known or for advanced cases.
- It is possible for both isAttribute and isElement to return false
- but they will not both return true.
-
-
-
Parameters:
property - to identify if an element.
-
Returns:
true if the property is declared as an element in the XSD.
Return the appinfo declared for this Type and source.
- The appinfo start and end tags and content are returned.
- The xml namespace context is preserved in the appinfo element.
- If more than one appinfo with the same source is declared on the same
- Type their contents are concatenated.
-
Return the content of the appinfo declared for this Property and source.
- If the property is defined by ref= the appinfo of the referenced
- element or attribute is included.
- The appinfo start and end tags and content are returned.
- The xml namespace context is preserved in the appinfo element.
- If more than one appinfo with the same source is declared on the same
- Type their contents are concatenated.
-
-
-
Parameters:
property - the Property with the appinfo declaration
source - the source of the appinfo declaration.
-
Returns:
the appinfo declared for this Property and source.
-
-
-
-
-
-define
-
-java.util.List define(java.lang.String xsd)
-
-
Define the XML Schema as Types.
- The Types are available through TypeHelper and DataGraph getType() methods.
- Same as define(new StringReader(xsd), null)
-
-
-
Parameters:
xsd - the XML Schema.
-
Returns:
the defined Types.
-
Throws:
-
java.lang.IllegalArgumentException - if the Types could not be defined.
Generate an XML Schema Declaration (XSD) from Types.
- Round trip from SDO to XSD to SDO is supported.
- Round trip from XSD to SDO to XSD is not supported.
- Use the original schema if one exists instead of generating a new one, as
- the generated XSD validates a different set of documents than the original XSD.
- Generating an XSD does not affect the XSDHelper or the Types.
- The Types must all have the same URI.
- The result is a String containing the generated XSD.
- All Types referenced with the same URI will be generated in the XSD
- and the list will be expanded to include all types generated.
- Any Types referenced with other URIs will cause
- imports to be produced as appropriate.
- Imports will include a schemaLocation if a Map is provided with an entry
- of the form key=import target namespace, value=schemaLocation
-
-
-
Parameters:
types - a List containing the Types
namespaceToSchemaLocation - map of target namespace to schema locations or null
-
Returns:
a String containing the generated XSD.
-
Throws:
-
java.lang.IllegalArgumentException - if the XSD could not be generated.
XMLHelper.createDocument(DataObject dataObject,
- java.lang.String rootElementURI,
- java.lang.String rootElementName)
-
-
- Creates an XMLDocument with the specified XML rootElement for the DataObject.
XMLHelper.load(java.io.InputStream inputStream,
- java.lang.String locationURI,
- java.lang.Object options)
-
-
- Creates and returns an XMLDocument from the inputStream.
XMLHelper.load(java.io.Reader inputReader,
- java.lang.String locationURI,
- java.lang.Object options)
-
-
- Creates and returns an XMLDocument from the inputReader.
XMLHelper.save(XMLDocument xmlDocument,
- java.io.OutputStream outputStream,
- java.lang.Object options)
-
-
- Serializes an XMLDocument as an XML document into the outputStream.
-
-
-
- void
-
XMLHelper.save(XMLDocument xmlDocument,
- java.io.Writer outputWriter,
- java.lang.Object options)
-
-
- Serializes an XMLDocument as an XML document into the outputWriter.
-Delegates DataObject serialization while ensuring implementation independent
- java.io.Serialization. An implementation of DataObject
- returns an ExternalizableDelegator from its writeReplace() method.
-
- The root DataObject is the object returned from do.getRootObject() where
- do is the DataObject being serialized in a java.io.ObjectOutputStream.
- When do.getContainer() == null then do is a root object.
-
- The byte format for each DataObject in the stream is:
- [0] [path] [root] // when do is not a root object
- [1] [rootXML] // when do is a root object
-
- where:
- [0] is the byte 0, serialized using writeByte(0).
- [1] is the byte 1, serialized using writeByte(1).
-
- [path] is an SDO path expression from the root DataObject to the serialized
- DataObject such that root.getDataObject(path) == do.
- Serialized using writeUTF(path).
-
- [root] is the root object serialized using writeObject(root).
-
- [rootXML] is the GZip of the XML serialization of the root DataObject.
- The XML serialization is the same as
- XMLHelper.INSTANCE.save(root, "commonj.sdo", "dataObject", stream);
- where stream is a GZIPOutputStream, length is the number of bytes
- in the stream, and bytes are the contents of the stream.
- Serialized using writeInt(length), write(bytes).
-
The default HelperProvider INSTANCE. This is located using the ClassLoader used
- to load the HelperProvider class itself and if no default implementation is available
- this field will be set to null.
-
-
-
-
-
-
-
-SERVICE_RESOURCE_NAME
-
-public static final java.lang.String SERVICE_RESOURCE_NAME
-
-
The name of the resource that is used for service location.
-
Locate and instantiate a HelperProvider.
-
- Attempt to locate a HelperProvider using first the Thread's current context classloader and then,
- if that is not set, not readable, or does not provide an implementation, using the classloader
- used to load the HelperProvider class itself.
-
- A new instance is returned for each sucessful invocation.
-
-
-
-
Returns:
an implementation of HelperProvider
-
Throws:
-
NoHelperProviderException - if no provider implementation was defined or it could not be instantiated
Locate and instantiate a HelperProvider using the supplied ClassLoader.
-
- The name of the implementation to use is determined by the value of the "commonj.sdo.impl.HelperProvider"
- system property. If this is not set or this code does not have permission to read it then the name
- will be retrieved from the META-INF/services/commonj.sdo.impl.HelperProvider resource as returned
- by the supplied classloader as described in the
- JAR file specification.
-
- A new instance is returned for each sucessful invocation.
-
-
-
Parameters:
cl - the classloader to use to locate and instantiate the implementation
-
Returns:
the specified implementation of HelperProvider
-
Throws:
-
NoHelperProviderException - if no provider implementation was defined or it could not be instantiated
-Exception indicating that a HelperProvider could not be located or instantiated.
- The message will be set to the name of the implementation class; a null value
- indicates that the name of the implementation could not be determined.
- The cause will be set to the Throwable that prevented the provider from being
- located or created.
-
HelperProvider
-
-
- A HelperProvider obtains specific default helpers and other
- implementation-specific objects used by a Java implementation of SDO.
-
-
-
NoHelperProviderException
-
-
- Exception indicating that a HelperProvider could not be located or instantiated.
A change summary is used to record changes to DataObjects,
- allowing applications to efficiently and incrementally update back-end storage when required.
ChangeSummary
-
-
- A change summary is used to record changes to DataObjects,
- allowing applications to efficiently and incrementally update back-end storage when required.