|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.query.compiler.Lexer
public class Lexer
Lexer for a Query. Allows a class to work its way through the parsed string, obtaining relevant components with each call, or peeking ahead before deciding what component to parse next. Would work with JDOQL or JPQL. The only difference is the input of parameter prefixes. With JDOQL all parameters are prefixed ":", whereas in JPQL you can have numbered parameters "?" and named parameters ":".
| Field Summary | |
|---|---|
protected java.text.CharacterIterator |
ci
|
protected static Localiser |
LOCALISER
Localiser for messages. |
| Constructor Summary | |
|---|---|
Lexer(java.lang.String input,
java.lang.String paramPrefixes)
Constructor |
|
| Method Summary | |
|---|---|
int |
getIndex()
Accessor for the current index in the input string. |
java.lang.String |
getInput()
Accessor for the input string. |
boolean |
nextIsDot()
Utility to return if the next character is a dot. |
boolean |
nextIsSingleQuote()
Utility to return if the next non-whitespace character is a single quote. |
java.lang.Boolean |
parseBooleanLiteral()
Parse a boolean from the current position. |
java.lang.Boolean |
parseBooleanLiteralIgnoreCase()
Parse a boolean from the current position (case insensitive). |
boolean |
parseChar(char c)
Check if char c is found |
boolean |
parseChar(char c,
char unlessFollowedBy)
Check if char c is found |
java.lang.Character |
parseCharacterLiteral()
Parse a Character literal |
boolean |
parseEOS()
Check if END OF TEXT is reached. |
java.math.BigDecimal |
parseFloatingPointLiteral()
Parse a floating point number from the current position. |
java.lang.String |
parseIdentifier()
Parse a java identifier from the current position. |
java.math.BigInteger |
parseIntegerLiteral()
Parse an integer number from the current position. |
java.lang.String |
parseMethod()
Checks if a java Method is found |
java.lang.String |
parseName()
Parses the text string (up to the next space) and returns it. |
boolean |
parseNullLiteral()
Checks if null literal is parsed |
boolean |
parseNullLiteralIgnoreCase()
Checks if null literal is parsed (case insensitive). |
boolean |
parseString(java.lang.String s)
Check if String s is found |
boolean |
parseStringIgnoreCase(java.lang.String s)
Check if String s is found ignoring the case |
java.lang.String |
parseStringLiteral()
Parse a String literal |
boolean |
peekStringIgnoreCase(java.lang.String s)
Check if String "s" is found ignoring the case, and not moving the cursor position. |
java.lang.String |
remaining()
|
int |
skipWS()
Skip over any whitespace from the current position. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
protected final java.text.CharacterIterator ci
| Constructor Detail |
|---|
public Lexer(java.lang.String input,
java.lang.String paramPrefixes)
input - The input stringparamPrefixes - String containing all possible prefixes for parameters| Method Detail |
|---|
public java.lang.String getInput()
public int getIndex()
public int skipWS()
public boolean parseEOS()
public boolean parseChar(char c)
c is found
c - the Character to find
c is found
public boolean parseChar(char c,
char unlessFollowedBy)
c is found
c - the Character to findunlessFollowedBy - the character to validate it does not follow c
c is found and not followed by unlessFollowedBypublic boolean parseString(java.lang.String s)
s is found
s - the String to find
s is foundpublic boolean parseStringIgnoreCase(java.lang.String s)
s is found ignoring the case
s - the String to find
s is foundpublic boolean peekStringIgnoreCase(java.lang.String s)
s - the String to find
public java.lang.String parseIdentifier()
public java.lang.String parseMethod()
public java.lang.String parseName()
public java.math.BigInteger parseIntegerLiteral()
public java.math.BigDecimal parseFloatingPointLiteral()
public java.lang.Boolean parseBooleanLiteral()
public java.lang.Boolean parseBooleanLiteralIgnoreCase()
public boolean nextIsSingleQuote()
public boolean nextIsDot()
public java.lang.Character parseCharacterLiteral()
NucleusUserException - if an invalid character is found or the CharacterIterator is finishedpublic java.lang.String parseStringLiteral()
NucleusUserException - if an invalid character is found or the CharacterIterator is finishedpublic boolean parseNullLiteral()
public boolean parseNullLiteralIgnoreCase()
public java.lang.String remaining()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||