Top Description Fields Constructors Methods
org.springframework.expression.common

public Class TemplateParserContext

extends Object
implements ParserContext
Class Inheritance
All Implemented Interfaces
org.springframework.expression.ParserContext
Imports
org.springframework.expression.ParserContext

Configurable ParserContext implementation for template parsing. Expects the expression prefix and suffix as constructor arguments.
Author
Juergen Hoeller
Since
3.0

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
TemplateParserContext()

Create a new TemplateParserContext with the default "#{" prefix and "}" suffix.

public
TemplateParserContext(String
the expression prefix to use
expressionPrefix
,
String
the expression suffix to use
expressionSuffix
)

Create a new TemplateParserContext for the given prefix and suffix.

Method Summary

Modifier and TypeMethod and Description
public final String
getExpressionPrefix()

Implements org.springframework.expression.ParserContext.getExpressionPrefix.

For template expressions, returns the prefix that identifies the start of an expression block within a string.

public final String
getExpressionSuffix()

Implements org.springframework.expression.ParserContext.getExpressionSuffix.

For template expressions, return the prefix that identifies the end of an expression block within a string.

public final boolean
isTemplate()

Implements org.springframework.expression.ParserContext.isTemplate.

Whether the expression being parsed is a template.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expressionPrefixback to summary
private final String expressionPrefix
expressionSuffixback to summary
private final String expressionSuffix

Constructor Detail

TemplateParserContextback to summary
public TemplateParserContext()

Create a new TemplateParserContext with the default "#{" prefix and "}" suffix.

TemplateParserContextback to summary
public TemplateParserContext(String expressionPrefix, String expressionSuffix)

Create a new TemplateParserContext for the given prefix and suffix.

Parameters
expressionPrefix:String

the expression prefix to use

expressionSuffix:String

the expression suffix to use

Method Detail

getExpressionPrefixback to summary
public final String getExpressionPrefix()

Implements org.springframework.expression.ParserContext.getExpressionPrefix.

Doc from org.springframework.expression.ParserContext.getExpressionPrefix.

For template expressions, returns the prefix that identifies the start of an expression block within a string. For example: "${"

Returns:String

the prefix that identifies the start of an expression

Annotations
@Override
getExpressionSuffixback to summary
public final String getExpressionSuffix()

Implements org.springframework.expression.ParserContext.getExpressionSuffix.

Doc from org.springframework.expression.ParserContext.getExpressionSuffix.

For template expressions, return the prefix that identifies the end of an expression block within a string. For example: "}"

Returns:String

the suffix that identifies the end of an expression

Annotations
@Override
isTemplateback to summary
public final boolean isTemplate()

Implements org.springframework.expression.ParserContext.isTemplate.

Doc from org.springframework.expression.ParserContext.isTemplate.

Whether the expression being parsed is a template.

A template consists of literal text that can be mixed with expressions. Some examples:

    Some literal text
    Hello #{name.firstName}!
    #{3 + 4}
Returns:boolean

true if the expression is a template, false otherwise

Annotations
@Override