|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
uxparser.XWriter
public class XWriter
XWriter is a specialized Writer that provides support for generating an XML output stream.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
XWriter(java.io.File file)
Construct writer for specified file. |
|
XWriter(java.io.OutputStream out)
Construct writer for specified output stream. |
Method Summary | |
---|---|
XWriter |
attr(java.lang.String name,
java.lang.String value)
Write an attribute pair name="value"
where the value is written using safe(). |
void |
close()
|
void |
flush()
|
XWriter |
indent(int indent)
Write the specified number of spaces. |
boolean |
isZipped()
Return if this XWriter is being used to generate a PKZIP file containing the XML document. |
XWriter |
nl()
Write a newline character and return this. |
XWriter |
prolog()
This write the standard prolog <?xml version="1.0" encoding="UTF-8"?> |
XWriter |
safe(int c,
boolean escapeWhitespace)
Convenience for XWriter.safe(this, c, escapeWhitespace) . |
XWriter |
safe(java.lang.String s)
Convenience for XWriter.safe(this, s, true) . |
XWriter |
safe(java.lang.String s,
boolean escapeWhitespace)
Convenience for XWriter.safe(this, s, escapeWhitespace) . |
static void |
safe(java.io.Writer out,
int c,
boolean escapeWhitespace)
Write a "safe" character. |
static void |
safe(java.io.Writer out,
java.lang.String s,
boolean escapeWhitespace)
This writes each character in the string to the output stream using the safe(Writer, int, boolean) method. |
void |
setZipped(boolean zipped)
If set to true, then XWriter generates a compressed PKZIP file with one entry called "file.xml". |
XWriter |
w(boolean x)
Write the specified boolean and return this. |
XWriter |
w(char x)
Write the specified char and return this. |
XWriter |
w(double x)
Write the specified double and return this. |
XWriter |
w(float x)
Write the specified float and return this. |
XWriter |
w(int x)
Write the specified int and return this. |
XWriter |
w(long x)
Write the specified long and return this. |
XWriter |
w(java.lang.Object x)
Write the specified Object and return this. |
void |
write(char[] buf)
|
void |
write(char[] buf,
int off,
int len)
|
void |
write(int c)
|
void |
write(java.lang.String str)
|
void |
write(java.lang.String str,
int off,
int len)
|
Methods inherited from class java.io.Writer |
---|
append, append, append |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XWriter(java.io.File file) throws java.io.IOException
java.io.IOException
public XWriter(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public XWriter w(java.lang.Object x)
public final XWriter w(boolean x)
public final XWriter w(char x)
public final XWriter w(int x)
public final XWriter w(long x)
public final XWriter w(float x)
public final XWriter w(double x)
public final XWriter nl()
public final XWriter indent(int indent)
public final XWriter attr(java.lang.String name, java.lang.String value)
name="value"
where the value is written using safe().
public XWriter prolog()
<?xml version="1.0" encoding="UTF-8"?>
public final XWriter safe(java.lang.String s, boolean escapeWhitespace)
XWriter.safe(this, s, escapeWhitespace)
.
public final XWriter safe(java.lang.String s)
XWriter.safe(this, s, true)
.
public final XWriter safe(int c, boolean escapeWhitespace)
XWriter.safe(this, c, escapeWhitespace)
.
public static void safe(java.io.Writer out, java.lang.String s, boolean escapeWhitespace) throws java.io.IOException
safe(Writer, int, boolean)
method.
java.io.IOException
public static void safe(java.io.Writer out, int c, boolean escapeWhitespace) throws java.io.IOException
java.io.IOException
public boolean isZipped()
setZipped()
public void setZipped(boolean zipped) throws java.io.IOException
java.io.IOException
public void write(int c)
write
in class java.io.Writer
public void write(char[] buf)
write
in class java.io.Writer
public void write(char[] buf, int off, int len)
write
in class java.io.Writer
public void write(java.lang.String str)
write
in class java.io.Writer
public void write(java.lang.String str, int off, int len)
write
in class java.io.Writer
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
public void close()
close
in interface java.io.Closeable
close
in class java.io.Writer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |