org.granite.util
Class StdXMLUtil

java.lang.Object
  extended by org.granite.util.StdXMLUtil
All Implemented Interfaces:
XMLUtil

public class StdXMLUtil
extends Object
implements XMLUtil

Author:
Franck WOLFF

Field Summary
protected static String TO_STRING_XSL
           
 
Constructor Summary
StdXMLUtil()
           
 
Method Summary
 Document buildDocument(String xml)
           
 Document getDocument(Node node)
           
 String getNormalizedValue(Node node)
           
protected  Templates getToStringTemplates()
           
 Document loadDocument(InputStream input)
           
 Document loadDocument(InputStream input, EntityResolver resolver, ErrorHandler errorHandler)
           
 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> selectNodeSet(Object context, String expression)
           
 Node selectSingleNode(Object context, String expression)
           
 String setValue(Node node, String value)
           
 String toNodeString(Node node)
           
 String toString(Document doc)
           
 
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

StdXMLUtil

public StdXMLUtil()
Method Detail

newDocument

public Document newDocument()
Specified by:
newDocument in interface XMLUtil

newDocument

public Document newDocument(String root)
Specified by:
newDocument in interface XMLUtil

getDocument

public Document getDocument(Node node)
Specified by:
getDocument in interface XMLUtil

newElement

public Element newElement(Node parent,
                          String name)
Specified by:
newElement in interface XMLUtil

newElement

public Element newElement(Node parent,
                          String name,
                          String value)
Specified by:
newElement in interface XMLUtil

getNormalizedValue

public String getNormalizedValue(Node node)
Specified by:
getNormalizedValue in interface XMLUtil

setValue

public String setValue(Node node,
                       String value)
Specified by:
setValue in interface XMLUtil

buildDocument

public Document buildDocument(String xml)
Specified by:
buildDocument in interface XMLUtil

loadDocument

public Document loadDocument(InputStream input)
                      throws IOException,
                             SAXException
Specified by:
loadDocument in interface XMLUtil
Throws:
IOException
SAXException

loadDocument

public Document loadDocument(InputStream input,
                             EntityResolver resolver,
                             ErrorHandler errorHandler)
                      throws IOException,
                             SAXException
Specified by:
loadDocument in interface XMLUtil
Throws:
IOException
SAXException

saveDocument

public void saveDocument(Document document,
                         OutputStream output)
Specified by:
saveDocument in interface XMLUtil

toString

public String toString(Document doc)
Specified by:
toString in interface XMLUtil

getToStringTemplates

protected Templates getToStringTemplates()

toNodeString

public String toNodeString(Node node)
Specified by:
toNodeString in interface XMLUtil

selectSingleNode

public Node selectSingleNode(Object context,
                             String expression)
Specified by:
selectSingleNode in interface XMLUtil

selectNodeSet

public List<Node> selectNodeSet(Object context,
                                String expression)
Specified by:
selectNodeSet in interface XMLUtil