com.ibm.websphere.sdox
Class SDOUtil
- java.lang.Object
com.ibm.websphere.sdox.SDOUtil
- public final class SDOUtil
- extends java.lang.Object
Field Summary
Modifier and Type | Field and Description |
---|---|
|
DATATYPE_WRAPPER_URI
URI of the DataTypeWrapper Type
|
|
OPTION_BO_COMPATIBLE
|
|
OPTION_CHANGE_SUMMARY
The HelperContext option OPTION_CHANGE_SUMMARY enables the change summary feature.
|
|
OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE
The HelperContext option OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE determines whether or not schema specified default attributes
are propagated during a document instance copy operation.
|
|
OPTION_COPY_ON_WRITE
The HelperContext option OPTION_COPY_ON_WRITE determines whether CopyHelper.copy() will perform
copy-on-write (when possible).
|
|
OPTION_EAGER_BUFFER_LOAD
The HelperContext option OPTION_EAGER_BUFFER_LOAD will load the entire document to its internal buffer but not
necessarily parse its contents
Value should be either "true" or "false". |
|
OPTION_EAGER_ON_LOAD
The HelperContext option OPTION_EAGER_ON_LOAD will materialize the entire document/data during the
"loading phase" - i.e., during the load() call.
|
|
OPTION_FAST_SERIALIZATION
The HelperContext option OPTION_FAST_SERIALIZATION will improve the speed of serialization operations by
caching namespace information.
|
|
OPTION_LOAD_DISALLOW_UNKNOWN_ITEMS
Only effective if BO-compat flag is on.
|
|
OPTION_LOAD_LARGE_DOCUMENT
The HelperContext option OPTION_LOAD_LARGE_DOCUMENT will improve de-serialization operations for large documents (> 1MB).
|
|
OPTION_LOAD_SKIP_SUBTREE
The HelperContext option OPTION_LOAD_SKIP_SUBTREE will materialize the root level of the document/data during the
"loading phase" - i.e., during the load() call.
|
|
OPTION_SAVE_DEFAULT_ATTRIBUTE
The HelperContext option OPTION_SAVE_DISCARD_DEFAULT_ATTRIBUTE instructs the XML serializer to save the
default attribute value specified in the XSD.
|
|
OPTION_SAVE_FORCE_NS_DECLARATIONS
The HelperContext option OPTION_SAVE_FORCE_NS_DECLARATIONS specifies a list of QName that would always be serialized.
|
|
OPTION_SAVE_INDENT
The HelperContext option OPTION_SAVE_INDENT specifies whether additional whitespace may be added during serialization.
|
|
OPTION_SAVE_INDENT_LINE_SEPARATOR
The HelperContext option OPTION_SAVE_INDENT_LINE_SEPARATOR contains the line separator value to use when the
option OPTION_SAVE_INDENT == "true".
|
|
OPTION_SAVE_OMIT_XML_DECL
The HelperContext option OPTION_SAVE_OMIT_XML_DECL specifies whether or not to omit the xml declaration when
serializing instance documents.
|
|
OPTION_SAVE_REQUIRED_PREFIXES
The HelperContext option OPTION_SAVE_REQUIRED_PREFIXES specifies a list of QName containing prefix and URI.
|
|
OPTION_SAVE_STANDARD_CHANGE_SUMMARY
The HelperContext option OPTION_SAVE_STANDARD_CHANGE_SUMMARY specifies whether or not the change summary information
is serialized using the standard XML format described in the SDO specification.
|
|
OPTION_SAVE_STRIP_WHITESPACE
The HelperContext option OPTION_SAVE_STRIP_WHITESPACE specifies whether to strip whitespace ("true") from
serialized output or not ("false").
|
|
OPTION_SAVE_USE_DEFAULT_NS
The HelperContext option OPTION_SAVE_USE_DEFAULT_NS specifies whether or not a QName in a namespace
can be serialized in the default namespace.
|
|
OPTION_SCHEMA_ERROR_FAILFAST
The HelperContext option OPTION_SCHEMA_ERROR_FAILFAST enables the schema fail fast mode.
|
|
OPTION_SCHEMA_ERROR_HANDLER
The HelperContext option OPTION_SCHEMA_ERROR_HANDLER specifies the schema error handler to be used by the HelperContext instance.
|
|
OPTION_SCHEMA_FULL_CHECKING
The HelperContext option OPTION_SCHEMA_FULL_CHECKING enables full checking of schema constraints when loading schema documents.
|
|
OPTION_SCOPE_MANAGER
|
|
OPTION_VALIDATE_ON_LOAD
The HelperContext option OPTION_VALIDATE_ON_LOAD is a superset of OPTION_EAGER_ON_LOAD in that it will perform
a document schema validation in addition to the loading operation discussed in OPTION_EAGER_ON_LOAD.
|
|
OPTION_XML_ATTACHMENT_MARSHALLER
The HelperContext option OPTION_XML_ATTACHMENT_MARSHALLER is used to
register a helper object that can determine if a piece of base64Binary
data should be serialized as inlined base64 text or as an MTOM attachment
reference.
|
|
OPTION_XML_ATTACHMENT_UNMARSHALLER
The HelperContext option OPTION_XML_ATTACHMENT_UNMARSHALLER is used to
register a helper object that can resolve MTOM attachment content IDs
and return the corresponding content of the attachment.
|
|
OPTION_XML_ERROR_HANDLER
The HelperContext option OPTION_XML_ERROR_HANDLER specifies the xml instance error handler to
be used by the HelperContext instance.
|
|
SCA_DEFAULT_SCOPE
SCA default HelperContext identifier
|
Constructor Summary
Constructor and Description |
---|
SDOUtil()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addSDOAliasName(commonj.sdo.Type type,java.lang.String aliasName)
Creates an alias name for the specified type.
|
|
convertFromString(commonj.sdo.Type datatype,java.lang.String value)
Convert from a string representation of the specified datatype to a value of the type.
|
|
convertToString(commonj.sdo.Type datatype,java.lang.Object value)
Convert a value of the specified datatype to its corresponding string representation.
|
|
createHelperContext()
Create a helper context with a randomly generated ID
|
|
createHelperContext(java.util.Map<java.lang.String,java.lang.Object> options)
Create a helper context with the specified options and a randomly generated ID
|
|
define(commonj.sdo.helper.XSDHelper xsdHelper,java.util.List<javax.xml.transform.Source> sources)
Define a group of schemas contributing to the same target namespace.
|
|
get(commonj.sdo.Type type,commonj.sdo.Property property)
Gets an instance Property (annotation) from the specified Type.
|
|
getAttributes(commonj.sdo.DataObject dataObject)
Returns a Map of attributes contained by the specified DataObject
|
|
getInstanceProperties(commonj.sdo.Type type)
Gets the list of instance properties (annotations) of the specified Type.
|
|
getMaxLength(commonj.sdo.Type type)
Return the value of the maxLength facet on the specified Type, if available
|
|
getQName(commonj.sdo.Property property)
Return the namespace-qualified name of the specified Property
|
|
getQName(commonj.sdo.Type type)
Return the namespace-qualified name of the specified Type
|
|
getWSDLSources(commonj.sdo.helper.XSDHelper xsdHelper,java.io.InputStream wsdlInputStream,java.lang.String schemaLocation)
Create XSD sources for types representing WSDL components - e.g., messages, parts, etc.
|
|
isDataTypeWrapper(commonj.sdo.Type type)
Return true if the specified Type is a DataTypeWrapper
|
|
isElement(commonj.sdo.Property property)
Returns whether or not the specified property is mapped to an XML element
|
|
isMixed(commonj.sdo.Type type)
Return true if mixed content is allowed for the specified Type
|
|
set(commonj.sdo.Type type,commonj.sdo.Property property,java.lang.Object value)
Sets an instance Property (annotation) on the specified Type.
|
|
setLogging(commonj.sdo.ChangeSummary changeSummary,boolean logging)
Suspend or resume logging for the specified ChangeSummary
|
|
unset(commonj.sdo.Type type,commonj.sdo.Property property)
Unsets an instance Property (annotation) on the specified Type.
|
|
validate(commonj.sdo.DataObject dataObject)
Check if a data object is compliant to its XSD.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
DATATYPE_WRAPPER_URI
- public static final java.lang.String DATATYPE_WRAPPER_URI
URI of the DataTypeWrapper Type
See Also:
SCA_DEFAULT_SCOPE
- public static final java.lang.String SCA_DEFAULT_SCOPE
SCA default HelperContext identifier
See Also:
OPTION_CHANGE_SUMMARY
- public static final java.lang.String OPTION_CHANGE_SUMMARY
The HelperContext option OPTION_CHANGE_SUMMARY enables the change summary feature.
Value should be either "true" or "false".
The default value is "true".
Value should be either "true" or "false".
The default value is "true".
See Also:
OPTION_SCHEMA_ERROR_HANDLER
- public static final java.lang.String OPTION_SCHEMA_ERROR_HANDLER
The HelperContext option OPTION_SCHEMA_ERROR_HANDLER specifies the schema error handler to be used by the HelperContext instance.
Value must be an instance of
Value must be an instance of
DOMErrorHandler
.
See Also:
OPTION_SCHEMA_ERROR_FAILFAST
- public static final java.lang.String OPTION_SCHEMA_ERROR_FAILFAST
The HelperContext option OPTION_SCHEMA_ERROR_FAILFAST enables the schema fail fast mode.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_SCHEMA_FULL_CHECKING
- public static final java.lang.String OPTION_SCHEMA_FULL_CHECKING
The HelperContext option OPTION_SCHEMA_FULL_CHECKING enables full checking of schema constraints when loading schema documents.
Value should be either "true" or "false".
The default value is "true".
Value should be either "true" or "false".
The default value is "true".
See Also:
OPTION_XML_ERROR_HANDLER
- public static final java.lang.String OPTION_XML_ERROR_HANDLER
The HelperContext option OPTION_XML_ERROR_HANDLER specifies the xml instance error handler to
be used by the HelperContext instance.
Value must be an instance of
Value must be an instance of
DOMErrorHandler
.
See Also:
OPTION_SAVE_USE_DEFAULT_NS
- public static final java.lang.String OPTION_SAVE_USE_DEFAULT_NS
The HelperContext option OPTION_SAVE_USE_DEFAULT_NS specifies whether or not a QName in a namespace
can be serialized in the default namespace.
Value should be either "true" or "false".
The default value is "true".
Value should be either "true" or "false".
The default value is "true".
See Also:
OPTION_SAVE_STRIP_WHITESPACE
- public static final java.lang.String OPTION_SAVE_STRIP_WHITESPACE
The HelperContext option OPTION_SAVE_STRIP_WHITESPACE specifies whether to strip whitespace ("true") from
serialized output or not ("false").
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_LOAD_DISALLOW_UNKNOWN_ITEMS
- public static final java.lang.String OPTION_LOAD_DISALLOW_UNKNOWN_ITEMS
Only effective if BO-compat flag is on.
When turned on, an exception is thrown when any of the following is true
(after trying all the BO-compat fallbacks, including using root element
name as type name, removing _._type from xsi:type, removing "Object"
from xsi:type, etc.):
Unexpected root: If the root element doesn't match any element
declaration, and it doesn't have a resolvable xsi:type.
Unexpected element: If an element is not allowed by the
parent's type (no matching declaration, no wildcard), and is not allowed
by any ancestor type (in case an optional element in the ancestor was
removed in a derived type) except for anyType.
Unexpected attribute: Same as #2 but for attributes.
See Also:
OPTION_SAVE_REQUIRED_PREFIXES
- public static final java.lang.String OPTION_SAVE_REQUIRED_PREFIXES
The HelperContext option OPTION_SAVE_REQUIRED_PREFIXES specifies a list of QName containing prefix and URI.
See Also:
OPTION_SAVE_FORCE_NS_DECLARATIONS
- public static final java.lang.String OPTION_SAVE_FORCE_NS_DECLARATIONS
The HelperContext option OPTION_SAVE_FORCE_NS_DECLARATIONS specifies a list of QName that would always be serialized.
See Also:
OPTION_SAVE_OMIT_XML_DECL
- public static final java.lang.String OPTION_SAVE_OMIT_XML_DECL
The HelperContext option OPTION_SAVE_OMIT_XML_DECL specifies whether or not to omit the xml declaration when
serializing instance documents.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_SAVE_INDENT
- public static final java.lang.String OPTION_SAVE_INDENT
The HelperContext option OPTION_SAVE_INDENT specifies whether additional whitespace may be added during serialization.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_SAVE_INDENT_LINE_SEPARATOR
- public static final java.lang.String OPTION_SAVE_INDENT_LINE_SEPARATOR
The HelperContext option OPTION_SAVE_INDENT_LINE_SEPARATOR contains the line separator value to use when the
option OPTION_SAVE_INDENT == "true".
The default value is "\n".
The default value is "\n".
OPTION_SAVE_STANDARD_CHANGE_SUMMARY
- public static final java.lang.String OPTION_SAVE_STANDARD_CHANGE_SUMMARY
The HelperContext option OPTION_SAVE_STANDARD_CHANGE_SUMMARY specifies whether or not the change summary information
is serialized using the standard XML format described in the SDO specification.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_SAVE_DEFAULT_ATTRIBUTE
- public static final java.lang.String OPTION_SAVE_DEFAULT_ATTRIBUTE
The HelperContext option OPTION_SAVE_DISCARD_DEFAULT_ATTRIBUTE instructs the XML serializer to save the
default attribute value specified in the XSD.
Value should be either boolean true or false.
The default value is true.
Value should be either boolean true or false.
The default value is true.
See Also:
OPTION_FAST_SERIALIZATION
- public static final java.lang.String OPTION_FAST_SERIALIZATION
The HelperContext option OPTION_FAST_SERIALIZATION will improve the speed of serialization operations by
caching namespace information.
Value should be either "true" or "false".
The default value is "true".
Value should be either "true" or "false".
The default value is "true".
See Also:
OPTION_EAGER_ON_LOAD
- public static final java.lang.String OPTION_EAGER_ON_LOAD
The HelperContext option OPTION_EAGER_ON_LOAD will materialize the entire document/data during the
"loading phase" - i.e., during the load() call. Any well-formedness
errors are reported immediately, but no validity errors are reported because
the data is simply loaded, not validated. As a side note, this happens in a document order, so there are no
skipped subtrees.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_EAGER_BUFFER_LOAD
- public static final java.lang.String OPTION_EAGER_BUFFER_LOAD
The HelperContext option OPTION_EAGER_BUFFER_LOAD will load the entire document to its internal buffer but not
necessarily parse its contents
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_LOAD_SKIP_SUBTREE
- public static final java.lang.String OPTION_LOAD_SKIP_SUBTREE
The HelperContext option OPTION_LOAD_SKIP_SUBTREE will materialize the root level of the document/data during the
"loading phase" - i.e., during the load() call. The remaining portions of the
document/data will be loaded "as needed".
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_VALIDATE_ON_LOAD
- public static final java.lang.String OPTION_VALIDATE_ON_LOAD
The HelperContext option OPTION_VALIDATE_ON_LOAD is a superset of OPTION_EAGER_ON_LOAD in that it will perform
a document schema validation in addition to the loading operation discussed in OPTION_EAGER_ON_LOAD. At the
conclusion of the "loading phase", when this option is enabled ("true"), the document/data will have been loaded in its
entirety and both well-formedness and validity errors will have been reported.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_LOAD_LARGE_DOCUMENT
- public static final java.lang.String OPTION_LOAD_LARGE_DOCUMENT
The HelperContext option OPTION_LOAD_LARGE_DOCUMENT will improve de-serialization operations for large documents (> 1MB).
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE
- public static final java.lang.String OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE
The HelperContext option OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE determines whether or not schema specified default attributes
are propagated during a document instance copy operation.
Value should be either "true" or "false".
The default value is "false".
Value should be either "true" or "false".
The default value is "false".
See Also:
OPTION_COPY_ON_WRITE
- public static final java.lang.String OPTION_COPY_ON_WRITE
The HelperContext option OPTION_COPY_ON_WRITE determines whether CopyHelper.copy() will perform
copy-on-write (when possible).
Value should be either "true" or "false".
The default value is "true".
Value should be either "true" or "false".
The default value is "true".
See Also:
OPTION_BO_COMPATIBLE
- public static final java.lang.String OPTION_BO_COMPATIBLE
See Also:
OPTION_SCOPE_MANAGER
- public static final java.lang.String OPTION_SCOPE_MANAGER
See Also:
OPTION_XML_ATTACHMENT_UNMARSHALLER
- public static final java.lang.String OPTION_XML_ATTACHMENT_UNMARSHALLER
The HelperContext option OPTION_XML_ATTACHMENT_UNMARSHALLER is used to
register a helper object that can resolve MTOM attachment content IDs
and return the corresponding content of the attachment. Value of this
property must be an instance of @link XMLAttachmentUnmarshaller.
An object should not be registered if the document does not contatin any
references to MTOM attachments.
See Also:
OPTION_XML_ATTACHMENT_MARSHALLER
- public static final java.lang.String OPTION_XML_ATTACHMENT_MARSHALLER
The HelperContext option OPTION_XML_ATTACHMENT_MARSHALLER is used to
register a helper object that can determine if a piece of base64Binary
data should be serialized as inlined base64 text or as an MTOM attachment
reference. Value of this property must be an instance of
See Also:
Constructor Detail
SDOUtil
- public SDOUtil()
Method Detail
createHelperContext
- public static commonj.sdo.helper.HelperContext createHelperContext( java.util.Map<java.lang.String,java.lang.Object> options)
Create a helper context with the specified options and a randomly generated ID
Returns:
new HelperContext object
createHelperContext
- public static commonj.sdo.helper.HelperContext createHelperContext( )
Create a helper context with a randomly generated ID
Returns:
new HelperContext object
getAttributes
- public static java.util.Map<java.lang.String,java.lang.Object> getAttributes( commonj.sdo.DataObject dataObject)
Returns a Map of attributes contained by the specified DataObject
Returns:
Map of attributes
validate
- public static boolean validate( commonj.sdo.DataObject dataObject)
Check if a data object is compliant to its XSD.
Returns:
true if valid, otherwise false
define
- public static java.util.List define( commonj.sdo.helper.XSDHelper xsdHelper,
- java.util.List<javax.xml.transform.Source> sources)
Define a group of schemas contributing to the same target namespace.
Multiple target namespaces can be defined as well.
Parameters:
xsdHelper
- Returns:
A list of defined SDO types
getWSDLSources
- public static java.util.List<javax.xml.transform.Source> getWSDLSources( commonj.sdo.helper.XSDHelper xsdHelper,
- java.io.InputStream wsdlInputStream,
- java.lang.String schemaLocation)
Create XSD sources for types representing WSDL components - e.g., messages, parts, etc.
Parameters:
xsdHelper
- wsdlInputStream
- a .wsdl stream convertToString
- public static java.lang.String convertToString( commonj.sdo.Type datatype,
- java.lang.Object value)
Convert a value of the specified datatype to its corresponding string representation.
Returns:
string value
convertFromString
- public static java.lang.Object convertFromString( commonj.sdo.Type datatype,
- java.lang.String value)
Convert from a string representation of the specified datatype to a value of the type.
Parameters:
datatype
- value
- Returns:
object value
getInstanceProperties
- public static java.util.List getInstanceProperties( commonj.sdo.Type type)
Gets the list of instance properties (annotations) of the specified Type.
Parameters:
type
- Returns:
list of Property
get
- public static java.lang.Object get( commonj.sdo.Type type,
- commonj.sdo.Property property)
Gets an instance Property (annotation) from the specified Type.
Parameters:
type
- property
- Returns:
annotation value
set
- public static void set(commonj.sdo.Type type,
- commonj.sdo.Property property,
- java.lang.Object value)
Sets an instance Property (annotation) on the specified Type.
Parameters:
type
- property
- value
- unset
- public static void unset(commonj.sdo.Type type,
- commonj.sdo.Property property)
Unsets an instance Property (annotation) on the specified Type.
Parameters:
type
- property
- isMixed
- public static boolean isMixed(commonj.sdo.Type type)
Return true if mixed content is allowed for the specified Type
Parameters:
type
- Returns:
true if mixed, otherwise false.
getMaxLength
- public static java.lang.String getMaxLength( commonj.sdo.Type type)
Return the value of the maxLength facet on the specified Type, if available
Parameters:
type
- Returns:
value of the maxLength facet or null
isElement
- public static boolean isElement( commonj.sdo.Property property)
Returns whether or not the specified property is mapped to an XML element
Parameters:
property
- Returns:
true if the property is an XML element, otherwise false.
getQName
- public static javax.xml.namespace.QName getQName( commonj.sdo.Type type)
Return the namespace-qualified name of the specified Type
Parameters:
type
- Returns:
QName of the type.
getQName
- public static javax.xml.namespace.QName getQName( commonj.sdo.Property property)
Return the namespace-qualified name of the specified Property
Parameters:
property
- Returns:
QName of the property.
isDataTypeWrapper
- public static boolean isDataTypeWrapper( commonj.sdo.Type type)
Return true if the specified Type is a DataTypeWrapper
Parameters:
type
- Returns:
true if the type specified is a data wrapper, otherwise false.
addSDOAliasName
- public static void addSDOAliasName( commonj.sdo.Type type,
- java.lang.String aliasName)
Creates an alias name for the specified type.
Parameters:
type
- setLogging
- public static void setLogging(commonj.sdo.ChangeSummary changeSummary,
- boolean logging)
Suspend or resume logging for the specified ChangeSummary