|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
to.etc.util.IndentWriter
to.etc.xml.XmlWriter
public class XmlWriter
Small utility class to write formatted XML documents. This class writes it's data to a printstream. The stream is never closed. The data is formatted and nested appropriately by indenting tags. XML cdata is properly escaped (replacing < by < and the like.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
XmlWriter()
|
|
XmlWriter(java.io.Writer w)
|
Method Summary | |
---|---|
void |
attr(java.lang.String name,
java.lang.String value)
|
void |
cdata(java.lang.String s)
Writes string data. |
void |
close()
XMLWriters cannot be closed: ignore. |
void |
dumpBean(java.lang.Object o)
|
void |
init(java.io.Writer w,
int taglvl)
|
void |
tag(java.lang.String tn)
|
void |
tag(java.lang.String tn,
java.lang.String... attrvalueset)
|
void |
tag(java.lang.String tn,
java.lang.String attrs)
Writes a new XML tag. |
void |
tagendnl()
|
void |
tagfull(java.lang.String tn)
Writes a complete tag (open AND close) without attributes. |
void |
tagfull(java.lang.String tn,
boolean onoff)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
java.lang.Boolean onoff)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
java.util.Date dt)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
int val)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
long val)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
java.lang.Number val)
|
void |
tagfull(java.lang.String tn,
java.lang.String text)
Writes a tag, a #text content and the end tag on one line. |
void |
tagfull(java.lang.String tn,
java.lang.String attrs,
java.lang.String text)
Writes a tag with the given attributes, a #text content and the end tag on one line. |
void |
tagnl(java.lang.String tn,
java.lang.String... attrvalueset)
|
void |
tagonly(java.lang.String tn,
java.lang.String... attrvalueset)
Outputs a tag AND parameters ONLY, i.e. |
void |
tagonlynl(java.lang.String tn,
java.lang.String... attrvalueset)
|
void |
unclosed()
|
void |
wraw(java.lang.String s)
Writes data without replacing stuff; it does expand newlines to indent. |
void |
writeAttr(java.lang.String name,
java.lang.String value)
|
Methods inherited from class to.etc.util.IndentWriter |
---|
dec, flush, forceNewline, getStdoutWriter, getWriter, inc, indent, isIndentEnabled, print, println, println, setInd, setIndentEnabled, setSpacesPerIndent, write, write, writeRaw, writeRaw, writeRaw |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write |
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.io.Writer w)
Method Detail |
---|
public void init(java.io.Writer w, int taglvl)
init
in class IndentWriter
public void wraw(java.lang.String s) throws java.io.IOException
s
-
java.io.IOException
public void writeAttr(java.lang.String name, java.lang.String value) throws java.io.IOException
java.io.IOException
public void cdata(java.lang.String s) throws java.io.IOException
java.io.IOException
public void unclosed()
public void tag(java.lang.String tn, java.lang.String attrs) throws java.io.IOException
tn
- The tag name without bracesattrs
- attributes.
java.io.IOException
public void tagnl(java.lang.String tn, java.lang.String... attrvalueset) throws java.io.IOException
java.io.IOException
public void tag(java.lang.String tn, java.lang.String... attrvalueset) throws java.io.IOException
java.io.IOException
public void attr(java.lang.String name, java.lang.String value) throws java.io.IOException
java.io.IOException
public void tagonly(java.lang.String tn, java.lang.String... attrvalueset) throws java.io.IOException
tn
- attrvalueset
-
java.io.IOException
public void tagonlynl(java.lang.String tn, java.lang.String... attrvalueset) throws java.io.IOException
java.io.IOException
public void tag(java.lang.String tn) throws java.io.IOException
java.io.IOException
public void tagfull(java.lang.String tn) throws java.io.IOException
tag
-
java.io.IOException
public void tagfull(java.lang.String tn, java.lang.String text) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, java.util.Date dt) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, java.lang.String attrs, java.lang.String text) throws java.io.IOException
tag
- attrs
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, int val) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, long val) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, java.lang.Number val) throws java.io.IOException
java.io.IOException
public void tagfull(java.lang.String tn, boolean onoff) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagfull(java.lang.String tn, java.lang.Boolean onoff) throws java.io.IOException
tag
- text
-
java.io.IOException
public void tagendnl() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class IndentWriter
java.io.IOException
Closeable.close()
public void dumpBean(java.lang.Object o) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |