|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.utils.XmlUtils
public class XmlUtils
Some XML helper methods to hide DOM complexity. Uses thread local variables to create Builders once per thread.
Method Summary | |
---|---|
static Node |
appendTextNode(Node parent,
String tagName,
String text)
|
static String |
escape(String s)
Escape five, basic XML entities. |
static NodeList |
getNodeList(Object startingPoint,
String xPathString)
Gets a list of nodes by XPath from given starting point |
static Document |
newDoc()
|
static Document |
newDoc(String rootNode)
|
static Document |
parse(File file)
|
static Document |
parse(InputStream source)
|
static Document |
parse(String uri)
|
static Document |
parse(StringReader reader)
|
static void |
serialize(Node doc,
OutputStream dest)
|
static void |
serialize(Node doc,
OutputStream dest,
Properties props)
|
static void |
serialize(Node doc,
Writer writer)
|
static void |
serialize(Node doc,
Writer writer,
Properties props)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Document newDoc()
public static Document newDoc(String rootNode)
public static Document parse(InputStream source) throws SAXException, IOException
SAXException
IOException
public static Document parse(String uri) throws SAXException, IOException
SAXException
IOException
public static Document parse(StringReader reader) throws SAXException, IOException
SAXException
IOException
public static Document parse(File file) throws SAXException, IOException
SAXException
IOException
public static void serialize(Node doc, OutputStream dest) throws TransformerException
TransformerException
public static void serialize(Node doc, Writer writer) throws TransformerException
TransformerException
public static void serialize(Node doc, OutputStream dest, Properties props) throws TransformerException
TransformerException
public static void serialize(Node doc, Writer writer, Properties props) throws TransformerException
TransformerException
public static String escape(String s)
s
- string to be escaped
public static Node appendTextNode(Node parent, String tagName, String text)
public static NodeList getNodeList(Object startingPoint, String xPathString) throws XPathExpressionException
startingPoint
- The context nodexPathString
- The search string
StandardServiceException
- If XPath evaluation fails.
XPathExpressionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |