构造器 | 说明 |
---|---|
XmlCoder() |
修饰符和类型 | 方法 | 说明 |
---|---|---|
static void |
encode(Thing thing,
OutputStream out) |
把指定的事物以XML编码到输出流中。
|
static void |
encode(Thing thing,
OutputStream out,
boolean includeDefaultValue) |
把指定的事物以XML编码到输出流中。
|
static String |
encodeToString(Thing thing) |
把事物编码成XML字符串。
|
static String |
encodeToString(Thing thing,
boolean includeDefaultValue) |
把事物编码成XML字符串。
|
static boolean |
isAttributeNode(Node node) |
具有换行的字符串可以保存到cdata下,如果节点不包含任何属性,并且子节点只有一个并且是CDATA,那么认为是属性:
<xxx><!
|
static void |
parse(Thing thing,
InputStream input) |
从输入流中读取事物。
|
static void |
parse(Thing thing,
String content) |
分析XML字符串。
|
static void |
parse(Thing thing,
Thing descriptor,
InputStream input) |
从输入流中读取事物。
|
static void |
parse(Thing thing,
Thing descriptor,
String content) |
分析XML字符串并返回事物。
|
static void |
parse(Thing thing,
Thing parentDescriptor,
Element element,
long lastModifyed) |
分析XML元素数据到事物中。
|
static void |
setLastModified(Thing thing,
long lastModified) |
public static String encodeToString(Thing thing)
thing
- 事物public static void encode(Thing thing, OutputStream out) throws XMLStreamException, IOException
thing
- 事物out
- 输出流XMLStreamException
- XML异常IOException
- IO异常public static String encodeToString(Thing thing, boolean includeDefaultValue)
thing
- 事物includeDefaultValue
- 是否包含默认值public static void encode(Thing thing, OutputStream out, boolean includeDefaultValue) throws XMLStreamException, IOException
thing
- 事物out
- 输出流includeDefaultValue
- 是否包含默认值XMLStreamException
- XML异常IOException
- IO异常public static void parse(Thing thing, String content) throws ParserConfigurationException, SAXException, IOException
thing
- 事物content
- 内容ParserConfigurationException
- 分析异常IOException
- IO异常SAXException
- XML异常public static void parse(Thing thing, Thing descriptor, String content) throws ParserConfigurationException, SAXException, IOException
thing
- 事物content
- 内容ParserConfigurationException
- 分析异常IOException
- IO异常SAXException
- XML异常public static void parse(Thing thing, InputStream input) throws SAXException, IOException, ParserConfigurationException
thing
- 事物input
- 输入流SAXException
- SAX异常IOException
- IO异常ParserConfigurationException
- 分析异常public static void parse(Thing thing, Thing descriptor, InputStream input) throws SAXException, IOException, ParserConfigurationException
thing
- 事物input
- 输入流SAXException
- SAX异常IOException
- IO异常ParserConfigurationException
- 分析异常public static void parse(Thing thing, Thing parentDescriptor, Element element, long lastModifyed)
thing
- 事物element
- 元素parentDescriptor
- 父描述者lastModifyed
- 最后修改日期public static boolean isAttributeNode(Node node)
node
- 节点public static void setLastModified(Thing thing, long lastModified)
Copyright © 2018 xworker.org. All rights reserved.