| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | asctyp
ASCII character type array. |
| protected static final int | |
| protected static final int | |
| public static final char | EOS
The end of stream character. |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| public static final String | |
| protected Pair | |
| private char | |
| protected Attrs | |
| private static final int | |
| protected char[] | |
| protected int | |
| private char[] | |
| private int | |
| private int | |
| private Pair | |
| protected Input | |
| protected Pair | |
| private Map | |
| private char | |
| protected int | |
| protected Input | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| private String[] | |
| private Pair | |
| private Map | |
| protected int | |
| protected Pair | |
| private String | |
| private Pair | |
| private static final byte[] | nmttyp
NMTOKEN character type array. |
| private static final char[] | NONS
Default prefixes |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| private static final char[] | |
| private static final char[] |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private String | |
| private void | bappend(char
The character to append to the buffer. ch, char The normalization mode. mode)Appends a character to parser's buffer with normalization. |
| private void | |
| private void | bcopy(int
The character buffer (mChars) start index. cidx, int The parser buffer (mBuff) start index. bidx)Appends (mChIdx - cidx) characters from character buffer (mChars) to parser's buffer (mBuff). |
| protected abstract void | |
| protected abstract void | |
| protected void | |
| private char | |
| private void | |
| private void | |
| private Reader | Returns: a reader constructed from the BOM or UTF-8 by default.A byte stream of the entity. is, char An encoding hint, character U means UTF-16. hint)Determines the entity encoding. |
| private void | bqstr(char
'c' - CDATA, 'i' - non CDATA, ' ' - no normalization; '-' -
not an attribute value; 'd' - in DTD context. flag)Reads a single or double quoted string into the buffer. |
| private void | |
| protected char | |
| protected void | |
| private void | |
| protected abstract void | comm(char[]
The comment text starting from first character. text, int The number of characters in comment. length)Reports a comment. |
| protected Pair | |
| protected abstract void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | eappend(char
the next character of an entity name. ch)Recognizes the built-in entities lt, gt, amp, apos, quot. |
| private Reader | Returns: a reader constructed from encoding name and input stream.an encoding name. name, InputStream the document byte input stream. is)Sets up the document reader. |
| private void | |
| private String | Returns: Name of unresolved entity ornull if entity had been
resolved successfully.The 'x' character forces the method to report a skipped
entity; 'i' character - indicates non-CDATA normalization. flag)Resolves an entity. |
| protected String | Returns: The content of the quoted strign as a string.The '=' character forces the method to accept the '='
character before quoted string and read the following string as not an
attribute ('-'), 'c' - CDATA, 'i' - non CDATA, ' ' - no normalization;
'-' - not an attribute value; 'd' - in DTD context. flag)Reads an attribute value. |
| protected Pair | |
| protected char | |
| protected void | |
| private boolean | |
| protected String | Returns: The name has been read.The true value turns namespace conformance on. ns)Reads a xml name. |
| protected abstract void | |
| protected abstract void | |
| protected Pair | |
| protected abstract void | |
| private void | pent(char
The '-' instruct the method to do not set up surrounding
spaces [#4.4.8]. flag)Resolves a parameter entity. |
| private void | |
| protected abstract void | |
| protected void | |
| private void | |
| private Pair | Returns: The public or/and system identifiers pair.The 'N' allows public id be without system id. flag)Reads the public or/and system identifiers. |
| protected void | |
| protected char[] | Returns: The characters of a qualified name.The true value turns namespace conformance on. ns)Reads a qualified xml name. |
| protected abstract InputSource | resolveEnt(String
The name of the entity. name, String The public identifier of the entity. pubid, String The system identifier of the entity. sysid)Returns an
|
| private String | |
| protected void | |
| protected void | setinp(InputSource
A new input source to set up. is)Sets up a new input source on the top of the input stack. |
| protected abstract void | |
| public abstract void | |
| protected int | |
| protected abstract void | unparsedEntDecl(String
The unparsed entity's name. name, String The entity's public identifier, or null if none was given. pubid, String The entity's system identifier. sysid, String The name of the associated notation. notation)Reports unparsed entity name. |
| private Reader | Returns: a reader, may be nullA byte stream of the entity. is)Using a mature technique from Xerces, this method checks further after the bom method above to see if the encoding is UTF-16 |
| protected char | |
| private String |
| asctyp | back to summary |
|---|---|
| private static final byte[] asctyp ASCII character type array.
This array maps an ASCII (7 bit) character to the character type. | |
| BUFFSIZE_PARSER | back to summary |
|---|---|
| protected static final int BUFFSIZE_PARSER | |
| BUFFSIZE_READER | back to summary |
|---|---|
| protected static final int BUFFSIZE_READER | |
| EOS | back to summary |
|---|---|
| public static final char EOS The end of stream character. | |
| EV_CDAT | back to summary |
|---|---|
| protected static final int EV_CDAT | |
| EV_COMM | back to summary |
|---|---|
| protected static final int EV_COMM | |
| EV_DTD | back to summary |
|---|---|
| protected static final int EV_DTD | |
| EV_ELM | back to summary |
|---|---|
| protected static final int EV_ELM | |
| EV_ELME | back to summary |
|---|---|
| protected static final int EV_ELME | |
| EV_ELMS | back to summary |
|---|---|
| protected static final int EV_ELMS | |
| EV_ENT | back to summary |
|---|---|
| protected static final int EV_ENT | |
| EV_NULL | back to summary |
|---|---|
| protected static final int EV_NULL | |
| EV_PI | back to summary |
|---|---|
| protected static final int EV_PI | |
| EV_TEXT | back to summary |
|---|---|
| protected static final int EV_TEXT | |
| EV_WSPC | back to summary |
|---|---|
| protected static final int EV_WSPC | |
| FAULT | back to summary |
|---|---|
| public static final String FAULT | |
| mAttL | back to summary |
|---|---|
| protected Pair mAttL | |
| mAttrIdx | back to summary |
|---|---|
| private char mAttrIdx | |
| mAttrs | back to summary |
|---|---|
| protected Attrs mAttrs | |
| MAX_ARRAY_SIZE | back to summary |
|---|---|
| private static final int MAX_ARRAY_SIZE | |
| mBuff | back to summary |
|---|---|
| protected char[] mBuff | |
| mBuffIdx | back to summary |
|---|---|
| protected int mBuffIdx | |
| mChars | back to summary |
|---|---|
| private char[] mChars | |
| mChIdx | back to summary |
|---|---|
| private int mChIdx | |
| mChLen | back to summary |
|---|---|
| private int mChLen | |
| mDltd | back to summary |
|---|---|
| private Pair mDltd | |
| mDoc | back to summary |
|---|---|
| protected Input mDoc | |
| mElm | back to summary |
|---|---|
| protected Pair mElm | |
| mEnt | back to summary |
|---|---|
| private Map<String, Input> mEnt | |
| mESt | back to summary |
|---|---|
| private char mESt | |
| mEvt | back to summary |
|---|---|
| protected int mEvt | |
| mInp | back to summary |
|---|---|
| protected Input mInp | |
| mIsNSAware | back to summary |
|---|---|
| protected boolean mIsNSAware | |
| mIsSAlone | back to summary |
|---|---|
| protected boolean mIsSAlone | |
| mIsSAloneSet | back to summary |
|---|---|
| protected boolean mIsSAloneSet | |
| mItems | back to summary |
|---|---|
| private String[] mItems | |
| mNoNS | back to summary |
|---|---|
| private Pair mNoNS | |
| mPEnt | back to summary |
|---|---|
| private Map<String, Input> mPEnt | |
| mPh | back to summary |
|---|---|
| protected int mPh | |
| mPref | back to summary |
|---|---|
| protected Pair mPref | |
| mUnent | back to summary |
|---|---|
| private String mUnent | |
| mXml | back to summary |
|---|---|
| private Pair mXml | |
| nmttyp | back to summary |
|---|---|
| private static final byte[] nmttyp NMTOKEN character type array.
This array maps an ASCII (7 bit) character to the character type. | |
| NONS | back to summary |
|---|---|
| private static final char[] NONS Default prefixes | |
| PH_AFTER_DOC | back to summary |
|---|---|
| protected static final int PH_AFTER_DOC | |
| PH_BEFORE_DOC | back to summary |
|---|---|
| protected static final int PH_BEFORE_DOC | |
| PH_DOC_START | back to summary |
|---|---|
| protected static final int PH_DOC_START | |
| PH_DOCELM | back to summary |
|---|---|
| protected static final int PH_DOCELM | |
| PH_DOCELM_MISC | back to summary |
|---|---|
| protected static final int PH_DOCELM_MISC | |
| PH_DTD | back to summary |
|---|---|
| protected static final int PH_DTD | |
| PH_DTD_MISC | back to summary |
|---|---|
| protected static final int PH_DTD_MISC | |
| PH_MISC_DTD | back to summary |
|---|---|
| protected static final int PH_MISC_DTD | |
| XML | back to summary |
|---|---|
| private static final char[] XML | |
| XMLNS | back to summary |
|---|---|
| private static final char[] XMLNS | |
| Parser | back to summary |
|---|---|
| protected Parser() Constructor.
| |
| attr | back to summary |
|---|---|
| private void attr(Pair att) throws Exception Parses an attribute.
This recursive method is responsible for prefix addition
(
| |
| atype | back to summary |
|---|---|
| private String atype(Pair att) throws Exception Retrieves attribute type.
This method sets the type of normalization in the attribute
| |
| bappend | back to summary |
|---|---|
| private void bappend(char ch, char mode) throws Exception Appends a character to parser's buffer with normalization.
| |
| bappend | back to summary |
|---|---|
| private void bappend(char ch) throws Exception Appends a character to parser's buffer.
| |
| bcopy | back to summary |
|---|---|
| private void bcopy(int cidx, int bidx) throws Exception Appends (mChIdx - cidx) characters from character buffer (mChars) to parser's buffer (mBuff).
| |
| bflash | back to summary |
|---|---|
| protected abstract void bflash() throws Exception Reports characters and empties the parser's buffer. This method is called only if parser is going to return control to the main loop. This means that this method may use parser buffer to report white space without copying characters to temporary buffer. | |
| bflash_ws | back to summary |
|---|---|
| protected abstract void bflash_ws() throws Exception Reports white space characters and empties the parser's buffer. This method is called only if parser is going to return control to the main loop. This means that this method may use parser buffer to report white space without copying characters to temporary buffer. | |
| bkch | back to summary |
|---|---|
| protected void bkch() throws Exception Puts back the last read character.
This method MUST NOT be called more then once after each
call of | |
| bkeyword | back to summary |
|---|---|
| private char bkeyword() throws Exception Recognizes a keyword. This is low level routine which recognizes one of keywords in the buffer. Keyword Id ID - i IDREF - r IDREFS - R ENTITY - n ENTITIES - N NMTOKEN - t NMTOKENS - T ELEMENT - e ATTLIST - a NOTATION - o CDATA - c REQUIRED - Q IMPLIED - I FIXED - F
| |
| bname | back to summary |
|---|---|
| private void bname(boolean ns) throws Exception Reads a qualified xml name. This is low level routine which leaves a qName in the buffer. The characters of a qualified name is an array of characters. The first (chars[0]) character is the index of the colon character which separates the prefix from the local name. If the index is zero, the name does not contain separator or the parser works in the namespace unaware mode. The length of qualified name is the length of the array minus one.
| |
| bntok | back to summary |
|---|---|
| private void bntok() throws Exception Reads a nmtoken. This is low level routine which leaves a nmtoken in the buffer.
| |
| bom | back to summary |
|---|---|
| private Reader bom(InputStream is, char hint) throws Exception Determines the entity encoding. This method gets encoding from Byte Order Mask [#4.3.3] if any. Note, the first byte returned by the entity's byte stream has to be the first byte in the entity. Also, there is no support for UCS-4.
| |
| bqstr | back to summary |
|---|---|
| private void bqstr(char flag) throws Exception Reads a single or double quoted string into the buffer. This method resolves entities inside a string unless the parser parses DTD.
| |
| cdat | back to summary |
|---|---|
| private void cdat() throws Exception Parses a character data. The '<!' part is read in dispatcher so the method starts with first '[' after '<!'.
| |
| chtyp | back to summary |
|---|---|
| protected char chtyp(char ch) Maps a character to its type. Possible character type values are:
| |
| cleanup | back to summary |
|---|---|
| protected void cleanup() Cleans up parser internal resources. | |
| comm | back to summary |
|---|---|
| private void comm() throws Exception Parses a comment. The '<!' part is read in dispatcher so the method starts with first '-' after '<!'.
| |
| comm | back to summary |
|---|---|
| protected abstract void comm(char[] text, int length) Reports a comment.
| |
| del | back to summary |
|---|---|
| protected Pair del(Pair pair) Deletes an instance of a pair. | |
| docType | back to summary |
|---|---|
| protected abstract void docType(String name, String pubid, String sysid) throws SAXException Reports document type. | |
| dtd | back to summary |
|---|---|
| private void dtd() throws Exception Parses the document type declaration.
| |
| dtdatt | back to summary |
|---|---|
| private void dtdatt(Pair elm) throws Exception Parses an attribute declaration. The attribute uses the following fields of Pair object: chars - characters of qualified name id - the type identifier of the attribute list - a pair which holds the default value (chars field)
| |
| dtdattl | back to summary |
|---|---|
| private void dtdattl() throws Exception Parses an attribute list declaration. This method parses the declaration up to the closing angle bracket.
| |
| dtdelm | back to summary |
|---|---|
| private void dtdelm() throws Exception Parses an element declaration. This method parses the declaration up to the closing angle bracket.
| |
| dtdent | back to summary |
|---|---|
| private void dtdent() throws Exception Parses an entity declaration. This method fills the general (
| |
| dtdnot | back to summary |
|---|---|
| private void dtdnot() throws Exception Parses a notation declaration. This method parses the declaration up to the closing angle bracket.
| |
| dtdsub | back to summary |
|---|---|
| private void dtdsub() throws Exception Parses the document type declaration subset.
| |
| eappend | back to summary |
|---|---|
| private void eappend(char ch) Recognizes the built-in entities lt, gt, amp, apos, quot. The initial state is 0x100. Any state belowe 0x100 is a built-in entity replacement character.
| |
| enc | back to summary |
|---|---|
| private Reader enc(String name, InputStream is) throws UnsupportedEncodingException Sets up the document reader.
| |
| ensureCapacity | back to summary |
|---|---|
| private void ensureCapacity(int minCapacity) throws Exception | |
| ent | back to summary |
|---|---|
| private String ent(char flag) throws Exception Resolves an entity. This method resolves built-in and character entity references. It is also reports external entities to the application.
| |
| eqstr | back to summary |
|---|---|
| protected String eqstr(char flag) throws Exception Reads an attribute value. The grammar this method can read is:
This method resolves entities
inside a string unless the parser parses DTD.
| |
| find | back to summary |
|---|---|
| protected Pair find(Pair chain, char[] qname) Finds a pair in the pair chain by a qualified name. | |
| getch | back to summary |
|---|---|
| protected char getch() throws IOException Retrieves the next character in the document.
| |
| init | back to summary |
|---|---|
| protected void init() Initializes parser's internals. Note, current input has to be set before this method is called. | |
| isdecl | back to summary |
|---|---|
| private boolean isdecl(Pair name, String value) Recognizes and handles a namespace declaration. This method identifies a type of namespace declaration if any and puts new mapping on top of prefix stack. | |
| name | back to summary |
|---|---|
| protected String name(boolean ns) throws Exception Reads a xml name. The xml name must conform "Namespaces in XML" specification. Therefore the ':' character is not allowed in the name. This method should be used for PI and entity names which may not have a namespace according to the specification mentioned above. | |
| newPrefix | back to summary |
|---|---|
| protected abstract void newPrefix() throws Exception Reports new namespace prefix. The Namespace prefix (
| |
| notDecl | back to summary |
|---|---|
| protected abstract void notDecl(String name, String pubid, String sysid) throws Exception Reports notation declaration. | |
| pair | back to summary |
|---|---|
| protected Pair pair(Pair next) Provedes an instance of a pair. | |
| panic | back to summary |
|---|---|
| protected abstract void panic(String msg) throws Exception Notifies the handler about fatal parsing error.
| |
| pent | back to summary |
|---|---|
| private void pent(char flag) throws Exception Resolves a parameter entity. This method resolves a parameter entity references. It is also reports external entities to the application.
| |
| pi | back to summary |
|---|---|
| private void pi() throws Exception Parses a processing instruction. The '<?' is read in dispatcher so the method starts with first character of PI target name after '<?'.
| |
| pi | back to summary |
|---|---|
| protected abstract void pi(String target, String body) throws Exception Reports a processing instruction. | |
| pop | back to summary |
|---|---|
| protected void pop() Restores previous input on the top of the input stack. | |
| pubsys | back to summary |
|---|---|
| private void pubsys(Input inp) throws Exception Reads the public or/and system identifiers. | |
| pubsys | back to summary |
|---|---|
| private Pair pubsys(char flag) throws Exception Reads the public or/and system identifiers.
| |
| push | back to summary |
|---|---|
| protected void push(Input inp) Sets up current input on the top of the input stack.
| |
| qname | back to summary |
|---|---|
| protected char[] qname(boolean ns) throws Exception Reads a qualified xml name. The characters of a qualified name is an array of characters. The first (chars[0]) character is the index of the colon character which separates the prefix from the local name. If the index is zero, the name does not contain separator or the parser works in the namespace unaware mode. The length of qualified name is the length of the array minus one.
| |
| resolveEnt | back to summary |
|---|---|
| protected abstract InputSource resolveEnt(String name, String pubid, String sysid) throws Exception Returns an
| |
| rslv | back to summary |
|---|---|
| private String rslv(char[] qname) throws Exception Resolves a prefix. | |
| setch | back to summary |
|---|---|
| protected void setch(char ch) Sets the current character.
| |
| setinp | back to summary |
|---|---|
| protected void setinp(InputSource is) throws Exception Sets up a new input source on the top of the input stack. Note, the first byte returned by the entity's byte stream has to be the first byte in the entity. However, the parser does not expect the byte order mask in both cases when encoding is provided by the input source.
| |
| skippedEnt | back to summary |
|---|---|
| protected abstract void skippedEnt(String name) throws Exception Reports skipped entity name.
| |
| startInternalSub | back to summary |
|---|---|
| public abstract void startInternalSub() throws SAXException Reports the start of DTD internal subset.
| |
| step | back to summary |
|---|---|
| protected int step() throws Exception Processes a portion of document. This method returns one of EV_* constants as an identifier of the portion of document have been read.
| |
| unparsedEntDecl | back to summary |
|---|---|
| protected abstract void unparsedEntDecl(String name, String pubid, String sysid, String notation) throws Exception Reports unparsed entity name. | |
| utf16 | back to summary |
|---|---|
| private Reader utf16(InputStream is) throws Exception Using a mature technique from Xerces, this method checks further after the bom method above to see if the encoding is UTF-16
| |
| wsskip | back to summary |
|---|---|
| protected char wsskip() throws IOException Skips xml white space characters. This method skips white space characters (' ', '\t', '\n', '\r') and looks ahead not white space character.
| |
| xml | back to summary |
|---|---|
| private String xml(Reader reader) throws Exception Parses the xml text declaration. This method gets encoding from the xml text declaration [#4.3.1] if any. The method assumes the buffer (mChars) is big enough to accommodate whole xml text declaration. | |