|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.novell.xml.xpath.Scanner
class to scan and separate a string containing an XPath expression into lexical tokens
Token| Field Summary | |
protected static char |
EAT_CHAR
|
| Constructor Summary | |
Scanner(String string)
Construct a scanner for the passed expression |
|
| Method Summary | |
protected void |
appendToken(Token token)
Append a token to the result tokens. |
protected boolean |
checkOpNameMulOpState()
Check the preceding Token type to see if an operator name ("div", "mod", "and", "or") or the multiply operator ("*") should be recognized as such |
protected void |
done()
Allow a derived class to finish processing when the end of the input string is reached. |
protected char |
getNextChar()
Get next character from input string |
protected char |
getNextXMLChar()
Return next non-whitespace XML character from input string |
protected void |
handleChar(char scanChar)
Add appropriate token for text starting with passed character This will continue scanning ahead if necessary, and may check the previous Token |
protected void |
handleLiteral(char startQuote)
Create a LiteralToken for the literal text enclosed in single or double quotes |
protected void |
handleNumber(char startChar)
Create a NumberToken from scanned text |
protected void |
handleQName(com.novell.xml.xpath.QName qName)
Construct appropriate token based on an XML QName This will add a WildcardNameToken, FunctionNameToken, NodeTypeToken, or OperatorToken depending on characters and context |
protected boolean |
isDigit(char c)
Determine if passed char is a digit |
protected Token |
lastToken()
Return the last token appended to the result tokens. |
protected void |
popPos()
Restore saved position in expression string |
protected char |
prescanChar(char scanChar)
Perform any non-XPath processing for this character. |
protected void |
pushPos()
Remember current position in expression string |
protected void |
reset()
reset scanner to rescan string |
protected Token[] |
returnTokens()
Return the result tokens as an array of tokens. |
Token[] |
scan()
Return lexical tokens for expression |
protected String |
scanNCName(char firstChar)
scan all characters making up an XML NCName |
static double |
scanNumber(String string)
Scan a string and return the numeric value if string matches the XPath Number production. |
protected com.novell.xml.xpath.QName |
scanQName(char firstChar)
scan all characters making up an XML QName |
protected void |
tossPos()
Throw away remembered position in expression string |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final char EAT_CHAR
| Constructor Detail |
public Scanner(String string)
string - XPath expression| Method Detail |
public Token[] scan()
throws XPathParserException
java.lang.XPathParserException
XPathParserExceptionpublic static double scanNumber(String string)
string - The string to scan.
protected char prescanChar(char scanChar)
scanChar - The character being scanned.
protected void done()
protected void handleQName(com.novell.xml.xpath.QName qName)
throws XPathParserException
qName - object representing QName
java.lang.XPathParserException
XPathParserException
protected void handleChar(char scanChar)
throws XPathParserException
scanChar - character scanned
java.lang.XPathParserException
XPathParserExceptionprotected void handleLiteral(char startQuote)
startQuote - scanned quote char '\'' or '"'protected void handleNumber(char startChar)
startChar - Either a digit ('0'-'9') or a decimal point ('.')protected boolean checkOpNameMulOpState()
protected com.novell.xml.xpath.QName scanQName(char firstChar)
firstChar - XML start name character already scanned
protected String scanNCName(char firstChar)
firstChar - XML start name character already scanned
protected char getNextXMLChar()
protected char getNextChar()
protected boolean isDigit(char c)
c - char to check
protected void reset()
protected void pushPos()
protected void tossPos()
pushPos()protected void popPos()
pushPos()protected final void appendToken(Token token)
token - The token to append.protected final Token lastToken()
protected Token[] returnTokens()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||