|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SDOHelper
This interface provides helper functions which are not included in the SDO specification itself. Use of the functions in this interface is recommended, instead of resorting to low-level implementation-specific APIs.
Nested Class Summary | |
---|---|
static interface |
SDOHelper.MetaDataBuilder
This interface provides methods which can be used to programatically create SDO Types and Properties. |
static interface |
SDOHelper.XMLOptions
This interface contains options that can be passed to the XMLHelper load() and save() methods. |
Field Summary | |
---|---|
static int |
UNBOUNDED
|
static int |
UNSPECIFIED
|
Method Summary | |
---|---|
void |
addChangeListener(DataObject dob,
EventListener listener)
An experimental interface, subject to possible change that permits registration of an event listener with a DataObject instance |
String |
convertToString(Type dataType,
Object value)
Converts an instance of a data type to a string literal representation. |
CopyHelper |
createCrossScopeCopyHelper(HelperContext targetScope)
Create a new cross scope CopyHelper. |
DataGraph |
createDataGraph()
Create an empty data graph. |
DataObject |
createDataTypeWrapper(Type dataType,
Object value)
Create a DataObject wrapper for an instance of the specified dataType. |
Object |
createFromString(Type dataType,
String literal)
Creates an instance of a data type from the specified string. |
HelperContext |
createHelperContext()
Create a non-extensible HelperContext to provide access to a consistent set of Helpers which make use of a new TypeHelper instance to provide scope for type definitions. |
HelperContext |
createHelperContext(boolean extensibleNamespaces)
Create a HelperContext to provide access to a consistent set of Helpers which make use of a new TypeHelper instance to provide scope for type definitions. |
HelperContext |
createHelperContext(boolean extensibleNamespaces,
Map options)
Create a non-extensible HelperContext to provide access to a consistent set of Helpers which make use of a new TypeHelper instance to provide scope for type definitions. |
HelperContext |
createHelperContext(Map options)
create a non-extensible HelperContext with default load/save options |
ObjectInputStream |
createObjectInputStream(InputStream inputStream,
HelperContext helperContext)
Create a new ObjectInputStream in the specifice HelperContext scope. |
ObjectOutputStream |
createObjectOutputStream(OutputStream outputStream,
HelperContext helperContext)
Create a new ObjectOutputStream in the specifice HelperContext scope. |
XMLStreamHelper |
createXMLStreamHelper(HelperContext hc)
Create a new XMLStreamHelper, with visibility to types in the specified HelperContext scope. |
List |
getEnumerationFacet(Type type)
Return Enumeration facet |
Type |
getJavaSDOType(Class javaClass)
Get the SDO built-in type corresponding to the specified Java instanceClass. |
int |
getLowerBound(Property property)
Return the lower bound of the specified property or 1 by default |
SDOHelper.MetaDataBuilder |
getMetaDataBuilder()
Gets a MetaDataBuilder which can be used to programatically create SDO Types and Properties. |
List |
getOpenContentProperties(DataObject dataObject)
Gets the open content subset of the specified DataObject's instance properties. |
List |
getPatternFacet(Type type)
Return Pattern facet |
Sequence |
getSubstitutionValues(DataObject dataObject,
Property head)
Gets the Sequence corresponding to the specified substitutable Property of the specified DataObject. |
List |
getTypes(HelperContext hc,
String uri)
Gets all of the types associated with a uri. |
int |
getUpperBound(Property property)
Return the upper bound of the specified property or -1 if unbounded. |
String |
getXPath(DataObject dataObject)
Return an XPath from the containment root to the specified DataObject. |
Type |
getXSDSDOType(String xsdType)
Get the SDO built-in type corresponding to the specified XSD type in the XML Schema namespace ("http://www.w3.org/2001/XMLSchema"). |
boolean |
isDocumentRoot(Type type)
Return true if the specified type is a special DocumentRoot Type. |
boolean |
isMany(Property property,
DataObject context)
Returns whether the Property is many-valued given the specified context. |
boolean |
isRequired(Property property)
Return whether at least one value is required for a valid instance of the specified property. |
DataGraph |
loadDataGraph(InputStream inputStream,
Map options,
HelperContext hc)
Load a serialized data graph from the specified insputStream. |
void |
registerDataGraphTypes(DataGraph dataGraph,
List types)
Registers the specified type (s) to be serialized along with
the data object (s) in the graph. |
void |
removeChangeListener(DataObject dob,
EventListener listener)
An experimental interface, subject to possible change that permits deregistration of an event listener with a DataObject instance |
void |
saveDataGraph(DataGraph dataGraph,
OutputStream outputStream,
Map options)
Serialize the specified data graph to the specified outputStream. |
void |
setRootObject(DataGraph dataGraph,
DataObject rootObject)
Set the root object of a data graph. |
Field Detail |
---|
static final int UNBOUNDED
static final int UNSPECIFIED
Method Detail |
---|
HelperContext createHelperContext()
createHelperContext(boolean)
HelperContext createHelperContext(boolean extensibleNamespaces, Map options)
options
- Map of default XMLOptions
createHelperContext(boolean)
HelperContext createHelperContext(boolean extensibleNamespaces)
extensibleNamespaces
- true if the contents of a namespaces should be incrementally modifiable over time
HelperContext createHelperContext(Map options)
options
- default load/save options from XMLOptions
Object createFromString(Type dataType, String literal)
dataType
- a Type, for which isDataType() returns true, to instantiate.literal
- the string value of the dataType.
convertToString(Type, Object)
String convertToString(Type dataType, Object value)
dataType
- the Type, for which isDataType() returns true, of the value to convert.value
- a value of the dataType.
createFromString(Type, String)
DataObject createDataTypeWrapper(Type dataType, Object value)
dataType
- a Type for which isDataType() returns true.value
- the instance value.
Type getXSDSDOType(String xsdType)
xsdType
- a type name in the XML Schema namespace.
Sequence getSubstitutionValues(DataObject dataObject, Property head)
dataObject
- the data object.head
- a substitution group head property.
Type getJavaSDOType(Class javaClass)
javaClass
- the Java instanceClass of the type.
boolean isRequired(Property property)
the
- property in question.
int getUpperBound(Property property)
the
- property in question.
int getLowerBound(Property property)
the
- property in question.
List getEnumerationFacet(Type type)
type
-
List getPatternFacet(Type type)
type
-
boolean isMany(Property property, DataObject context)
property
- The Property in questioncontext
- The context to check whether the specified Property is many-valued
DataGraph createDataGraph()
void setRootObject(DataGraph dataGraph, DataObject rootObject)
dataGraph
- the data graph in which to set the root object.rootObject
- the root object.DataGraph loadDataGraph(InputStream inputStream, Map options, HelperContext hc) throws IOException
inputStream
- the inputStream of the data graph.options
- loader control options, or null.hc
- the HelperContext in which to register deserialized Types and to find Types when
creating DataObject instances, or null for default HelperContext.
IOException
void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, Map options) throws IOException
dataGraph
- the data graph to save.outputStream
- the outputStream for the data graph.options
- serializer control options, or null.
IOException
void registerDataGraphTypes(DataGraph dataGraph, List types)
type
(s) to be serialized along with
the data object
(s) in the graph. For example, the list of types returned from
TypeHelper.define(commonj.sdo.DataObject)
can be registered with this method, allowing deserialization of
instances of a dynamically defined model.
dataGraph
- the DataGraph in which to register the specified type(s).types
- a list containing the type(s) to be registered (TBD or null to automatically register all
types used by the objects in the DataGraph).CopyHelper createCrossScopeCopyHelper(HelperContext targetScope)
hc
- the HelperContext containing the Types to use to create the copy objects.
XMLStreamHelper createXMLStreamHelper(HelperContext hc)
hc
- the HelperContext to use for locating types.
ObjectInputStream createObjectInputStream(InputStream inputStream, HelperContext helperContext) throws IOException
inputStream
- the inputStream with which to create the ObjectInputStream.helperContext
- the HelperContext scope.
IOException
ObjectOutputStream createObjectOutputStream(OutputStream outputStream, HelperContext helperContext) throws IOException
outputStream
- the outputStream with which to create the ObjectOutputStream.helperContext
- the HelperContext scope.
IOException
List getTypes(HelperContext hc, String uri)
hc
- the HelperContext to use for locating types.uri
- the URI of the Types
List getOpenContentProperties(DataObject dataObject)
dataObject
- the DataObject instance
boolean isDocumentRoot(Type type)
type
- the Type in question
String getXPath(DataObject dataObject)
dataObject
- a DataObject
SDOHelper.MetaDataBuilder getMetaDataBuilder()
void addChangeListener(DataObject dob, EventListener listener)
dob
- DataObjectlistener
- EventListenervoid removeChangeListener(DataObject dob, EventListener listener)
dob
- DataObjectlistener
- EventListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |