Interface ExpressionLanguageCompiler


public interface ExpressionLanguageCompiler
  • Method Summary

    Modifier and Type
    Method
    Description
    compile(String expression)
    Compiles the given Attribute Expression string into an AttributeExpression that can be evaluated
    getResultType(String expression)
    Returns the ResultType that will be returned by the given Expression
    boolean
    Indicates whether or not the given string is a valid Attribute Expression.
    validateExpression(String expression, boolean allowSurroundingCharacters)
    Attempts to validate the given expression and returns null if the expression is syntactically valid or a String indicating why the expression is invalid otherwise.
  • Method Details

    • compile

      Compiles the given Attribute Expression string into an AttributeExpression that can be evaluated
      Parameters:
      expression - the Attribute Expression to be compiled
      Returns:
      expression that can be evaluated
      Throws:
      IllegalArgumentException - if the given expression is not valid
    • isValidExpression

      boolean isValidExpression(String expression)
      Indicates whether or not the given string is a valid Attribute Expression.
      Parameters:
      expression - to validate
      Returns:
      if is value or not
    • validateExpression

      String validateExpression(String expression, boolean allowSurroundingCharacters)
      Attempts to validate the given expression and returns null if the expression is syntactically valid or a String indicating why the expression is invalid otherwise.
      Parameters:
      expression - to validate
      allowSurroundingCharacters - if true allows characters to surround the Expression, otherwise the expression must be exactly equal to a valid Expression. E.g., /${path} is valid if and only if allowSurroundingCharacters is true
      Returns:
      a String indicating the reason that the expression is not syntactically correct, or null if the expression is syntactically correct
    • getResultType

      Returns the ResultType that will be returned by the given Expression
      Parameters:
      expression - the Expression to evaluate
      Returns:
      result type for the given expression
      Throws:
      IllegalArgumentException - if the given Expression is not a valid Expression Language Expression; the message of this Exception will indicate the problem if the expression is not syntactically valid.