Package org.camunda.bpm.engine.impl.juel
Class Scanner
- java.lang.Object
-
- org.camunda.bpm.engine.impl.juel.Scanner
-
public class Scanner extends Object
Handcrafted scanner.- Author:
- Christoph Beck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScanner.ExtensionTokenstatic classScanner.ScanExceptionScan exception typestatic classScanner.SymbolSymbol typestatic classScanner.Token
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilderbuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Scanner.Tokenfixed(Scanner.Symbol symbol)StringgetInput()intgetPosition()Scanner.TokengetToken()protected booleanisDigit(char c)protected booleanisEval()protected Scanner.Tokenkeyword(String s)Scanner.Tokennext()Scan next token.protected Scanner.TokennextEval()token inside an eval expressionprotected Scanner.TokennextNumber()number tokenprotected Scanner.TokennextString()string tokenprotected Scanner.TokennextText()text tokenprotected Scanner.TokennextToken()protected Scanner.Tokentoken(Scanner.Symbol symbol, String value, int length)
-
-
-
Field Detail
-
builder
protected final StringBuilder builder
-
-
Constructor Detail
-
Scanner
protected Scanner(String input)
Constructor.- Parameters:
input- expression string
-
-
Method Detail
-
getInput
public 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:
trueiff the specified character is a digit
-
keyword
protected Scanner.Token keyword(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, 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
-
-