|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.util.XMLUtil
public class XMLUtil
A set of XML utility functions that make use of the Dom4j package. This class originally existed as a means of accomplishing much of what Dom4j now allows us to do. As such, the expectation is that it will be phased out over time.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
logger
The logger. |
Constructor Summary | |
---|---|
XMLUtil()
|
Method Summary | |
---|---|
static void |
addChildValue(org.dom4j.Element parent,
String childName,
String childValue)
Adds the child value. |
static String |
getAttribute(org.dom4j.Element element,
String attributeName)
Gets an attribute from the given element with the given attribute name |
static org.dom4j.Element |
getChild(org.dom4j.Element parent,
String name)
Gets the child. |
static List |
getChildren(org.dom4j.Element element)
Gets the children. |
static List |
getChildren(org.dom4j.Element element,
String name)
Gets the children. |
static String |
getChildValue(org.dom4j.Element element,
String name)
Gets the child value. |
static String |
getDocumentChildValue(org.dom4j.Document d,
String name)
Gets the document child value. |
static String |
getValue(org.dom4j.Element element)
Gets the value. |
static org.dom4j.Document |
parse(InputStream stream)
Parses the given stream to an XML document (in UTF-8 format). |
static org.dom4j.Document |
parse(String xml)
Parses the. |
static void |
setChildValue(org.dom4j.Element element,
String name,
String value)
Sets the child value. |
static void |
setDocumentChildValue(org.dom4j.Document d,
String name,
String value)
Sets the document child value. |
static void |
setValue(org.dom4j.Element element,
String value)
Sets the value. |
static String |
toXML(org.dom4j.Document document)
Converts the document to XML. |
static String |
toXML(org.dom4j.Document document,
boolean pretty)
Converts the document to XML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log logger
Constructor Detail |
---|
public XMLUtil()
Method Detail |
---|
public static void addChildValue(org.dom4j.Element parent, String childName, String childValue)
parent
- the parentchildName
- the child namechildValue
- the child valuepublic static org.dom4j.Element getChild(org.dom4j.Element parent, String name)
parent
- the parentname
- the name
public static String getValue(org.dom4j.Element element)
element
- the element
public static void setValue(org.dom4j.Element element, String value)
element
- the elementvalue
- the valuepublic static String getChildValue(org.dom4j.Element element, String name)
element
- the elementname
- the name
public static void setChildValue(org.dom4j.Element element, String name, String value)
element
- the elementname
- the namevalue
- the valuepublic static List getChildren(org.dom4j.Element element)
element
- the element
public static List getChildren(org.dom4j.Element element, String name)
element
- the elementname
- the name
public static String getAttribute(org.dom4j.Element element, String attributeName)
element
- the elementattributeName
- the attribute name
public static String getDocumentChildValue(org.dom4j.Document d, String name)
d
- the dname
- the name
public static void setDocumentChildValue(org.dom4j.Document d, String name, String value) throws Exception
d
- the dname
- the namevalue
- the value
Exception
- the exceptionpublic static org.dom4j.Document parse(String xml) throws org.dom4j.DocumentException
xml
- the xml
org.dom4j.DocumentException
- the document exceptionpublic static org.dom4j.Document parse(InputStream stream) throws org.dom4j.DocumentException, IOException
stream
- the stream
org.dom4j.DocumentException
- the document exception
IOException
- Signals that an I/O exception has occurred.public static String toXML(org.dom4j.Document document)
document
- the document
public static String toXML(org.dom4j.Document document, boolean pretty)
document
- the documentpretty
- whether to produce human readable XML
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |