|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.ui.util.DOMHelper
public class DOMHelper
Utility class to provide common functions useful when working with DOM.
Constructor Summary | |
---|---|
DOMHelper()
|
Method Summary | |
---|---|
static String |
domToString(Document document)
Serializes a Document to a String - without an Xml declaration |
static String |
domToString(Document document,
boolean withDeclaration)
Serializes a Document to a String - with/without an Xml declaration |
static String |
elementToString(Element element)
Serializes an Element to a String - without an Xml declaration |
static String |
elementToString(Element element,
boolean withDeclaration)
Serializes an Element to a String - with/without an Xml declaration |
static Document |
getDomFromResourceOnClassPath(String resource)
looks for file on classpath and parses it into a Document |
static Element |
getImmediateElement(Element element,
String elementName)
Returns immediate child element with given name - first only if > 1 |
static Collection |
getImmediateElements(Element element,
String elementName)
Returns immediate child elements with given name |
static String |
getText(Element element,
String elementName,
boolean nullable)
Assumes tag only occurs once and contains only text / CDATA If tag does not exist 'nullable' determines if an Exception is thrown |
static String |
getText(String elementName,
Document doc,
boolean nullable)
Assumes tag only occurs once and contains only text / CDATA If tag does not exist 'nullable' determines if an Exception is thrown |
static Document |
newDocument()
Convenience method so you can forget about DocumentBuilderFactory etc |
static Document |
newDocument(File file)
Convenience method so you can forget about DocumentBuilderFactory etc |
static Document |
newDocument(String str)
Convenience method so you can forget about DocumentBuilderFactory etc |
static String |
nodeToString(Node node)
Somewhat old method to turn org.w3c.dom.Node into a String |
static Document |
transform(Document doc,
String xsl)
|
static Document |
transform(Document doc,
String xsl,
Map parameters)
|
static void |
transform(String data,
File out,
String xsl)
Convenience method for transformations |
static void |
transform(String data,
File out,
String xsl,
Map parameters)
Convenience method for transformations |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMHelper()
Method Detail |
---|
public static String nodeToString(Node node) throws Exception
Exception
public static String domToString(Document document) throws Exception
Exception
public static String domToString(Document document, boolean withDeclaration) throws Exception
Exception
public static String elementToString(Element element) throws Exception
Exception
public static String elementToString(Element element, boolean withDeclaration) throws Exception
Exception
public static Document getDomFromResourceOnClassPath(String resource) throws Exception
Exception
public static String getText(String elementName, Document doc, boolean nullable) throws Exception
Exception
public static String getText(Element element, String elementName, boolean nullable) throws Exception
Exception
public static Collection getImmediateElements(Element element, String elementName) throws Exception
Exception
public static Element getImmediateElement(Element element, String elementName) throws Exception
Exception
public static Document newDocument() throws Exception
Exception
public static Document newDocument(String str) throws Exception
Exception
public static Document newDocument(File file) throws Exception
Exception
public static void transform(String data, File out, String xsl) throws Exception
Exception
public static void transform(String data, File out, String xsl, Map parameters) throws Exception
Exception
public static Document transform(Document doc, String xsl) throws Exception
Exception
public static Document transform(Document doc, String xsl, Map parameters) throws Exception
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |