|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgoldengate.common.xml.XmlUtil
public class XmlUtil

XML utility that handles simple cases as:
| Constructor Summary | |
|---|---|
XmlUtil()
|
|
| Method Summary | |
|---|---|
static org.dom4j.Element |
addAndGetElementMultiple(org.dom4j.Document doc,
String path)
Add an element given by the path relative to the document |
static org.dom4j.Element |
addAndGetElementMultiple(org.dom4j.Element ref,
String path)
Add an element given by the path relative to the referent element |
static org.dom4j.Element |
addAndSetElementMultiple(org.dom4j.Document doc,
String path,
String value)
Add an element given by the path relative to the document and set the value |
static org.dom4j.Element |
addAndSetElementMultiple(org.dom4j.Element ref,
String path,
String value)
Add an element given by the path relative to the referent element and set the value |
static org.dom4j.Element |
addOrGetElement(org.dom4j.Document doc,
String path)
Add or Get (if already existing) an element given by the path relative to the document |
static org.dom4j.Element |
addOrGetElement(org.dom4j.Element ref,
String path)
Add or Get (if already existing) an element given by the path relative to the referent element |
static org.dom4j.Element |
addOrSetElement(org.dom4j.Document doc,
String path,
String value)
Add or Get (if already existing) an element given by the path relative to the document and set the value |
static org.dom4j.Element |
addOrSetElement(org.dom4j.Element ref,
String path,
String value)
Add or Get (if already existing) an element given by the path relative to the referent element and set the value |
static org.dom4j.Document |
createEmptyDocument()
|
static org.dom4j.Document |
getDocument(File file)
|
static org.dom4j.Document |
getDocument(String filename)
|
static org.dom4j.Element |
getElement(org.dom4j.Document doc,
String path)
|
static org.dom4j.Element |
getElement(org.dom4j.Element ref,
String path)
|
static List<org.dom4j.Element> |
getElementMultiple(org.dom4j.Document doc,
String path)
|
static List<org.dom4j.Element> |
getElementMultiple(org.dom4j.Element ref,
String path)
|
static org.dom4j.Element |
getParentElement(org.dom4j.Document doc,
String path)
|
static org.dom4j.Element |
getParentElement(org.dom4j.Element ref,
String path)
|
static org.dom4j.Element |
getRootElement(org.dom4j.Document document)
|
static void |
main(String[] args)
Example (run test) |
static XmlValue[] |
read(org.dom4j.Document doc,
XmlDecl[] decls)
Create the XmlValues from the XmlDevls and the Document |
static XmlValue[] |
read(org.dom4j.Element ref,
XmlDecl[] decls)
Create the XmlValues from the XmlDevls and the reference Element |
static org.dom4j.Document |
readDocument(String document)
Read the document from the string |
static void |
saveDocument(File file,
org.dom4j.Document document)
Save the document into the file |
static void |
saveDocument(String filename,
org.dom4j.Document document)
Save the document into the file |
static void |
saveElement(File file,
org.dom4j.Element element)
Save the branch from element into the file |
static void |
saveElement(String filename,
org.dom4j.Element element)
Save the branch from element into the file |
static void |
write(org.dom4j.Document doc,
XmlValue[] values)
Add all nodes from XmlValues into Document |
static void |
write(org.dom4j.Element ref,
XmlValue[] values)
Add all nodes from XmlValues from the referenced Element |
static String |
writeToString(org.dom4j.Document document)
|
static String |
writeToString(org.dom4j.Element element)
|
static void |
writeXML(String filename,
String encoding,
org.dom4j.Document document)
Write the given XML document to filename using the encoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlUtil()
| Method Detail |
|---|
public static org.dom4j.Document getDocument(String filename)
throws IOException,
org.dom4j.DocumentException
filename -
IOException
org.dom4j.DocumentException
public static org.dom4j.Document getDocument(File file)
throws IOException,
org.dom4j.DocumentException
file -
IOException
org.dom4j.DocumentException
public static org.dom4j.Document readDocument(String document)
throws org.dom4j.DocumentException
document - as String
org.dom4j.DocumentExceptionpublic static String writeToString(org.dom4j.Document document)
document -
public static String writeToString(org.dom4j.Element element)
element -
public static org.dom4j.Document createEmptyDocument()
public static void saveDocument(String filename,
org.dom4j.Document document)
throws IOException
filename - document -
IOException
public static void saveDocument(File file,
org.dom4j.Document document)
throws IOException
file - document -
IOException
public static void saveElement(String filename,
org.dom4j.Element element)
throws IOException
filename - element -
IOException
public static void saveElement(File file,
org.dom4j.Element element)
throws IOException
file - element -
IOExceptionpublic static org.dom4j.Element getRootElement(org.dom4j.Document document)
document -
public static org.dom4j.Element addOrSetElement(org.dom4j.Element ref,
String path,
String value)
ref - path - value -
public static org.dom4j.Element addOrGetElement(org.dom4j.Element ref,
String path)
ref - path -
public static org.dom4j.Element addAndSetElementMultiple(org.dom4j.Element ref,
String path,
String value)
ref - path - value -
public static org.dom4j.Element addAndGetElementMultiple(org.dom4j.Element ref,
String path)
ref - path -
public static org.dom4j.Element getParentElement(org.dom4j.Element ref,
String path)
throws org.dom4j.DocumentException
ref - path -
org.dom4j.DocumentException
public static org.dom4j.Element getElement(org.dom4j.Element ref,
String path)
throws org.dom4j.DocumentException
ref - path -
org.dom4j.DocumentException
public static List<org.dom4j.Element> getElementMultiple(org.dom4j.Element ref,
String path)
throws org.dom4j.DocumentException
ref - path -
org.dom4j.DocumentException
public static org.dom4j.Element addOrSetElement(org.dom4j.Document doc,
String path,
String value)
doc - path - value -
public static org.dom4j.Element addOrGetElement(org.dom4j.Document doc,
String path)
doc - path -
public static org.dom4j.Element addAndSetElementMultiple(org.dom4j.Document doc,
String path,
String value)
doc - path - value -
public static org.dom4j.Element addAndGetElementMultiple(org.dom4j.Document doc,
String path)
doc - path -
public static org.dom4j.Element getParentElement(org.dom4j.Document doc,
String path)
throws org.dom4j.DocumentException
doc - path -
org.dom4j.DocumentException
public static org.dom4j.Element getElement(org.dom4j.Document doc,
String path)
throws org.dom4j.DocumentException
doc - path -
org.dom4j.DocumentException
public static List<org.dom4j.Element> getElementMultiple(org.dom4j.Document doc,
String path)
throws org.dom4j.DocumentException
doc - path -
org.dom4j.DocumentException
public static XmlValue[] read(org.dom4j.Document doc,
XmlDecl[] decls)
doc - decls -
public static XmlValue[] read(org.dom4j.Element ref,
XmlDecl[] decls)
ref - decls -
public static void write(org.dom4j.Document doc,
XmlValue[] values)
doc - values -
public static void write(org.dom4j.Element ref,
XmlValue[] values)
ref - values - public static void main(String[] args)
args -
public static void writeXML(String filename,
String encoding,
org.dom4j.Document document)
throws IOException
filename - encoding - if null, default encoding ISO-8859-1 will be useddocument -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||