Package org.camunda.bpm.engine.impl.juel
Class Scanner
- java.lang.Object
-
- org.camunda.bpm.engine.impl.juel.Scanner
-
public class Scanner extends java.lang.Object
Handcrafted scanner.- Author:
- Christoph Beck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Scanner.ExtensionToken
static class
Scanner.ScanException
Scan exception typestatic class
Scanner.Symbol
Symbol typestatic class
Scanner.Token
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringBuilder
builder
-
Constructor Summary
Constructors Modifier Constructor Description protected
Scanner(java.lang.String input)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Scanner.Token
fixed(Scanner.Symbol symbol)
java.lang.String
getInput()
int
getPosition()
Scanner.Token
getToken()
protected boolean
isDigit(char c)
protected boolean
isEval()
protected Scanner.Token
keyword(java.lang.String s)
Scanner.Token
next()
Scan next token.protected Scanner.Token
nextEval()
token inside an eval expressionprotected Scanner.Token
nextNumber()
number tokenprotected Scanner.Token
nextString()
string tokenprotected Scanner.Token
nextText()
text tokenprotected Scanner.Token
nextToken()
protected Scanner.Token
token(Scanner.Symbol symbol, java.lang.String value, int length)
-
-
-
Method Detail
-
getInput
public java.lang.String getInput()
-
getToken
public Scanner.Token getToken()
- Returns:
- current token
-
getPosition
public int getPosition()
- Returns:
- current input position
-
isDigit
protected boolean isDigit(char c)
- Returns:
true
iff the specified character is a digit
-
keyword
protected Scanner.Token keyword(java.lang.String s)
- Parameters:
s
- name- Returns:
- token for the given keyword or
null
-
fixed
protected Scanner.Token fixed(Scanner.Symbol symbol)
- Parameters:
symbol
-- Returns:
- token for the given symbol
-
token
protected Scanner.Token token(Scanner.Symbol symbol, java.lang.String value, int length)
-
isEval
protected boolean isEval()
-
nextText
protected Scanner.Token nextText() throws Scanner.ScanException
text token- Throws:
Scanner.ScanException
-
nextString
protected Scanner.Token nextString() throws Scanner.ScanException
string token- Throws:
Scanner.ScanException
-
nextNumber
protected Scanner.Token nextNumber() throws Scanner.ScanException
number token- Throws:
Scanner.ScanException
-
nextEval
protected Scanner.Token nextEval() throws Scanner.ScanException
token inside an eval expression- Throws:
Scanner.ScanException
-
nextToken
protected Scanner.Token nextToken() throws Scanner.ScanException
- Throws:
Scanner.ScanException
-
next
public Scanner.Token next() throws Scanner.ScanException
Scan next token. After calling this method,getToken()
andgetPosition()
can be used to retreive the token's image and input position.- Returns:
- scanned token
- Throws:
Scanner.ScanException
-
-