- java.lang.Object
-
- org.redkale.util.XmlReader
-
public class XmlReader extends Object
简单的xml读取器, 只读element节点信息,其他信息(如: namespace、comment、docdecl等)都会丢弃详情见: https://redkale.org
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected BinaryOperator<String>
attrFunc
protected int
columnNumber
protected int
lineNumber
protected int
position
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 XmlReader
attrFunc(BinaryOperator<String> func)
protected void
backChar(char ch)
回退最后读取的字符protected static String
escape(String value)
protected RedkaleException
newException(String msg)
protected RedkaleException
newException(String msg, Throwable chain)
protected char
nextChar()
读取下一个字符, 不跳过空白字符protected char
nextGoodChar()
跳过空白字符, 返回一个非空白字符AnyValue
read()
protected void
readCDSect(AnyValueWriter root, ByteArray array)
protected void
readComment()
protected void
readDocdecl(AnyValueWriter root, ByteArray array)
protected String
readEndTag()
protected void
readStartTag(AnyValueWriter root)
protected boolean
readTagAttribute(String tag, AnyValueWriter config)
protected void
readXmlDecl(AnyValueWriter root, ByteArray array)
-
-
-
字段详细资料
-
position
protected int position
-
lineNumber
protected int lineNumber
-
columnNumber
protected int columnNumber
-
attrFunc
protected BinaryOperator<String> attrFunc
-
-
构造器详细资料
-
XmlReader
public XmlReader(String text)
-
XmlReader
public XmlReader(char[] text)
-
XmlReader
public XmlReader(char[] text, int start, int len)
-
-
方法详细资料
-
attrFunc
public XmlReader attrFunc(BinaryOperator<String> func)
-
read
public AnyValue read()
-
nextChar
protected char nextChar()
读取下一个字符, 不跳过空白字符- 返回:
- 空白字符或有效字符
-
nextGoodChar
protected char nextGoodChar()
跳过空白字符, 返回一个非空白字符- 返回:
- 有效字符
-
backChar
protected void backChar(char ch)
回退最后读取的字符- 参数:
ch
- 后退的字符
-
readTagAttribute
protected boolean readTagAttribute(String tag, AnyValueWriter config)
-
readStartTag
protected void readStartTag(AnyValueWriter root)
-
readEndTag
protected String readEndTag()
-
readComment
protected void readComment()
-
readDocdecl
protected void readDocdecl(AnyValueWriter root, ByteArray array)
-
readCDSect
protected void readCDSect(AnyValueWriter root, ByteArray array)
-
readXmlDecl
protected void readXmlDecl(AnyValueWriter root, ByteArray array)
-
newException
protected RedkaleException newException(String msg)
-
newException
protected RedkaleException newException(String msg, Throwable chain)
-
-