Package com.bea.wli.sb.sources
Class XmlObjectSource
java.lang.Object
com.bea.wli.sb.sources.XmlObjectSource
- All Implemented Interfaces:
com.bea.wli.sb.sources.ContentTypeAwareSource,Source
public class XmlObjectSource
extends Object
implements Source, com.bea.wli.sb.sources.ContentTypeAwareSource
Apache XBean Source
Source content is represented as an Apache XBean. The XBean may be typed and so
may be accompanied by a SchemaType object and an associated ClassLoader. However,
both of these are entirely optional and the XBean may be untyped XML.
-
Field Summary
FieldsFields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING -
Constructor Summary
ConstructorsConstructorDescriptionXmlObjectSource(org.apache.xmlbeans.XmlObject xml) XmlObjectSource(org.apache.xmlbeans.XmlObject xml, String contentType) XmlObjectSource(org.apache.xmlbeans.XmlObject xml, org.apache.xmlbeans.SchemaType type, ClassLoader cl) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.xmlbeans.XmlOptionscreateXmlOptions(TransformOptions options) Utility class that creates a set ofXmlOptionsfrom a set ofTransformOptions.getInputStream(TransformOptions options) Returns streaming byte-baseed representation of the Source's content.static XmlObjectSourcegetInstance(InputStream in, TransformOptions options) Utility method that creates a newXmlObjectSourcefrom anInputStreamcontaining marshalled XML.static XmlObjectSourcegetInstance(String xmlText, TransformOptions options) Utility method that creates a newXmlObjectSourcefrom a piece of text containing stringified XML.static XmlObjectSourcegetInstance(Node node, TransformOptions options) Utility method that creates a newXmlObjectSourcefrom a DOM node.longorg.apache.xmlbeans.SchemaTypeorg.apache.xmlbeans.XmlObjectvoidsetMessageLength(long msgLength) toString()voidwriteTo(OutputStream os, TransformOptions options) Serializes the Source's content to a byte-based stream.
-
Field Details
-
UNSYNC_XML_OPTION
- See Also:
-
TRACK_PAYLOAD_DETAILS
- See Also:
-
PRETTY_PRINT_OPTION
- See Also:
-
-
Constructor Details
-
XmlObjectSource
public XmlObjectSource(org.apache.xmlbeans.XmlObject xml) -
XmlObjectSource
-
XmlObjectSource
public XmlObjectSource(org.apache.xmlbeans.XmlObject xml, org.apache.xmlbeans.SchemaType type, ClassLoader cl)
-
-
Method Details
-
getXmlObject
public org.apache.xmlbeans.XmlObject getXmlObject() -
getContentType
- Specified by:
getContentTypein interfacecom.bea.wli.sb.sources.ContentTypeAwareSource
-
getClassLoader
-
getSchemaType
public org.apache.xmlbeans.SchemaType getSchemaType() -
getInputStream
Description copied from interface:SourceReturns streaming byte-baseed representation of the Source's content. The representation of that serialization is entirely up to the Source. Note that this method may involve an internal transformation, although it should not in any way change the underlying content.- Specified by:
getInputStreamin interfaceSource- Parameters:
options- Options used to affect the serialization- Returns:
- an InputStream for retrieving the serialized content
-
writeTo
Description copied from interface:SourceSerializes the Source's content to a byte-based stream. The representation of that serialization is entirely up to the Source. The Source is forbidden from closing the provided OutputStream, although it is allowed to flush it. However, flushing the stream should be left to the caller, if possible.Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
- Specified by:
writeToin interfaceSource- Parameters:
os- the OutputStream to which serialized content will be writtenoptions- TransformOptions used to affect the serialization- Throws:
IOException
-
createXmlOptions
Utility class that creates a set ofXmlOptionsfrom a set ofTransformOptions. This method takes into account a base-set of default XmlOptions.- Parameters:
options-- Returns:
-
getInstance
public static XmlObjectSource getInstance(String xmlText, TransformOptions options) throws TransformException Utility method that creates a newXmlObjectSourcefrom a piece of text containing stringified XML.- Parameters:
xmlText-options-- Returns:
- Throws:
TransformException
-
getInstance
public static XmlObjectSource getInstance(Node node, TransformOptions options) throws TransformException Utility method that creates a newXmlObjectSourcefrom a DOM node.- Parameters:
node-options-- Returns:
- Throws:
TransformException
-
getInstance
public static XmlObjectSource getInstance(InputStream in, TransformOptions options) throws TransformException Utility method that creates a newXmlObjectSourcefrom anInputStreamcontaining marshalled XML. This utility method will consume the provided InputStream.- Parameters:
in-options-- Returns:
- Throws:
TransformException
-
toString
-
setMessageLength
public void setMessageLength(long msgLength) -
getMessageLength
public long getMessageLength()
-