org.granite.util
Class DOM

java.lang.Object
  extended by org.granite.util.DOM

public class DOM
extends Object

Author:
Franck WOLFF

Field Summary
protected static String TO_STRING_XSL
           
 
Constructor Summary
DOM()
           
DOM(ErrorHandler errorHandler)
           
 
Method Summary
 Document getDocument(Node node)
           
protected  DocumentBuilderFactory getDocumentBuilderFactory()
           
 String getNormalizedValue(Node node)
           
protected  Templates getToStringTemplates()
           
protected  DocumentBuilderFactory getValidatingDocumentBuilderFactory()
           
protected  XPathFactory getXPathFactory()
           
 Document loadDocument(InputStream input)
           
 Document loadDocument(InputStream input, EntityResolver resolver)
           
 Document newDocument()
           
 Document newDocument(String root)
           
 Element newElement(Node parent, String name)
           
 Element newElement(Node parent, String name, String value)
           
 void saveDocument(Document document, OutputStream output)
           
 List<Node> selectNodes(Object context, String expression)
           
 Node selectSingleNode(Object context, String expression)
           
 String setValue(Node node, String value)
           
 String toString(Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_STRING_XSL

protected static final String TO_STRING_XSL
See Also:
Constant Field Values
Constructor Detail

DOM

public DOM()

DOM

public DOM(ErrorHandler errorHandler)
Method Detail

getDocumentBuilderFactory

protected DocumentBuilderFactory getDocumentBuilderFactory()

getValidatingDocumentBuilderFactory

protected DocumentBuilderFactory getValidatingDocumentBuilderFactory()

getXPathFactory

protected XPathFactory getXPathFactory()

getToStringTemplates

protected Templates getToStringTemplates()

loadDocument

public Document loadDocument(InputStream input)
                      throws IOException,
                             SAXException
Throws:
IOException
SAXException

loadDocument

public Document loadDocument(InputStream input,
                             EntityResolver resolver)
                      throws IOException,
                             SAXException
Throws:
IOException
SAXException

saveDocument

public void saveDocument(Document document,
                         OutputStream output)
                  throws TransformerException
Throws:
TransformerException

newDocument

public Document newDocument()

newDocument

public Document newDocument(String root)

getDocument

public Document getDocument(Node node)

newElement

public Element newElement(Node parent,
                          String name)

newElement

public Element newElement(Node parent,
                          String name,
                          String value)

getNormalizedValue

public String getNormalizedValue(Node node)

setValue

public String setValue(Node node,
                       String value)

selectSingleNode

public Node selectSingleNode(Object context,
                             String expression)
                      throws XPathExpressionException
Throws:
XPathExpressionException

selectNodes

public List<Node> selectNodes(Object context,
                              String expression)
                       throws XPathExpressionException
Throws:
XPathExpressionException

toString

public String toString(Node node)