com.ibm.websphere.sdox

Class SDOUtil

  1. java.lang.Object
  2. extended bycom.ibm.websphere.sdox.SDOUtil

  1. public final class SDOUtil
  2. extends java.lang.Object
This class provides convenient static utility functions for implementation extended APIs

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
DATATYPE_WRAPPER_URI
URI of the DataTypeWrapper Type
  1. static
  2. java.lang.String
OPTION_BO_COMPATIBLE
  1. static
  2. java.lang.String
OPTION_CHANGE_SUMMARY
The HelperContext option OPTION_CHANGE_SUMMARY enables the change summary feature.
  1. static
  2. 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.
  1. static
  2. 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).
  1. static
  2. 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".
  1. static
  2. 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.
  1. static
  2. java.lang.String
OPTION_FAST_SERIALIZATION
The HelperContext option OPTION_FAST_SERIALIZATION will improve the speed of serialization operations by caching namespace information.
  1. static
  2. java.lang.String
OPTION_LOAD_DISALLOW_UNKNOWN_ITEMS
Only effective if BO-compat flag is on.
  1. static
  2. java.lang.String
OPTION_LOAD_LARGE_DOCUMENT
The HelperContext option OPTION_LOAD_LARGE_DOCUMENT will improve de-serialization operations for large documents (> 1MB).
  1. static
  2. 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.
  1. static
  2. 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.
  1. static
  2. 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.
  1. static
  2. java.lang.String
OPTION_SAVE_INDENT
The HelperContext option OPTION_SAVE_INDENT specifies whether additional whitespace may be added during serialization.
  1. static
  2. 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".
  1. static
  2. 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.
  1. static
  2. java.lang.String
OPTION_SAVE_REQUIRED_PREFIXES
The HelperContext option OPTION_SAVE_REQUIRED_PREFIXES specifies a list of QName containing prefix and URI.
  1. static
  2. 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.
  1. static
  2. 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").
  1. static
  2. 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.
  1. static
  2. java.lang.String
OPTION_SCHEMA_ERROR_FAILFAST
The HelperContext option OPTION_SCHEMA_ERROR_FAILFAST enables the schema fail fast mode.
  1. static
  2. 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.
  1. static
  2. java.lang.String
OPTION_SCHEMA_FULL_CHECKING
The HelperContext option OPTION_SCHEMA_FULL_CHECKING enables full checking of schema constraints when loading schema documents.
  1. static
  2. java.lang.String
OPTION_SCOPE_MANAGER
  1. static
  2. 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.
  1. static
  2. 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.
  1. static
  2. 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.
  1. static
  2. 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.
  1. static
  2. java.lang.String
SCA_DEFAULT_SCOPE
SCA default HelperContext identifier

Constructor Summary

Constructor and Description
SDOUtil()

Method Summary

Modifier and Type Method and Description
  1. static
  2. void
addSDOAliasName(commonj.sdo.Type type,java.lang.String aliasName)
Creates an alias name for the specified type.
  1. static
  2. 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.
  1. static
  2. java.lang.String
convertToString(commonj.sdo.Type datatype,java.lang.Object value)
Convert a value of the specified datatype to its corresponding string representation.
  1. static
  2. commonj.sdo.helper.HelperContext
createHelperContext()
Create a helper context with a randomly generated ID
  1. static
  2. 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
  1. static
  2. 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.
  1. static
  2. java.lang.Object
get(commonj.sdo.Type type,commonj.sdo.Property property)
Gets an instance Property (annotation) from the specified Type.
  1. static
  2. java.util.Map<java.lang.String,java.lang.Object>
getAttributes(commonj.sdo.DataObject dataObject)
Returns a Map of attributes contained by the specified DataObject
  1. static
  2. java.util.List
getInstanceProperties(commonj.sdo.Type type)
Gets the list of instance properties (annotations) of the specified Type.
  1. static
  2. java.lang.String
getMaxLength(commonj.sdo.Type type)
Return the value of the maxLength facet on the specified Type, if available
  1. static
  2. javax.xml.namespace.QName
getQName(commonj.sdo.Property property)
Return the namespace-qualified name of the specified Property
  1. static
  2. javax.xml.namespace.QName
getQName(commonj.sdo.Type type)
Return the namespace-qualified name of the specified Type
  1. static
  2. 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.
  1. static
  2. boolean
isDataTypeWrapper(commonj.sdo.Type type)
Return true if the specified Type is a DataTypeWrapper
  1. static
  2. boolean
isElement(commonj.sdo.Property property)
Returns whether or not the specified property is mapped to an XML element
  1. static
  2. boolean
isMixed(commonj.sdo.Type type)
Return true if mixed content is allowed for the specified Type
  1. static
  2. void
set(commonj.sdo.Type type,commonj.sdo.Property property,java.lang.Object value)
Sets an instance Property (annotation) on the specified Type.
  1. static
  2. void
