Class ExpressionFragment

java.lang.Object
org.zkoss.zkmax.xel.util.ExpressionFragment
All Implemented Interfaces:
Serializable

public class ExpressionFragment extends Object implements Serializable
Represents an expression fragment of an expression. When parse(java.lang.String) is called, a list of fragments is returned. Each of them is either a Spring instance or a ExpressionFragment instance.

Available in ZK EE

For example, "ab${x + y}cd${z}" is broken into the following segments, when parse(java.lang.String) is called:
String("ab"), ExpressionFragment("x+y"), String("cd") and ExpressionFragment("z").

It is used to implement ExpressionFactory based on an evaluator that doesn't support the syntax of ${expr}. The users of XEL expressions rarely needs to use this class.

Since:
3.0.0
Author:
tomyeh
See Also:
  • Method Details

    • parse

      public static final List<Object> parse(String expr)
      Parses an expression into a list of fragments. Each of them is either a Spring instance or a ExpressionFragment instance.

      For example, "ab${x + y}cd${z}" is broken into the following segments, when parse(java.lang.String) is called:
      String("ab"), ExpressionFragment("x+y"), String("cd") and ExpressionFragment("z").

      Parameters:
      expr - the expression that may or may not contain one or multiple ${expr}. It cannot be null.
    • getExpression

      public String getExpression()
      Returns the expression.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object