|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.core.util.xml.XmlHelper
public final class XmlHelper
Provides a set of utilities for XML-related operations on org.jdom & org.w3c xml Objects.
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
private |
XmlHelper()
|
Method Summary | |
---|---|
static void |
appendXml(Node parentNode,
String xml)
|
static org.jdom.Document |
buildJDocument(Document document)
Creates jdom Document from a w3c Document. |
static org.jdom.Document |
buildJDocument(Reader xmlStream)
Creates jdom Document from a Reader. |
static Collection<org.jdom.Element> |
findElements(org.jdom.Element root,
String elementName)
Find all Elements in document of a particular name |
private static void |
findElements(org.jdom.Element root,
String elementName,
Collection<org.jdom.Element> list)
This function is tail-recursive and just adds the root to the list if it matches and checks the children. |
static boolean |
pathExists(XPath xpath,
String expression,
Object object)
Convenience method that performs an xpath evaluation to determine whether the expression evaluates to true (a node exists). |
static void |
propagateNamespace(org.jdom.Element element,
org.jdom.Namespace namespace)
|
static Element |
propertiesToXml(Document doc,
Object o,
String elementName)
|
static Document |
readXml(String xml)
|
private static void |
trimElement(Node node)
|
private static void |
trimSAXElement(org.jdom.Element element)
|
static org.jdom.Document |
trimSAXXml(InputStream input)
|
static Document |
trimXml(InputStream input)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
private XmlHelper()
Method Detail |
---|
public static org.jdom.Document buildJDocument(Reader xmlStream)
xmlStream
- the reader representing the xmlstream
public static org.jdom.Document buildJDocument(Document document)
document
- the w3c document
public static Collection<org.jdom.Element> findElements(org.jdom.Element root, String elementName)
root
- the starting Element to scanelementName
- name of the Element to scan for
public static void appendXml(Node parentNode, String xml) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static Document readXml(String xml) throws TransformerException
TransformerException
public static void propagateNamespace(org.jdom.Element element, org.jdom.Namespace namespace)
public static Document trimXml(InputStream input) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static org.jdom.Document trimSAXXml(InputStream input) throws org.jdom.JDOMException, SAXException, IOException, ParserConfigurationException
org.jdom.JDOMException
SAXException
IOException
ParserConfigurationException
public static boolean pathExists(XPath xpath, String expression, Object object) throws XPathExpressionException
xpath
- the XPath objectexpression
- the XPath expressionobject
- the object on which to evaluate the expression as required by the XPath API, typically a Node
XPathExpressionException
- if the expression failspublic static Element propertiesToXml(Document doc, Object o, String elementName) throws Exception
Exception
private static void findElements(org.jdom.Element root, String elementName, Collection<org.jdom.Element> list)
root
- the root element to search underelementName
- the element name to findlist
- a list of found elementprivate static void trimElement(Node node) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
private static void trimSAXElement(org.jdom.Element element) throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |