|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for scanners to process input data from entities without needing to know the details of the underlying storage of those entities, or their encodings. The methods in this interface have been refined over time to a rough balance between keeping the XML grammar dependent code within the scanner classes, and allowing high performance processing of XML documents.
Method Summary | |
int |
addString(int offset,
int length)
Add a string to the StringPool from the characters scanned using this
reader as described by offset and length . |
int |
addSymbol(int offset,
int length)
Add a symbol to the StringPool from the characters scanned using this
reader as described by offset and length . |
void |
append(XMLEntityHandler.CharBuffer charBuffer,
int offset,
int length)
Append the characters processed by this reader associated with offset and
length to the CharBuffer . |
int |
currentOffset()
Return the current offset within this reader. |
int |
getColumnNumber()
Return the column number of the current position within the document that we are processing. |
boolean |
getInCDSect()
This method is provided for scanner implementations. |
int |
getLineNumber()
Return the line number of the current position within the document that we are processing. |
boolean |
lookingAtChar(char ch,
boolean skipPastChar)
Test that the current character is a ch character. |
boolean |
lookingAtSpace(boolean skipPastChar)
Test that the current character is a whitespace character. |
boolean |
lookingAtValidChar(boolean skipPastChar)
Test that the current character is valid. |
int |
scanAttValue(char qchar,
boolean asSymbol)
Scan an attribute value. |
int |
scanCharRef(boolean isHexadecimal)
Scan a character reference. |
int |
scanContent(QName element)
Skip through the input while we are looking at character data. |
int |
scanEntityValue(int qchar,
boolean createString)
Scan an entity value. |
boolean |
scanExpectedName(char fastcheck,
StringPool.CharArrayRange expectedName)
Scan the name that is expected at the current position in the document. |
int |
scanInvalidChar()
Scan an invalid character. |
int |
scanName(char fastcheck)
Add a sequence of characters that match the XML definition of a Name to the StringPool . |
void |
scanQName(char fastcheck,
QName qname)
Add a sequence of characters that match the XML Namespaces definition of a QName to the StringPool . |
int |
scanStringLiteral()
Scan a string literal. |
void |
setInCDSect(boolean inCDSect)
This method is provided for scanner implementations. |
void |
skipPastName(char fastcheck)
Skip past a sequence of characters that match the XML definition of a Name. |
void |
skipPastNmtoken(char fastcheck)
Skip past a sequence of characters that match the XML definition of an Nmtoken. |
void |
skipPastSpaces()
Skip past whitespace characters starting at the current position. |
boolean |
skippedString(char[] s)
Skip past a sequence of characters that matches the specified character array. |
void |
skipToChar(char ch)
Advance through the input data up to the next ch character. |
Method Detail |
public int currentOffset()
public int getLineNumber()
public int getColumnNumber()
public void setInCDSect(boolean inCDSect)
public boolean getInCDSect()
public void append(XMLEntityHandler.CharBuffer charBuffer, int offset, int length)
offset
and
length
to the CharBuffer
.charBuffer
- The CharBuffer
to append the characters to.offset
- The offset within this reader where the copy should start.length
- The length within this reader where the copy should stop.public int addString(int offset, int length)
StringPool
from the characters scanned using this
reader as described by offset
and length
.offset
- The offset within this reader where the characters start.length
- The length within this reader where the characters end.StringPool
handle for the string.public int addSymbol(int offset, int length)
StringPool
from the characters scanned using this
reader as described by offset
and length
.offset
- The offset within this reader where the characters start.length
- The length within this reader where the characters end.StringPool
handle for the symbol.public boolean lookingAtChar(char ch, boolean skipPastChar) throws java.lang.Exception
ch
character.ch
- The character to match against.skipPastChar
- If true
, we advance past the matched character.true
if the current character is a ch
character;
false
otherwise.public boolean lookingAtValidChar(boolean skipPastChar) throws java.lang.Exception
skipPastChar
- If true
, we advance past the valid character.true
if the current character is valid;
false
otherwise.public boolean lookingAtSpace(boolean skipPastChar) throws java.lang.Exception
skipPastChar
- If true
, we advance past the whitespace character.true
if the current character is whitespace;
false
otherwise.public void skipToChar(char ch) throws java.lang.Exception
ch
character.ch
- The character to search for.public void skipPastSpaces() throws java.lang.Exception
public void skipPastName(char fastcheck) throws java.lang.Exception
public void skipPastNmtoken(char fastcheck) throws java.lang.Exception
public boolean skippedString(char[] s) throws java.lang.Exception
s
- The characters to match.true
if the current character is valid;
false
otherwise.public int scanInvalidChar() throws java.lang.Exception
public int scanCharRef(boolean isHexadecimal) throws java.lang.Exception
public int scanStringLiteral() throws java.lang.Exception
StringPool
handle for the string that
was scanned, or one of the following error codes:
STRINGLIT_RESULT_QUOTE_REQUIRED
STRINGLIT_RESULT_INVALID_CHARpublic int scanAttValue(char qchar, boolean asSymbol) throws java.lang.Exception
qchar
- The initial quote character, either a single or double quote.StringPool
handle for the string that
was scanned, or one of the following error codes:
ATTVALUE_RESULT_COMPLEX
ATTVALUE_RESULT_LESSTHAN
ATTVALUE_RESULT_INVALID_CHARpublic int scanEntityValue(int qchar, boolean createString) throws java.lang.Exception
qchar
- The initial quote character, either a single or double quote.StringPool
handle for the string that
was scanned, or one of the following error codes:
ENTITYVALUE_RESULT_FINISHED
ENTITYVALUE_RESULT_REFERENCE
ENTITYVALUE_RESULT_PEREF
ENTITYVALUE_RESULT_INVALID_CHAR
ENTITYVALUE_RESULT_END_OF_INPUTpublic int scanName(char fastcheck) throws java.lang.Exception
StringPool
.
If we find a name at the current position we will add it to the StringPool
as a symbol and will return the string pool handle for that symbol to the caller.fastcheck
- A character that is not a legal name character that is provided as a
hint to the reader of a character likely to terminate the Name.StringPool
handle for the name that was scanned,
or -1 if a name was not found at the current position within the input data.public boolean scanExpectedName(char fastcheck, StringPool.CharArrayRange expectedName) throws java.lang.Exception
fastcheck
- A character that is not a legal name character that is provided as a
hint to the reader of a character likely to terminate the Name.expectedName
- The characters of the name we expect.true
if we scanned the name we expected to find; otherwise
false
if we did not.public void scanQName(char fastcheck, QName qname) throws java.lang.Exception
StringPool
.
If we find a QName at the current position we will add it to the StringPool
and will return the string pool handle of that QName to the caller.fastcheck
- A character that is not a legal name character that is provided as a
hint to the reader of a character likely to terminate the Name.
public int scanContent(QName element) throws java.lang.Exception
elementType
- The element type handle in the StringPool.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |