public class XMLWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AMPERSAND_ENTITY |
static String |
APOSTROPHE_ENTITY |
static String |
GREATER_THAN_ENTITY |
static String |
LESS_THAN_ENTITY |
static String |
QUOTE_ENTITY |
| Constructor and Description |
|---|
XMLWriter(Writer writer) |
XMLWriter(Writer writer,
int indent) |
XMLWriter(Writer writer,
int indent,
String crlf) |
public static final String LESS_THAN_ENTITY
public static final String GREATER_THAN_ENTITY
public static final String AMPERSAND_ENTITY
public static final String APOSTROPHE_ENTITY
public static final String QUOTE_ENTITY
public XMLWriter(Writer writer)
public XMLWriter(Writer writer, int indent)
public void setEncoding(String encoding)
public String getEncoding()
public void putXmlns(String uri)
public void setIndent(int indent)
public int getIndent()
public void setCRLF(String crlf)
public String getCRLF()
public void setWriter(Writer writer)
public Writer getWriter()
public void setEmitHeader(boolean emitHeader)
public boolean isEmitHeader()
public void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic XMLWriter write(String text) throws IOException
IOExceptionpublic void indent(String text) throws IOException
IOExceptionpublic XMLWriter element(String name) throws IOException
IOExceptionpublic XMLWriter start() throws IOException
IOExceptionpublic XMLWriter end() throws IOException
IOExceptionpublic XMLWriter content(String text) throws IOException
IOExceptionpublic XMLWriter econtent(String text) throws IOException
IOExceptionpublic XMLWriter content(boolean value) throws IOException
IOExceptionpublic XMLWriter content(Date value) throws IOException
IOExceptionpublic XMLWriter text(String text) throws IOException
IOExceptionpublic XMLWriter etext(String text) throws IOException
IOExceptionpublic XMLWriter attr(String name, Object value) throws IOException
IOExceptionpublic XMLWriter eattr(String name, Object value) throws IOException
IOExceptionpublic XMLWriter xmlns(String value) throws IOException
IOExceptionpublic XMLWriter xmlns(String name, String value) throws IOException
IOExceptionpublic XMLWriter attr(String name) throws IOException
IOExceptionpublic XMLWriter string(String value) throws IOException
IOExceptionpublic XMLWriter object(Object value) throws IOException
IOExceptionpublic XMLWriter date(Date value) throws IOException
IOExceptionpublic XMLWriter integer(long value) throws IOException
IOExceptionpublic XMLWriter number(double value) throws IOException
IOExceptionpublic XMLWriter bool(String name, boolean value) throws IOException
IOExceptionpublic XMLWriter integer(String name, long value) throws IOException
IOExceptionpublic XMLWriter number(String name, double value) throws IOException
IOExceptionpublic XMLWriter date(String name, Date value) throws IOException
IOExceptionpublic XMLWriter element(QName name) throws IOException
IOExceptionpublic XMLWriter attr(QName name, Object value) throws IOException
IOExceptionpublic XMLWriter eattr(QName name, Object value) throws IOException
IOExceptionpublic XMLWriter attr(QName name) throws IOException
IOExceptionpublic XMLWriter bool(QName name, boolean value) throws IOException
IOExceptionpublic XMLWriter integer(QName name, long value) throws IOException
IOExceptionpublic XMLWriter number(QName name, double value) throws IOException
IOExceptionpublic XMLWriter date(QName name, Date value) throws IOException
IOExceptionpublic static final String escapeBodyValue(Object value)
Escape the toString of the given object. For use as body
text.
value - escape value.toString()Copyright © 2012 Nuxeo SA. All Rights Reserved.