de.unkrig.commons.text.expression
Class Scanner

java.lang.Object
  extended by de.unkrig.commons.text.expression.Scanner

public final class Scanner
extends java.lang.Object

The scanner for the ExpressionEvaluator.


Nested Class Summary
static class Scanner.TokenType
          Token types for the ExpressionEvaluator scanner.
 
Method Summary
static java.lang.Character decodeCharacterLiteral(java.lang.String text)
           
static java.lang.Object decodeFloatingPointLiteral(java.lang.String text)
           
static java.lang.Object decodeIntegerLiteral(java.lang.String text)
           
static java.lang.String decodeStringLiteral(java.lang.String text)
          Removes the double quotes and the escape sequences from the given string literal.
static StringScanner<Scanner.TokenType> stringScanner()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

stringScanner

public static StringScanner<Scanner.TokenType> stringScanner()
Returns:
A StringScanner for the given Scanner.TokenType

decodeCharacterLiteral

public static java.lang.Character decodeCharacterLiteral(java.lang.String text)
                                                  throws ScanException
Returns:
E.g. a single quote if the text is single quote, backslash, single quote, single quote
Throws:
ScanException

decodeFloatingPointLiteral

public static java.lang.Object decodeFloatingPointLiteral(java.lang.String text)
Returns:
A Double or a Float

decodeIntegerLiteral

public static java.lang.Object decodeIntegerLiteral(java.lang.String text)
                                             throws ScanException
Returns:
A Long or an Integer
Throws:
ScanException

decodeStringLiteral

public static java.lang.String decodeStringLiteral(java.lang.String text)
                                            throws ScanException
Removes the double quotes and the escape sequences from the given string literal.

Throws:
ScanException