public final class LiteralAnalyzer extends Object
Modifier and Type | Method and Description |
---|---|
static String |
booleanLiteralOf(boolean value)
Returns the literal token of target
boolean value. |
static boolean |
booleanValueOf(String literal)
Analyzes a literal which represents
boolean value and returns it value. |
static String |
charLiteralOf(char value)
Returns the literal token of target
char value. |
static char |
charValueOf(String literal)
Analyzes a literal which represents
char value and returns it value. |
static String |
doubleLiteralOf(double value)
Returns the literal token of target
double value. |
static double |
doubleValueOf(String literal)
Analyzes a literal which represents
double value and returns it value. |
static String |
floatLiteralOf(float value)
Returns the literal token of target
float value. |
static float |
floatValueOf(String literal)
Analyzes a literal which represents
float value and returns it value. |
static String |
intLiteralOf(int value)
Returns the literal token of target
int value. |
static int |
intValueOf(String literal)
Analyzes a literal which represents
int value and returns it value. |
static String |
literalOf(Object value)
Returns the literal token of the target value.
|
static String |
longLiteralOf(long value)
Returns the literal token of target
long value. |
static long |
longValueOf(String literal)
Analyzes a literal which represents
long value and returns it value. |
static String |
nullLiteral()
Returns the literal token of
null . |
static LiteralToken |
parse(String literal)
Analyzes the literal token.
|
static String |
stringLiteralOf(String value)
Returns a literal token for the
String value. |
static String |
stringValueOf(String literal)
Analyzes a literal which represents a value of
String and returns its value. |
public static LiteralToken parse(String literal)
literal
- the target literalIllegalArgumentException
- if the parameter is null
public static boolean booleanValueOf(String literal)
boolean
value and returns it value.literal
- the target literal tokenIllegalArgumentException
- if the target literal is malformedpublic static char charValueOf(String literal)
char
value and returns it value.literal
- the target literal tokenIllegalArgumentException
- if the target literal is malformedpublic static double doubleValueOf(String literal)
double
value and returns it value.literal
- the target literal tokenNumberFormatException
- if the target literal is malformedpublic static float floatValueOf(String literal)
float
value and returns it value.literal
- the target literal tokenNumberFormatException
- if the target literal is malformedpublic static int intValueOf(String literal)
int
value and returns it value.literal
- the target literal tokenNumberFormatException
- if the target literal is malformedpublic static long longValueOf(String literal)
long
value and returns it value.literal
- the target literal tokenNumberFormatException
- if the target literal is malformedpublic static String stringValueOf(String literal)
String
and returns its value.literal
- the target literal tokenIllegalArgumentException
- if the target literal is malformedpublic static String literalOf(Object value)
value
- the target valueIllegalArgumentException
- if there is no suitable literal for the target valuepublic static String booleanLiteralOf(boolean value)
boolean
value.value
- the target valuepublic static String charLiteralOf(char value)
char
value.value
- the target valuepublic static String doubleLiteralOf(double value)
double
value.value
- the target valuepublic static String floatLiteralOf(float value)
float
value.value
- the target valuepublic static String intLiteralOf(int value)
int
value.value
- the target valuepublic static String longLiteralOf(long value)
long
value.value
- the target valuepublic static String stringLiteralOf(String value)
String
value.value
- the target valuepublic static String nullLiteral()
null
.null
literal tokenCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.