Class XMLPullParser
java.lang.Object
org.sblim.cimclient.internal.pullparser.XMLPullParser
public class XMLPullParser
extends java.lang.Object
Class XMLPullParser is responsible for XML parsing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
ATTRIBUTEstatic final int
CDATAstatic final int
CHARACTERSstatic final int
COMMENTstatic final int
DTDstatic final java.lang.String
EMPTYstatic final int
END_DOCUMENTstatic final int
END_ELEMENTstatic final int
ENTITY_DECLARATIONstatic final int
ENTITY_REFERENCEstatic final int
NAMESPACEstatic final int
NOTATION_DECLARATIONstatic final int
PROCESSING_INSTRUCTIONstatic final int
SPACEstatic final int
START_DOCUMENTstatic final int
START_ELEMENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected char
protected void
addAttribute
(int begName, int lenName, int begValue, int lenValue) void
close()
closeprotected void
protected java.lang.String
escape
(char ch) org.xml.sax.Attributes
getAttributesprotected int
getChar()
java.lang.String
getElementNamejava.util.ArrayList<java.lang.String>
getElementNamesint
getLevel()
getLevelprotected int
protected int
java.lang.String
getText()
getTextprotected void
goBack()
boolean
hasNext()
hasNextprotected boolean
isSpace
(char ch) protected boolean
isValidElementNameChar
(char ch) protected boolean
isValidStartElementNameChar
(char ch) static void
main
(java.lang.String[] args) mainint
next()
nextstatic boolean
next
(XMLPullParser reader, XMLDefaultHandlerImpl parserHdlr) nextprotected void
parseAttribute
(char ch) protected int
protected int
protected void
protected int
parsePI()
protected int
protected int
parseStartElement
(char ch) protected void
void
reset()
resetprotected void
protected char
skipOptionalSpaces
(char ch) protected char
skipRequiredSpaces
(char ch) java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
ATTRIBUTE
public static final int ATTRIBUTEATTRIBUTE- See Also:
-
CDATA
public static final int CDATACDATA- See Also:
-
CHARACTERS
public static final int CHARACTERSCHARACTERS- See Also:
-
COMMENT
public static final int COMMENTCOMMENT- See Also:
-
DTD
public static final int DTDDTD- See Also:
-
EMPTY
public static final java.lang.String EMPTYEMPTY- See Also:
-
END_DOCUMENT
public static final int END_DOCUMENTEND_DOCUMENT- See Also:
-
END_ELEMENT
public static final int END_ELEMENTEND_ELEMENT- See Also:
-
ENTITY_DECLARATION
public static final int ENTITY_DECLARATIONENTITY_DECLARATION- See Also:
-
ENTITY_REFERENCE
public static final int ENTITY_REFERENCEENTITY_REFERENCE- See Also:
-
NAMESPACE
public static final int NAMESPACENAMESPACE- See Also:
-
NOTATION_DECLARATION
public static final int NOTATION_DECLARATIONNOTATION_DECLARATION- See Also:
-
PROCESSING_INSTRUCTION
public static final int PROCESSING_INSTRUCTIONPROCESSING_INSTRUCTION- See Also:
-
SPACE
public static final int SPACESPACE- See Also:
-
START_DOCUMENT
public static final int START_DOCUMENTSTART_DOCUMENT- See Also:
-
START_ELEMENT
public static final int START_ELEMENTSTART_ELEMENT- See Also:
-
-
Constructor Details
-
XMLPullParser
public XMLPullParser(java.io.Reader in) Ctor.- Parameters:
in
-
-
-
Method Details
-
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:
toString
in 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
-