|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.wvtool.external.XmlReader
public class XmlReader
A minimalistic XML pull parser, similar to kXML, but not supporting namespaces or legacy events. If you need support for namespaces, or access to XML comments or processing instructions, please use kXML(2) instead.
Field Summary | |
---|---|
private int |
attributeCount
|
private java.lang.String[] |
attributes
|
static int |
CDSECT
|
private int |
column
|
private boolean |
degenerated
|
private int |
depth
|
private java.lang.String[] |
elementStack
|
static int |
END_DOCUMENT
Signal logical end of xml document |
static int |
END_TAG
End tag was just read |
(package private) static int |
ENTITY_REF
|
private java.util.Hashtable |
entityMap
|
private boolean |
eof
|
private boolean |
isWhitespace
|
private static int |
LEGACY
|
private int |
line
|
private java.lang.String |
name
|
private int |
peek0
|
private int |
peek1
|
private java.io.Reader |
reader
|
boolean |
relaxed
|
private char[] |
srcBuf
|
private int |
srcCount
|
private int |
srcPos
|
static int |
START_DOCUMENT
Return value of getType before first call to next() |
static int |
START_TAG
Start tag was just read |
private java.lang.String |
text
|
static int |
TEXT
Text was just read |
private char[] |
txtBuf
|
private int |
txtPos
|
private int |
type
|
private java.lang.String[] |
TYPES
|
private static java.lang.String |
UNEXPECTED_EOF
|
Constructor Summary | |
---|---|
XmlReader(java.io.Reader reader)
|
Method Summary | |
---|---|
void |
defineCharacterEntity(java.lang.String entity,
java.lang.String value)
|
private static java.lang.String[] |
ensureCapacity(java.lang.String[] arr,
int required)
|
private void |
exception(java.lang.String desc)
|
int |
getAttributeCount()
|
java.lang.String |
getAttributeName(int index)
|
java.lang.String |
getAttributeValue(int index)
|
java.lang.String |
getAttributeValue(java.lang.String name)
|
int |
getColumnNumber()
|
int |
getDepth()
|
int |
getLineNumber()
|
java.lang.String |
getName()
|
java.lang.String |
getPositionDescription()
|
java.lang.String |
getText()
|
int |
getType()
|
boolean |
isEmptyElementTag()
|
boolean |
isWhitespace()
|
int |
next()
|
private void |
parseDoctype()
precondition: |
private void |
parseEndTag()
|
private void |
parseLegacy(boolean push)
|
private void |
parseStartTag()
Sets name and attributes |
private int |
peekType()
|
private java.lang.String |
pop(int pos)
|
private void |
push(int c)
|
boolean |
pushEntity()
result: isWhitespace; if the setName parameter is set, the name of the entity is stored in "name" |
private boolean |
pushText(int delimiter)
types: '< parse="parse" to="to" any="any" token="token" (for="(for" nextToken="nextToken" (="(" )=")" '="'" "='"' ="':" quote="quote" whitespace="whitespace" or="or">'> |
private int |
read()
|
private void |
read(char c)
|
private java.lang.String |
readName()
|
java.lang.String |
readText()
If the current event is text, the value of getText is returned and next() is called. |
void |
require(int type,
java.lang.String name)
test if the current event is of the given type and if the name do match. |
private void |
skip()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int START_DOCUMENT
public static final int END_DOCUMENT
public static final int START_TAG
public static final int END_TAG
public static final int TEXT
public static final int CDSECT
static final int ENTITY_REF
private static final java.lang.String UNEXPECTED_EOF
private static final int LEGACY
public boolean relaxed
private java.util.Hashtable entityMap
private int depth
private java.lang.String[] elementStack
private java.io.Reader reader
private char[] srcBuf
private int srcPos
private int srcCount
private boolean eof
private int line
private int column
private int peek0
private int peek1
private char[] txtBuf
private int txtPos
private int type
private java.lang.String text
private boolean isWhitespace
private java.lang.String name
private boolean degenerated
private int attributeCount
private java.lang.String[] attributes
private java.lang.String[] TYPES
Constructor Detail |
---|
public XmlReader(java.io.Reader reader) throws java.io.IOException
java.io.IOException
Method Detail |
---|
private final int read() throws java.io.IOException
java.io.IOException
private final void exception(java.lang.String desc) throws java.io.IOException
java.io.IOException
private final void push(int c)
private final void read(char c) throws java.io.IOException
java.io.IOException
private final void skip() throws java.io.IOException
java.io.IOException
private final java.lang.String pop(int pos)
private final java.lang.String readName() throws java.io.IOException
java.io.IOException
private final void parseLegacy(boolean push) throws java.io.IOException
java.io.IOException
private final void parseDoctype() throws java.io.IOException
java.io.IOException
private final void parseEndTag() throws java.io.IOException
java.io.IOException
private final int peekType()
private static final java.lang.String[] ensureCapacity(java.lang.String[] arr, int required)
private final void parseStartTag() throws java.io.IOException
java.io.IOException
public final boolean pushEntity() throws java.io.IOException
java.io.IOException
private final boolean pushText(int delimiter) throws java.io.IOException
java.io.IOException
public void defineCharacterEntity(java.lang.String entity, java.lang.String value)
public int getDepth()
public java.lang.String getPositionDescription()
public int getLineNumber()
public int getColumnNumber()
public boolean isWhitespace()
public java.lang.String getText()
public java.lang.String getName()
public boolean isEmptyElementTag()
public int getAttributeCount()
public java.lang.String getAttributeName(int index)
public java.lang.String getAttributeValue(int index)
public java.lang.String getAttributeValue(java.lang.String name)
public int getType()
public int next() throws java.io.IOException
java.io.IOException
public void require(int type, java.lang.String name) throws java.io.IOException
essentially it does this
if (getType() == TEXT && type != TEXT && isWhitespace ()) next (); if (type != getType || (name != null && !name.equals (getName ()) throw new XmlPullParserException ( "....");
java.io.IOException
public java.lang.String readText() throws java.io.IOException
essentially it does this
if (getType != TEXT) return "" String result = getText (); next (); return result;
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |