public class XMLableReader
extends java.lang.Object
XMLReadable
限定符和类型 | 字段和说明 |
---|---|
boolean |
ckeckBlankContent |
构造器和说明 |
---|
XMLableReader(com.fr.third.javax.xml.stream.XMLEventReader xmlEventReader,
com.fr.third.javax.xml.stream.events.StartElement startElement) |
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
cdataDecode(java.lang.String data) |
void |
close() |
static XMLableReader |
createXMLableReader(java.io.Reader inputStreamReader) |
static XMLableReader |
createXMLableReader(java.lang.String xml) |
boolean |
getAttrAsBoolean(java.lang.String attrName,
boolean defaultValue) |
byte |
getAttrAsByte(java.lang.String attrName,
byte defaultValue) |
java.lang.Class<?> |
getAttrAsClass()
读xml的class属性
|
java.lang.Class<?> |
getAttrAsClass(ClassNameParser parser) |
java.lang.Class<?> |
getAttrAsClass(java.lang.String attrName) |
java.lang.Class<?> |
getAttrAsClass(java.lang.String classAttrName,
ClassNameParser parser) |
java.awt.Color |
getAttrAsColor(java.lang.String attrName,
java.awt.Color defaultValue) |
double |
getAttrAsDouble(java.lang.String attrName,
double defaultValue) |
float |
getAttrAsFloat(java.lang.String attrName,
float defaultValue) |
int |
getAttrAsInt(java.lang.String attrName,
int defaultValue) |
long |
getAttrAsLong(java.lang.String attrName,
long defaultValue) |
java.lang.String |
getAttrAsString(java.lang.String attrName,
java.lang.String defaultValue)
得到当前节点的某个属性
|
java.util.Map<java.lang.String,java.lang.String> |
getAttrs()
迭代当前节点的属性
|
java.lang.String |
getContent()
配合isCharacters()使用,用来读取文本
|
java.lang.Object |
getContextAttribute(java.lang.Object key) |
int |
getDeep() |
java.lang.String |
getElementValue()
当一个元素的子节点中没有元素,只有文本时,可以调用这个方法
|
java.lang.String |
getTagName()
得到当前节点的名字
|
com.fr.third.javax.xml.stream.XMLEventReader |
getXMLEventReader() |
XMLVersion |
getXMLVersion() |
boolean |
isAttr()
读取Attribute,同时还可以做一些预处理
|
boolean |
isCharacters()
判断某个子节点是否是文本
|
boolean |
isChildNode()
判断某个子节点是否是Element
|
java.lang.Object |
readXMLObject(XMLReadable xmlObject)
读取XML生成某个对象XMLObject
这个方法在调用前应该触发event : StartElement,同时用XML_TAG来判断
该用哪个XMLObject作为参数传进来,从某种程度上来说XMLObject像个Visitor.
|
void |
removeContextAttribute(java.lang.Object key) |
void |
setContextAttribute(java.lang.Object key,
java.lang.Object v) |
void |
setXMLEventReader(com.fr.third.javax.xml.stream.XMLEventReader xmlEventReader) |
void |
setXmlVersion(long xmlVersion) |
void |
setXmlVersionByString(java.lang.String xmlVersion) |
public XMLableReader(com.fr.third.javax.xml.stream.XMLEventReader xmlEventReader, com.fr.third.javax.xml.stream.events.StartElement startElement)
public static XMLableReader createXMLableReader(java.lang.String xml) throws com.fr.third.javax.xml.stream.XMLStreamException
com.fr.third.javax.xml.stream.XMLStreamException
public static XMLableReader createXMLableReader(java.io.Reader inputStreamReader) throws com.fr.third.javax.xml.stream.XMLStreamException
com.fr.third.javax.xml.stream.XMLStreamException
public int getDeep()
public void setXmlVersionByString(java.lang.String xmlVersion)
public void setXmlVersion(long xmlVersion)
public XMLVersion getXMLVersion()
public void setContextAttribute(java.lang.Object key, java.lang.Object v)
public void removeContextAttribute(java.lang.Object key)
public java.lang.Object getContextAttribute(java.lang.Object key)
public void setXMLEventReader(com.fr.third.javax.xml.stream.XMLEventReader xmlEventReader)
public com.fr.third.javax.xml.stream.XMLEventReader getXMLEventReader()
public java.lang.String getTagName()
public java.lang.String cdataDecode(java.lang.String data)
public java.lang.String getElementValue()
XMLEventReader.getElementText()
public boolean isAttr()
public boolean isCharacters()
public boolean isChildNode()
public java.util.Map<java.lang.String,java.lang.String> getAttrs()
public java.lang.String getAttrAsString(java.lang.String attrName, java.lang.String defaultValue)
attrName
- public int getAttrAsInt(java.lang.String attrName, int defaultValue)
public long getAttrAsLong(java.lang.String attrName, long defaultValue)
public float getAttrAsFloat(java.lang.String attrName, float defaultValue)
public double getAttrAsDouble(java.lang.String attrName, double defaultValue)
public byte getAttrAsByte(java.lang.String attrName, byte defaultValue)
public boolean getAttrAsBoolean(java.lang.String attrName, boolean defaultValue)
public java.awt.Color getAttrAsColor(java.lang.String attrName, java.awt.Color defaultValue)
public java.lang.Class<?> getAttrAsClass() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.Class<?> getAttrAsClass(java.lang.String attrName) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.Class<?> getAttrAsClass(ClassNameParser parser) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.Class<?> getAttrAsClass(java.lang.String classAttrName, ClassNameParser parser) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.String getContent()
public java.lang.Object readXMLObject(XMLReadable xmlObject)
xmlObject
- public void close() throws com.fr.third.javax.xml.stream.XMLStreamException
com.fr.third.javax.xml.stream.XMLStreamException