JSampler
v0.8a

org.jsampler
Class DOMUtils

java.lang.Object
  extended by org.jsampler.DOMUtils

public class DOMUtils
extends java.lang.Object

A collection of utility methods for DOM.


Method Summary
static org.w3c.dom.Document createEmptyDocument()
          Creates an empty document.
static org.w3c.dom.Document readObject(java.io.InputStream in)
          Parses the input from the specified input stream and returns a new document providing the content read from the stream.
static void validateTextContent(org.w3c.dom.Node node)
          Validates a text node.
static void writeObject(org.w3c.dom.Document doc, java.io.OutputStream out)
          Writes the content of document doc to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createEmptyDocument

public static org.w3c.dom.Document createEmptyDocument()
Creates an empty document.

Throws:
java.lang.RuntimeException - if the creation failed.

readObject

public static org.w3c.dom.Document readObject(java.io.InputStream in)
Parses the input from the specified input stream and returns a new document providing the content read from the stream.

Parameters:
in - Provides the content to be parsed.
Returns:
A new document providing the content read from the stream.
Throws:
java.lang.RuntimeException - if the parsing failed.

writeObject

public static void writeObject(org.w3c.dom.Document doc,
                               java.io.OutputStream out)
Writes the content of document doc to the specified output stream.

Parameters:
doc - The document to be written.
out - The output stream where the document should be written.
Throws:
java.lang.RuntimeException - if the operation failed.

validateTextContent

public static void validateTextContent(org.w3c.dom.Node node)
                                throws java.lang.IllegalArgumentException
Validates a text node.

Throws:
java.lang.IllegalArgumentException - If the node is not a text node.

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.