Class ELNodes
java.lang.Object
io.micronaut.el.parser.ELNodes
Utilities over the parsed form of an expression.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringRenders 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.static StringRenders the canonical form while replacing mapped function names with their bound-method identities.static StringfunctionIdentity(String owner, String name, List<String> parameterTypes) Builds the stable identity of a method bound as a function.
-
Method Details
-
canonical
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.equalscompares, 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 expressionfunctionName- Maps a function prefix and local name to its bound identity, ornullto retain the parsed name- Returns:
- The canonical form
-
functionIdentity
-