public interface

ParserContext

org.springframework.expression.ParserContext
Known Indirect Subclasses

Class Overview

Input provided to an expression parser that can influence an expression parsing/compilation routine.

Summary

Fields
public static final ParserContext TEMPLATE_EXPRESSION The default ParserContext implementation that enables template expression parsing mode.
Public Methods
abstract String getExpressionPrefix()
For template expressions, returns the prefix that identifies the start of an expression block within a string.
abstract String getExpressionSuffix()
For template expressions, return the prefix that identifies the end of an expression block within a string.
abstract boolean isTemplate()
Whether or not the expression being parsed is a template.

Fields

public static final ParserContext TEMPLATE_EXPRESSION

The default ParserContext implementation that enables template expression parsing mode. The expression prefix is #{ and the expression suffix is }.

See Also

Public Methods

public abstract String getExpressionPrefix ()

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

Returns
  • the prefix that identifies the start of an expression

public abstract String getExpressionSuffix ()

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

Returns
  • the suffix that identifies the end of an expression

public abstract boolean isTemplate ()

Whether or not the expression being parsed is a template. A template expression consists of literal text that can be mixed with evaluatable blocks. Some examples:

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

Returns
  • true if the expression is a template, false otherwise