|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jtheque.core.utils.file.XMLWriter
public final class XMLWriter
An XML writer.
Constructor Summary | |
---|---|
XMLWriter()
Construct a new XMLWriter. |
|
XMLWriter(java.lang.String root)
Construct a new XML writer. |
Method Summary | |
---|---|
void |
add(java.lang.String element)
Add the element to the document and set the new element as the current element. |
void |
add(java.lang.String element,
java.lang.String text)
Add an element to the document and set the new element as the current element. |
void |
addAttribute(java.lang.String key,
java.lang.String value)
Add an attribute to the current element. |
void |
addOnly(java.lang.String element,
java.lang.String text)
Add the element. |
org.jdom.Element |
getRoot()
Return the root element of the document. |
void |
setCurrent(org.jdom.Element element)
Set the current element. |
void |
switchToParent()
Switch to parent. |
void |
write(java.lang.String filepath)
Write the XML document to the file path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLWriter()
public XMLWriter(java.lang.String root)
root
- The name of the root element.Method Detail |
---|
public void add(java.lang.String element)
element
- The element to add.public void add(java.lang.String element, java.lang.String text)
element
- The name of the element to add.text
- The text of the element.public void addOnly(java.lang.String element, java.lang.String text)
element
- The name of the element.text
- The text of the element.public void addAttribute(java.lang.String key, java.lang.String value)
key
- The key of the attribute.value
- The value of the attribute.public org.jdom.Element getRoot()
public void setCurrent(org.jdom.Element element)
element
- The current element.public void write(java.lang.String filepath)
filepath
- The file path.public void switchToParent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |