Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.5.0)

E15033-03


com.bea.wli.sb.sources
Class DOMSource

java.lang.Object
  extended by com.bea.wli.sb.sources.DOMSource

All Implemented Interfaces:
Source

public final class DOMSource
extends java.lang.Object
implements Source

Document Object Model (DOM) Source <p/> A Source whose content comes from a DOM node. The referenced node may be a full-fledged org.w3c.dom.Document, but it may also be an internal node in a larger document. <p/> The serialization representation is XML text with a particular chracter set encoding. The encoding used can be specified via TransformOptions.


Field Summary
static java.lang.String DOM_IMPL_LS
          an optional transform option that tells the source/transformer to use the specified instance of org.w3c.dom.ls.DOMImplementationLS to for creation of DOM nodes e.g.

 

Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING

 

Constructor Summary
DOMSource(org.w3c.dom.Node node)
          Create a new Source from a DOM node.
DOMSource(org.w3c.dom.Node node, java.lang.String systemID)
          Create a new input source with a DOM node, and with the system ID also passed in as the base URI.

 

Method Summary
 java.io.InputStream getInputStream(TransformOptions options)
          Returns streaming byte-baseed representation of the Source's content.
 org.w3c.dom.Node getNode()
          Get the underlying DOM node for this Source
 java.lang.String getSystemId()
          Get the base ID (URL or system ID)
 void writeTo(java.io.OutputStream os, TransformOptions options)
          Serializes the Source's content to a byte-based stream.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

DOM_IMPL_LS

public static final java.lang.String DOM_IMPL_LS
an optional transform option that tells the source/transformer to use the specified instance of org.w3c.dom.ls.DOMImplementationLS to for creation of DOM nodes e.g.
   DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
   DOMImplementationLS lsImpl = (DOMImplementationLS)registry.getDOMImplementation("LS");
       (or something like
           lsImpl = oracle.xml.parser.v2.XMLDOMImplementation()
       )
   options.put(DOMSource.DOM_IMPL_LS, lsImpl);
   DOMSource dom = ...getTransformer().transform(source, DOMSource.class, options);
 
If not specified, the default platform DOM implementation LS will be used.
See Also:
Constant Field Values

Constructor Detail

DOMSource

public DOMSource(org.w3c.dom.Node node)
Create a new Source from a DOM node.
Parameters:
node - The DOM node that will be this Source's content

DOMSource

public DOMSource(org.w3c.dom.Node node,
                 java.lang.String systemID)
Create a new input source with a DOM node, and with the system ID also passed in as the base URI.
Parameters:
node - The DOM node that will be this Source's content
systemID - Specifies the base URI associated with node.

Method Detail

getNode

public org.w3c.dom.Node getNode()
Get the underlying DOM node for this Source

getSystemId

public java.lang.String getSystemId()
Get the base ID (URL or system ID)
Returns:
Base URL for this DOM tree.

getInputStream

public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.IOException,
                                          TransformException
Description copied from interface: Source
Returns 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:
getInputStream in interface Source
Parameters:
options - Options used to affect the serialization
Returns:
an InputStream for retrieving the serialized content
Throws:
java.io.IOException
TransformException

writeTo

public void writeTo(java.io.OutputStream os,
                    TransformOptions options)
             throws java.io.IOException,
                    TransformException
Description copied from interface: Source
Serializes 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. <p/> Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
Specified by:
writeTo in interface Source
Parameters:
os - the OutputStream to which serialized content will be written
options - TransformOptions used to affect the serialization
Throws:
java.io.IOException
TransformException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.5.0)

E15033-03


Copyright © 2008, 2011, Oracle. All rights reserved.