setLogging(commonj.sdo.ChangeSummary changeSummary,boolean logging)
Suspend or resume logging for the specified ChangeSummary
  1. static
  2. void
unset(commonj.sdo.Type type,commonj.sdo.Property property)
Unsets an instance Property (annotation) on the specified Type.
  1. static
  2. boolean
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

  1. public static final java.lang.String DATATYPE_WRAPPER_URI
URI of the DataTypeWrapper Type
See Also:

SCA_DEFAULT_SCOPE

  1. public static final java.lang.String SCA_DEFAULT_SCOPE
SCA default HelperContext identifier
See Also:

OPTION_CHANGE_SUMMARY

  1. 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".
See Also:

OPTION_SCHEMA_ERROR_HANDLER

  1. 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 DOMErrorHandler.
See Also:

OPTION_SCHEMA_ERROR_FAILFAST

  1. 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".
See Also:

OPTION_SCHEMA_FULL_CHECKING

  1. 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".
See Also:

OPTION_XML_ERROR_HANDLER

  1. 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 DOMErrorHandler.
See Also:

OPTION_SAVE_USE_DEFAULT_NS

  1. 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".
See Also:

OPTION_SAVE_STRIP_WHITESPACE

  1. 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".
See Also:

OPTION_LOAD_DISALLOW_UNKNOWN_ITEMS

  1. 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

    1. 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

    1. 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

    1. 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".
    See Also:

    OPTION_SAVE_INDENT

    1. 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".
    See Also:

    OPTION_SAVE_INDENT_LINE_SEPARATOR

    1. 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".

    OPTION_SAVE_STANDARD_CHANGE_SUMMARY

    1. 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".
    See Also:

    OPTION_SAVE_DEFAULT_ATTRIBUTE

    1. 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.
    See Also:

    OPTION_FAST_SERIALIZATION

    1. 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".
    See Also:

    OPTION_EAGER_ON_LOAD

    1. 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".
    See Also:

    OPTION_EAGER_BUFFER_LOAD

    1. 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".
    See Also:

    OPTION_LOAD_SKIP_SUBTREE

    1. 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".
    See Also:

    OPTION_VALIDATE_ON_LOAD

    1. 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".
    See Also:

    OPTION_LOAD_LARGE_DOCUMENT

    1. 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".
    See Also:

    OPTION_COPY_DISCARD_DEFAULT_ATTRIBUTE

    1. 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".
    See Also:

    OPTION_COPY_ON_WRITE

    1. 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".
    See Also:

    OPTION_BO_COMPATIBLE

    1. public static final java.lang.String OPTION_BO_COMPATIBLE
    See Also:

    OPTION_SCOPE_MANAGER

    1. public static final java.lang.String OPTION_SCOPE_MANAGER
    See Also:

    OPTION_XML_ATTACHMENT_UNMARSHALLER

    1. 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

    1. 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

    1. public SDOUtil()

    Method Detail

    createHelperContext

    1. 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

    1. public static commonj.sdo.helper.HelperContext createHelperContext( )
    Create a helper context with a randomly generated ID
    Returns:
    new HelperContext object

    getAttributes

    1. 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

    1. 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

    1. public static java.util.List define( commonj.sdo.helper.XSDHelper xsdHelper,
    2. 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

    1. public static java.util.List<javax.xml.transform.Source> getWSDLSources( commonj.sdo.helper.XSDHelper xsdHelper,
    2. java.io.InputStream wsdlInputStream,
    3. java.lang.String schemaLocation)
    Create XSD sources for types representing WSDL components - e.g., messages, parts, etc.
    Parameters:
    xsdHelper -
    wsdlInputStream - a .wsdl stream

    convertToString

    1. public static java.lang.String convertToString( commonj.sdo.Type datatype,
    2. java.lang.Object value)
    Convert a value of the specified datatype to its corresponding string representation.
    Returns:
    string value

    convertFromString

    1. public static java.lang.Object convertFromString( commonj.sdo.Type datatype,
    2. 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

    1. 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

    1. public static java.lang.Object get( commonj.sdo.Type type,
    2. commonj.sdo.Property property)
    Gets an instance Property (annotation) from the specified Type.
    Parameters:
    type -
    property -
    Returns:
    annotation value

    set

    1. public static void set(commonj.sdo.Type type,
    2. commonj.sdo.Property property,
    3. java.lang.Object value)
    Sets an instance Property (annotation) on the specified Type.
    Parameters:
    type -
    property -
    value -

    unset

    1. public static void unset(commonj.sdo.Type type,
    2. commonj.sdo.Property property)
    Unsets an instance Property (annotation) on the specified Type.
    Parameters:
    type -
    property -

    isMixed

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. 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

    1. public static void addSDOAliasName( commonj.sdo.Type type,
    2. java.lang.String aliasName)
    Creates an alias name for the specified type.
    Parameters:
    type -

    setLogging

    1. public static void setLogging(commonj.sdo.ChangeSummary changeSummary,
    2. boolean logging)
    Suspend or resume logging for the specified ChangeSummary