接口 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 ParserContext
    The 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.
    boolean
    Whether or not the expression being parsed is a template.
  • 字段详细资料

    • TEMPLATE_EXPRESSION

      static final ParserContext 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