|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jagatoo.util.xml.SimpleXMLWriter
public class SimpleXMLWriter
Writes XML data.
This class simply wrapps an inverted SAX parser to generate valid XML.
Constructor Summary | |
---|---|
|
SimpleXMLWriter(java.io.File file)
Parses the given file. |
|
SimpleXMLWriter(java.io.File file,
java.nio.charset.Charset charset)
Parses the given file. |
|
SimpleXMLWriter(java.io.File file,
java.lang.String charset)
Parses the given file. |
|
SimpleXMLWriter(java.io.OutputStream out)
Parses the given file. |
|
SimpleXMLWriter(java.io.OutputStream out,
java.nio.charset.Charset charset)
Parses the given file. |
|
SimpleXMLWriter(java.io.OutputStream out,
java.lang.String charset)
Parses the given file. |
protected |
SimpleXMLWriter(java.io.OutputStream out,
java.lang.String codepage,
java.nio.charset.Charset charset)
|
|
SimpleXMLWriter(java.lang.String filename)
Parses the given file. |
|
SimpleXMLWriter(java.lang.String filename,
java.nio.charset.Charset charset)
Parses the given file. |
|
SimpleXMLWriter(java.lang.String filename,
java.lang.String charset)
Parses the given file. |
Method Summary | |
---|---|
void |
close()
|
protected void |
finalize()
|
boolean |
getAddNewLines()
|
int |
getLevel()
|
XMLPath |
getPath()
|
protected java.lang.Object |
getPathObject(int level,
java.lang.String element)
Converts the passed element to a path element. |
boolean |
getUseTabsForIndentation()
|
protected void |
newLine()
|
void |
popElement()
Pops the level hierarchy one level up. |
void |
setAddNewLines(boolean addNewLines)
|
void |
setIndentation(int indent)
|
void |
setIndentation(int indent,
boolean useTabs)
|
protected void |
writeElement(boolean push,
java.lang.String name,
java.lang.Object[] attributes)
Writes an XML element to the file. |
void |
writeElement(java.lang.String name,
java.lang.Object... attributes)
Writes an XML element to the file. |
void |
writeElementAndPush(java.lang.String name,
java.lang.Object... attributes)
Writes an XML element to the file and pushes one level down, so that succeeding elements become children of this. |
protected void |
writeElementData(java.lang.String data)
Writes element data into the last started element. |
void |
writeElementWithData(java.lang.String name,
java.lang.String data,
java.lang.Object... attributes)
Writes an XML element to the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SimpleXMLWriter(java.io.OutputStream out, java.lang.String codepage, java.nio.charset.Charset charset) throws java.io.IOException
out
- codepage
- charset
-
java.io.IOException
public SimpleXMLWriter(java.io.OutputStream out, java.lang.String charset) throws java.io.IOException
out
- charset
-
java.io.IOException
public SimpleXMLWriter(java.io.OutputStream out, java.nio.charset.Charset charset) throws java.io.IOException
out
- charset
-
java.io.IOException
public SimpleXMLWriter(java.io.OutputStream out) throws java.io.IOException
out
-
java.io.IOException
public SimpleXMLWriter(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- charset
-
java.io.IOException
public SimpleXMLWriter(java.io.File file, java.nio.charset.Charset charset) throws java.io.IOException
file
- charset
-
java.io.IOException
public SimpleXMLWriter(java.io.File file) throws java.io.IOException
file
-
java.io.IOException
public SimpleXMLWriter(java.lang.String filename, java.lang.String charset) throws java.io.IOException
filename
- charset
-
java.io.IOException
public SimpleXMLWriter(java.lang.String filename, java.nio.charset.Charset charset) throws java.io.IOException
filename
- charset
-
java.io.IOException
public SimpleXMLWriter(java.lang.String filename) throws java.io.IOException
filename
-
java.io.IOException
Method Detail |
---|
public void setIndentation(int indent, boolean useTabs)
public final void setIndentation(int indent)
public final boolean getUseTabsForIndentation()
public void setAddNewLines(boolean addNewLines)
public final boolean getAddNewLines()
public final XMLPath getPath()
public final int getLevel()
protected void newLine() throws java.io.IOException
java.io.IOException
protected java.lang.Object getPathObject(int level, java.lang.String element)
level
- element
-
protected void writeElement(boolean push, java.lang.String name, java.lang.Object[] attributes) throws java.io.IOException, org.xml.sax.SAXException
push
- push element hierarchy one level down?name
- the element's nameattributes
- the attributes (attribName1, attribValue1, attribName2, attribValue2, ...)
java.io.IOException
org.xml.sax.SAXException
public final void writeElement(java.lang.String name, java.lang.Object... attributes) throws java.io.IOException, org.xml.sax.SAXException
name
- the element's nameattributes
- the attributes (attribName1, attribValue1, attribName2, attribValue2, ...)
java.io.IOException
org.xml.sax.SAXException
public final void writeElementWithData(java.lang.String name, java.lang.String data, java.lang.Object... attributes) throws java.io.IOException, org.xml.sax.SAXException
name
- the element's namedata
- attributes
- the attributes (attribName1, attribValue1, attribName2, attribValue2, ...)
java.io.IOException
org.xml.sax.SAXException
public final void writeElementAndPush(java.lang.String name, java.lang.Object... attributes) throws java.io.IOException, org.xml.sax.SAXException
name
- the element's nameattributes
- the attributes (attribName1, attribValue1, attribName2, attribValue2, ...)
java.io.IOException
org.xml.sax.SAXException
protected void writeElementData(java.lang.String data) throws java.io.IOException, org.xml.sax.SAXException
data
-
java.io.IOException
org.xml.sax.SAXException
public void popElement() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void close() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |