Class ELNodes

java.lang.Object
io.micronaut.el.parser.ELNodes

public final class ELNodes extends Object
Utilities over the parsed form of an expression.
Since:
1.0
Author:
Denis Stepanov
  • Method Details

    • canonical

      public static String canonical(ELNode node)
      Renders a parsed expression in a canonical form, so that two expressions that differ only in whitespace, in the delimiters or in the spelling of an operator render identically.

      The canonical form is what jakarta.el.Expression.equals compares, which the specification defines as representing the same expression "taking whitespace and operator aliases into account". Every sub-expression is parenthesised, so precedence never has to be reconstructed.

      Parameters:
      node - The parsed expression
      Returns:
      The canonical form
    • canonical

      public static String canonical(ELNode node, BiFunction<String, String, @Nullable String> functionName)
      Renders the canonical form while replacing mapped function names with their bound-method identities. The Jakarta EL equality contract compares bound functions rather than the prefixes used to name them.
      Parameters:
      node - The parsed expression
      functionName - Maps a function prefix and local name to its bound identity, or null to retain the parsed name
      Returns:
      The canonical form
    • functionIdentity

      public static String functionIdentity(String owner, String name, List<String> parameterTypes)
      Builds the stable identity of a method bound as a function.
      Parameters:
      owner - The declaring class name
      name - The method name
      parameterTypes - The parameter type names
      Returns:
      The identity