public class XMLPrintWriter
extends java.lang.Object
implements java.io.Serializable
限定符和类型 | 字段和说明 |
---|---|
protected static java.lang.String |
NEW_LINE |
static java.lang.String |
XML_ENCODER |
protected static java.lang.String |
XML_HEADER |
限定符和类型 | 方法和说明 |
---|---|
XMLPrintWriter |
attr(java.lang.String name,
boolean b)
属性
|
XMLPrintWriter |
attr(java.lang.String name,
double d)
属性
|
XMLPrintWriter |
attr(java.lang.String name,
float f)
属性
|
XMLPrintWriter |
attr(java.lang.String name,
int i)
属性
|
XMLPrintWriter |
attr(java.lang.String name,
long value)
属性
|
XMLPrintWriter |
attr(java.lang.String name,
java.lang.String value)
属性
|
XMLPrintWriter |
classAttr(java.lang.Class<?> clazz)
记录Class对象
|
XMLPrintWriter |
classAttr(java.lang.Class<?> clazz,
java.lang.String attrName) |
void |
close()
在xml结束时调用这个方法,有助于判断写的xml文件是否合法
|
static XMLPrintWriter |
create(java.io.OutputStream out)
创建PrintWriter
|
static XMLPrintWriter |
create(java.io.OutputStream out,
boolean wellFormatted)
创建Printer
|
static XMLPrintWriter |
create(java.io.PrintWriter writer)
创建
|
static XMLPrintWriter |
create(java.io.PrintWriter writer,
boolean wellFormatted)
创建Printer
|
static XMLPrintWriter |
create(java.io.Writer writer)
创建Printer
|
static XMLPrintWriter |
create(java.io.Writer writer,
boolean wellFormatted)
创建Printer
|
XMLPrintWriter |
end()
结束.
|
void |
flush()
清除.
|
XMLPrintWriter |
startTAG(java.lang.String tagName)
创建起始标签.
|
XMLPrintWriter |
textNode(java.lang.String data)
文本节点.
|
public static final java.lang.String XML_ENCODER
protected static final java.lang.String XML_HEADER
protected static final java.lang.String NEW_LINE
public static XMLPrintWriter create(java.io.OutputStream out)
out
- 输出流public static XMLPrintWriter create(java.io.OutputStream out, boolean wellFormatted)
out
- 输出流wellFormatted
- 是否格式过.public static XMLPrintWriter create(java.io.Writer writer)
writer
- 输出public static XMLPrintWriter create(java.io.Writer writer, boolean wellFormatted)
writer
- 输出wellFormatted
- 是否格式.public static XMLPrintWriter create(java.io.PrintWriter writer)
writer
- 输出public static XMLPrintWriter create(java.io.PrintWriter writer, boolean wellFormatted)
writer
- 输出wellFormatted
- 是否格式.public XMLPrintWriter startTAG(java.lang.String tagName)
tagName
- 标签名public XMLPrintWriter textNode(java.lang.String data)
data
- 数据public XMLPrintWriter attr(java.lang.String name, long value)
name
- 名字value
- 数据public XMLPrintWriter attr(java.lang.String name, boolean b)
name
- 名字b
- 数据public XMLPrintWriter attr(java.lang.String name, int i)
name
- 名字i
- 数据public XMLPrintWriter attr(java.lang.String name, float f)
name
- 名字f
- 数据public XMLPrintWriter attr(java.lang.String name, double d)
name
- 名字d
- 数据public XMLPrintWriter attr(java.lang.String name, java.lang.String value)
name
- 名字value
- 值public XMLPrintWriter classAttr(java.lang.Class<?> clazz)
public XMLPrintWriter classAttr(java.lang.Class<?> clazz, java.lang.String attrName)
public XMLPrintWriter end()
public void flush()
public void close()