Top Description Fields Constructors Methods
org.springframework.expression.spel.ast

public abstract Class Literal

extends SpelNodeImpl
Class Inheritance
Known Direct Subclasses
org.springframework.expression.spel.ast.LongLiteral, org.springframework.expression.spel.ast.NullLiteral, org.springframework.expression.spel.ast.RealLiteral, org.springframework.expression.spel.ast.StringLiteral, org.springframework.expression.spel.ast.BooleanLiteral, org.springframework.expression.spel.ast.FloatLiteral, org.springframework.expression.spel.ast.IntLiteral
Imports
org.springframework.expression.TypedValue, org.springframework.expression.spel.ExpressionState, .InternalParseException, .SpelEvaluationException, .SpelMessage, .SpelParseException, org.springframework.lang.Nullable

Common superclass for nodes representing literals (boolean, string, number, etc).
Authors
Andy Clement, Juergen Hoeller, Semyon Danilov

Field Summary

Modifier and TypeField and Description
private final String
Inherited from org.springframework.expression.spel.ast.SpelNodeImpl:
childrenexitTypeDescriptor

Constructor Summary

AccessConstructor and Description
public
Literal(String originalValue, int startPos, int endPos)

Method Summary

Modifier and TypeMethod and Description
public static Literal

Returns:

a subtype of Literal that can represent it
getIntLiteral
(String
the token holding the number as its payload (eg. 1234 or 0xCAFE)
numberToken
,
int startPos, int endPos, int
the base of number
radix
)

Process the string form of a number, using the specified base if supplied and return an appropriate literal to hold it.

public abstract TypedValue
public static Literal
getLongLiteral(String numberToken, int startPos, int endPos, int radix)

public final String
public static Literal
getRealLiteral(String numberToken, int startPos, int endPos, boolean isFloat)

public final TypedValue
public boolean

Returns:

true if this literal represents a number
isNumberLiteral
()

Determine if this literal represents a number.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
toStringAST()

Implements org.springframework.expression.spel.SpelNode.toStringAST.

Return the string form of this AST node.
Inherited from org.springframework.expression.spel.ast.SpelNodeImpl:
generateCodegenerateCodeForArgumentgenerateCodeForArgumentsgetChildgetChildCountgetEndPositiongetExitDescriptorgetObjectClassgetStartPositiongetTypedValuegetValuegetValuegetValueRefisCompilableisWritablenextChildIssetValuesetValueInternal

Field Detail

originalValueback to summary
private final String originalValue
Annotations
@Nullable

Constructor Detail

Literalback to summary
public Literal(String originalValue, int startPos, int endPos)

Method Detail

getIntLiteralback to summary
public static Literal getIntLiteral(String numberToken, int startPos, int endPos, int radix)

Process the string form of a number, using the specified base if supplied and return an appropriate literal to hold it. Any suffix to indicate a long will be taken into account (either 'l' or 'L' is supported).

Parameters
numberToken:String

the token holding the number as its payload (eg. 1234 or 0xCAFE)

radix:int

the base of number

Returns:Literal

a subtype of Literal that can represent it

getLiteralValueback to summary
public abstract TypedValue getLiteralValue()
getLongLiteralback to summary
public static Literal getLongLiteral(String numberToken, int startPos, int endPos, int radix)
getOriginalValueback to summary
public final String getOriginalValue()
Annotations
@Nullable
getRealLiteralback to summary
public static Literal getRealLiteral(String numberToken, int startPos, int endPos, boolean isFloat)
getValueInternalback to summary
public final TypedValue getValueInternal(ExpressionState state) throws SpelEvaluationException

Implements abstract org.springframework.expression.spel.ast.SpelNodeImpl.getValueInternal.

Annotations
@Override
isNumberLiteralback to summary
public boolean isNumberLiteral()

Determine if this literal represents a number.

Returns:boolean

true if this literal represents a number

Since
6.1
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
toStringASTback to summary
public String toStringAST()

Implements org.springframework.expression.spel.SpelNode.toStringAST.

Doc from org.springframework.expression.spel.SpelNode.toStringAST.

Return the string form of this AST node.

Returns:String

the string form

Annotations
@Override