public class UtilXml extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UtilXml.LocalErrorHandler
Local error handler for entity resolver to DocumentBuilder parser.
|
static class |
UtilXml.LocalResolver
Local entity resolver to handle J2EE DTDs.
|
| Constructor and Description |
|---|
UtilXml() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
addChildElement(Element element,
String childElementName,
Document document)
Creates a child element with the given name and appends it to the element child node list.
|
static Element |
addChildElementCDATAValue(Element element,
String childElementName,
String childElementValue,
Document document)
Creates a child element with the given name and appends it to the element child node list.
|
static Element |
addChildElementValue(Element element,
String childElementName,
String childElementValue,
Document document)
Creates a child element with the given name and appends it to the element child node list.
|
static boolean |
checkBoolean(String str) |
static boolean |
checkBoolean(String str,
boolean defaultValue) |
static String |
checkEmpty(String string) |
static String |
checkEmpty(String string1,
String string2) |
static String |
checkEmpty(String string1,
String string2,
String string3) |
static List<Element> |
childElementList(Element element,
String childElementName)
Return a List of Element objects that have the given name and are
immediate children of the given element; if name is null, all child
elements will be included.
|
static String |
childElementValue(Element element,
String childElementName)
Return the text (node value) contained by the named child node.
|
static String |
childElementValue(Element element,
String childElementName,
String defaultValue)
Return the text (node value) contained by the named child node or a default value if null.
|
static String |
elementValue(Element element)
Return the text (node value) of the first node under this, works best if normalized.
|
static Element |
firstChildElement(Element element,
String childElementName)
Return the first child Element with the given name; if name is null
returns the first element.
|
static Element |
firstChildElement(Element element,
String childElementName,
String attrName,
String attrValue)
Return the first child Element with the given name; if name is null
returns the first element.
|
static Document |
makeEmptyXmlDocument() |
static Document |
makeEmptyXmlDocument(String rootElementName) |
static Document |
readXmlDocument(InputStream is) |
static Document |
readXmlDocument(InputStream is,
boolean validate,
String docDescription) |
static Document |
readXmlDocument(String content) |
static Document |
readXmlDocument(String content,
boolean validate) |
static Document |
readXmlDocument(URL url) |
static Document |
readXmlDocument(URL url,
boolean validate) |
static String |
writeXmlDocument(Document document) |
static void |
writeXmlDocument(OutputStream os,
Document document) |
static void |
writeXmlDocument(String filename,
Document document) |
public static final String module
public static String writeXmlDocument(Document document) throws IOException
IOExceptionpublic static void writeXmlDocument(String filename, Document document) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic static void writeXmlDocument(OutputStream os, Document document) throws IOException
IOExceptionpublic static Document readXmlDocument(String content) throws SAXException, ParserConfigurationException, IOException
public static Document readXmlDocument(String content, boolean validate) throws SAXException, ParserConfigurationException, IOException
public static Document readXmlDocument(URL url) throws SAXException, ParserConfigurationException, IOException
public static Document readXmlDocument(URL url, boolean validate) throws SAXException, ParserConfigurationException, IOException
public static Document readXmlDocument(InputStream is) throws SAXException, ParserConfigurationException, IOException
public static Document readXmlDocument(InputStream is, boolean validate, String docDescription) throws SAXException, ParserConfigurationException, IOException
public static Document makeEmptyXmlDocument()
public static Element addChildElement(Element element, String childElementName, Document document)
public static Element addChildElementValue(Element element, String childElementName, String childElementValue, Document document)
public static Element addChildElementCDATAValue(Element element, String childElementName, String childElementValue, Document document)
public static List<Element> childElementList(Element element, String childElementName)
public static Element firstChildElement(Element element, String childElementName)
public static Element firstChildElement(Element element, String childElementName, String attrName, String attrValue)
public static String childElementValue(Element element, String childElementName)
public static String childElementValue(Element element, String childElementName, String defaultValue)
public static String elementValue(Element element)
public static boolean checkBoolean(String str)
public static boolean checkBoolean(String str, boolean defaultValue)
Copyright © 2024 Atlassian. All rights reserved.