Class XMLPullParser
- java.lang.Object
-
- org.sblim.cimclient.internal.pullparser.XMLPullParser
-
public class XMLPullParser extends java.lang.ObjectClass XMLPullParser is responsible for XML parsing.
-
-
Field Summary
Fields Modifier and Type Field Description static intATTRIBUTEATTRIBUTEstatic intCDATACDATAstatic intCHARACTERSCHARACTERSstatic intCOMMENTCOMMENTstatic intDTDDTDstatic java.lang.StringEMPTYEMPTYstatic intEND_DOCUMENTEND_DOCUMENTstatic intEND_ELEMENTEND_ELEMENTstatic intENTITY_DECLARATIONENTITY_DECLARATIONstatic intENTITY_REFERENCEENTITY_REFERENCEstatic intNAMESPACENAMESPACEstatic intNOTATION_DECLARATIONNOTATION_DECLARATIONstatic intPROCESSING_INSTRUCTIONPROCESSING_INSTRUCTIONstatic intSPACESPACEstatic intSTART_DOCUMENTSTART_DOCUMENTstatic intSTART_ELEMENTSTART_ELEMENT
-
Constructor Summary
Constructors Constructor Description XMLPullParser(java.io.Reader in)Ctor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected char_getNextChar()protected voidaddAttribute(int begName, int lenName, int begValue, int lenValue)voidclose()closeprotected voidensureCapacity()protected java.lang.Stringescape(char ch)org.xml.sax.AttributesgetAttributes()getAttributesprotected intgetChar()java.lang.StringgetElementName()getElementNamejava.util.ArrayList<java.lang.String>getElementNames()getElementNamesintgetLevel()getLevelprotected intgetNextChar()protected intgetNextCharCheckingEOF()java.lang.StringgetText()getTextprotected voidgoBack()booleanhasNext()hasNextprotected booleanisSpace(char ch)protected booleanisValidElementNameChar(char ch)protected booleanisValidStartElementNameChar(char ch)static voidmain(java.lang.String[] args)mainintnext()nextstatic booleannext(XMLPullParser reader, XMLDefaultHandlerImpl parserHdlr)nextprotected voidparseAttribute(char ch)protected intparseCDATA()protected intparseComment()protected voidparseEndElement()protected intparsePI()protected intparseReference()protected intparseStartElement(char ch)protected voidparseUnknown()voidreset()resetprotected voidresetAttributes()protected charskipOptionalSpaces(char ch)protected charskipRequiredSpaces(char ch)java.lang.StringtoString()
-
-
-
Field Detail
-
ATTRIBUTE
public static final int ATTRIBUTE
ATTRIBUTE- See Also:
- Constant Field Values
-
CDATA
public static final int CDATA
CDATA- See Also:
- Constant Field Values
-
CHARACTERS
public static final int CHARACTERS
CHARACTERS- See Also:
- Constant Field Values
-
COMMENT
public static final int COMMENT
COMMENT- See Also:
- Constant Field Values
-
DTD
public static final int DTD
DTD- See Also:
- Constant Field Values
-
EMPTY
public static final java.lang.String EMPTY
EMPTY- See Also:
- Constant Field Values
-
END_DOCUMENT
public static final int END_DOCUMENT
END_DOCUMENT- See Also:
- Constant Field Values
-
END_ELEMENT
public static final int END_ELEMENT
END_ELEMENT- See Also:
- Constant Field Values
-
ENTITY_DECLARATION
public static final int ENTITY_DECLARATION
ENTITY_DECLARATION- See Also:
- Constant Field Values
-
ENTITY_REFERENCE
public static final int ENTITY_REFERENCE
ENTITY_REFERENCE- See Also:
- Constant Field Values
-
NAMESPACE
public static final int NAMESPACE
NAMESPACE- See Also:
- Constant Field Values
-
NOTATION_DECLARATION
public static final int NOTATION_DECLARATION
NOTATION_DECLARATION- See Also:
- Constant Field Values
-
PROCESSING_INSTRUCTION
public static final int PROCESSING_INSTRUCTION
PROCESSING_INSTRUCTION- See Also:
- Constant Field Values
-
SPACE
public static final int SPACE
SPACE- See Also:
- Constant Field Values
-
START_DOCUMENT
public static final int START_DOCUMENT
START_DOCUMENT- See Also:
- Constant Field Values
-
START_ELEMENT
public static final int START_ELEMENT
START_ELEMENT- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
main- Parameters:
args-
-
next
public static boolean next(XMLPullParser reader, XMLDefaultHandlerImpl parserHdlr) throws java.lang.Exception
next- Parameters:
reader-parserHdlr-- Returns:
- boolean
- Throws:
java.lang.Exception
-
close
public void close() throws java.io.IOExceptionclose- Throws:
java.io.IOException
-
getAttributes
public org.xml.sax.Attributes getAttributes()
getAttributes- Returns:
- Attributes
-
getElementName
public java.lang.String getElementName()
getElementName- Returns:
- String
-
getElementNames
public java.util.ArrayList<java.lang.String> getElementNames()
getElementNames- Returns:
- Vector
-
getLevel
public int getLevel()
getLevel- Returns:
- int
-
getText
public java.lang.String getText()
getText- Returns:
- String
-
hasNext
public boolean hasNext()
hasNext- Returns:
- boolean
-
next
public int next() throws java.io.IOExceptionnext- Returns:
- int
- Throws:
java.io.IOException
-
reset
public void reset()
reset
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
_getNextChar
protected char _getNextChar()
-
addAttribute
protected void addAttribute(int begName, int lenName, int begValue, int lenValue)
-
ensureCapacity
protected void ensureCapacity()
-
escape
protected java.lang.String escape(char ch)
-
getChar
protected int getChar() throws java.io.IOException- Throws:
java.io.IOException
-
getNextChar
protected int getNextChar() throws java.io.IOException- Throws:
java.io.IOException
-
getNextCharCheckingEOF
protected int getNextCharCheckingEOF() throws java.io.IOException- Throws:
java.io.IOException
-
goBack
protected void goBack()
-
isSpace
protected boolean isSpace(char ch)
-
isValidElementNameChar
protected boolean isValidElementNameChar(char ch)
-
isValidStartElementNameChar
protected boolean isValidStartElementNameChar(char ch)
-
parseAttribute
protected void parseAttribute(char ch) throws java.io.IOException- Throws:
java.io.IOException
-
parseCDATA
protected int parseCDATA() throws java.io.IOException- Throws:
java.io.IOException
-
parseComment
protected int parseComment() throws java.io.IOException- Throws:
java.io.IOException
-
parseEndElement
protected void parseEndElement() throws java.io.IOException- Throws:
java.io.IOException
-
parsePI
protected int parsePI() throws java.io.IOException- Throws:
java.io.IOException
-
parseReference
protected int parseReference() throws java.io.IOException- Throws:
java.io.IOException
-
parseStartElement
protected int parseStartElement(char ch) throws java.io.IOException- Throws:
java.io.IOException
-
parseUnknown
protected void parseUnknown() throws java.io.IOException- Throws:
java.io.IOException
-
resetAttributes
protected void resetAttributes()
-
skipOptionalSpaces
protected char skipOptionalSpaces(char ch) throws java.io.IOException- Throws:
java.io.IOException
-
skipRequiredSpaces
protected char skipRequiredSpaces(char ch) throws java.io.IOException- Throws:
java.io.IOException
-
-