|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.security.xmlsec.util.XMLContainer
public class XMLContainer
Internal use only. Container for node set or octet stream XML data. For example, a XMLContainer instance may be used as input or output for a XSTransformer.
| Constructor Summary | |
|---|---|
XMLContainer()Create a new instance of XMLContainer with no transformation input set. |
|
XMLContainer(byte[] bytes)Create a new instance of XMLContainer with the given byte array. |
|
XMLContainer(java.util.Collection nodeSet)Create a new instance of XMLContainer with the given node-set. |
|
XMLContainer(java.io.InputStream octetStream)Create a new instance of XMLContainer with the given octet stream. |
|
XMLContainer(org.w3c.dom.Node subTree)Create a new instance of XMLContainer with the given document sub-tree. |
|
XMLContainer(org.w3c.dom.Node subTree, boolean withComments)Create a new instance of XMLContainer with the given document sub-tree. |
|
XMLContainer(org.w3c.dom.NodeList nodes)Create a new instance of XMLContainer with the given node-set. |
|
XMLContainer(java.lang.String systemId)Create a new instance of XMLContainer with the given system ID. |
|
| Method Summary | |
|---|---|
java.util.Set |
getNodeSet()Returns the nodes in this container. |
java.io.InputStream |
getOctetStream()Returns the octet stream to be used for this container. |
org.w3c.dom.Node |
getSubTree()Returns the root node of the document sub-tree in this container. |
java.lang.String |
getSystemId()Returns the base ID (URL or system ID) from where URLs will be resolved. |
java.lang.Object |
getUserData()Get the userdata associated with this container. |
boolean |
getWithComments()Returns whether conversion to a node-set from a stream or sub-tree will include comment nodes. |
boolean |
nodeSetAvailable()Returns true if the contained XML is available as DOM nodes without parsing or transforming an octet stream, otherwise returns false. |
boolean |
octetsAvailable()Returns true if the contained XML is available as octets without transforming any DOM nodes or opening a connection to a system ID, otherwise returns false. |
void |
setSystemId(java.lang.String systemId)Sets the base ID (URL or system ID) from where URLs will be resolved. |
void |
setUserData(java.lang.Object userData)Set userdata associated with this container. |
void |
setWithComments(boolean value)Sets whether conversion to a node-set from a stream or sub-tree will include comment nodes. |
boolean |
subTreeAvailable()Returns true if the contained XML is available as a a DOM document subtree. |
static java.util.ArrayList |
subtreeToNodeList(org.w3c.dom.Node node, boolean withComments, boolean sortAttribs)Create a node-list containing the given node and all its children, attributes and namespaces. |
static java.util.Set |
subtreeToNodeSet(org.w3c.dom.Node node, boolean withComments)Create a node-set containing the given node and all its children, attributes and namespaces. |
byte[] |
toByteArray()Returns the octets contained in this XMLContainer, or null if it does not contain any data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLContainer()
XMLContainer with no transformation input set.public XMLContainer(org.w3c.dom.NodeList nodes)
XMLContainer with the given node-set.
nodes - The nodes to be contained.public XMLContainer(java.util.Collection nodeSet)
XMLContainer with the given node-set.
nodeSet - The node-set to be contained.public XMLContainer(org.w3c.dom.Node subTree)
XMLContainer with the given document sub-tree. By default, the getNodeSet() method will expand the sub-tree to include comments.
subTree - The root node of the sub-tree to be contained.XMLContainer(Node subTree, boolean withComments), getNodeSet(), setWithComments(boolean)
public XMLContainer(org.w3c.dom.Node subTree,
boolean withComments)
XMLContainer with the given document sub-tree.
subTree - The root node of the sub-tree to be contained.withComments - If true, the getNodeSet() method will expand the sub-tree to include comments; if false, expansion will exclude comments.getNodeSet(), setWithComments(boolean)
public XMLContainer(java.io.InputStream octetStream)
throws java.io.IOException
XMLContainer with the given octet stream.
octetStream - The InputStream to be contained.java.io.IOException
public XMLContainer(byte[] bytes)
throws java.io.IOException
XMLContainer with the given byte array.
bytes - The byte array to be contained.java.io.IOExceptionpublic XMLContainer(java.lang.String systemId)
XMLContainer with the given system ID.
systemId - Specifies the base URI associated with the octet stream.| Method Detail |
|---|
public void setSystemId(java.lang.String systemId)
systemId - Base URL for the node list.public java.lang.String getSystemId()
public void setWithComments(boolean value)
value - If true, comments will be included; if false, comments will be excluded.getNodeSet(), getWithComments(), XMLContainer(Node subTree, boolean withComments)public boolean getWithComments()
true if comments will be included; returns false if comments will be excluded.getNodeSet(), setWithComments(boolean), XMLContainer(Node subTree, boolean withComments)
public org.w3c.dom.Node getSubTree()
throws java.io.IOException,
org.xml.sax.SAXException
org.w3c.dom.Node that is the root of the DOM tree or sub-tree, or null if only a node-set (or no data) is available.java.io.IOException - If an error occurs reading data from the octet stream.org.xml.sax.SAXException - If an error occurs parsing the XML data.subTreeAvailable()
public java.util.Set getNodeSet()
throws java.io.IOException,
org.xml.sax.SAXException,
XPathException
Note: The resulting node-set may contain instances of org.jaxen.dom.NamespaceNode.
java.util.Set of nodes, or null if no data is available.java.io.IOException - If an error occurs reading data from the octet stream.org.xml.sax.SAXException - If an error occurs parsing the XML data.XPathException - If an error occurs constructing the node-set.nodeSetAvailable()
public java.io.InputStream getOctetStream()
throws java.io.IOException
null. If only a system ID is available, a URL connection is opened and the input stream returned.java.io.IOExceptionoctetsAvailable()
public byte[] toByteArray()
throws java.io.IOException
XMLContainer, or null if it does not contain any data.
Note: When this method returns, the underlying input stream will be positioned at the end of input. Therefore, subsequent calls to toByteArray may result in an IOException being thrown.
java.io.IOExceptiongetOctetStream(), octetsAvailable()public boolean octetsAvailable()
true if the contained XML is available as octets without transforming any DOM nodes or opening a connection to a system ID, otherwise returns false.getOctetStream(), toByteArray()public boolean nodeSetAvailable()
true if the contained XML is available as DOM nodes without parsing or transforming an octet stream, otherwise returns false.
This method returns true if subTreeAvailable() returns true. In this case, a call to getNodeSet() will result in sub-tree expansion using XPath.
getNodeSet()public boolean subTreeAvailable()
true if the contained XML is available as a a DOM document subtree.getSubTree()
public static java.util.Set subtreeToNodeSet(org.w3c.dom.Node node,
boolean withComments)
throws XPathException
Note: The resulting node-set may contain instances of org.jaxen.dom.NamespaceNode.
XPathException
public static java.util.ArrayList subtreeToNodeList(org.w3c.dom.Node node,
boolean withComments,
boolean sortAttribs)
Note: The resulting node-set may contain instances of org.jaxen.dom.NamespaceNode.
node -withComments -sortAttribs -XPathExceptionpublic void setUserData(java.lang.Object userData)
userData -public java.lang.Object getUserData()
|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||