接口 ParserContext
- 所有已知实现类:
TemplateParserContext
public interface ParserContext
Input provided to an expression parser that can influence an expression
parsing/compilation routine.
- 从以下版本开始:
- 4.0
- 作者:
- Keith Donald, Andy Clement
-
字段概要
字段修饰符和类型字段说明static final ParserContextThe default ParserContext implementation that enables template expression parsing mode. -
方法概要
修饰符和类型方法说明For template expressions, returns the prefix that identifies the start of an expression block within a string.For template expressions, return the prefix that identifies the end of an expression block within a string.booleanWhether or not the expression being parsed is a template.
-
字段详细资料
-
TEMPLATE_EXPRESSION
The default ParserContext implementation that enables template expression parsing mode. The expression prefix is "#{" and the expression suffix is "}".- 另请参阅:
-
-
方法详细资料
-
isTemplate
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}- 返回:
- true if the expression is a template, false otherwise
-
getExpressionPrefix
String getExpressionPrefix()For template expressions, returns the prefix that identifies the start of an expression block within a string. For example: "${"- 返回:
- the prefix that identifies the start of an expression
-
getExpressionSuffix
String getExpressionSuffix()For template expressions, return the prefix that identifies the end of an expression block within a string. For example: "}"- 返回:
- the suffix that identifies the end of an expression
-