Class PatternMatchExp

All Implemented Interfaces:
XMLSerializable
Direct Known Subclasses:
LikeExp, LikeIgnoreCaseExp, NotLikeExp, NotLikeIgnoreCaseExp

public abstract sealed class PatternMatchExp extends ConditionExp permits LikeExp, NotLikeExp (not exhaustive)
Superclass of pattern matching nodes. Assumes that subclass is a binary expression with the second operand being a pattern.
Since:
5.0
  • Field Details

    • pattern

      protected Pattern pattern
    • patternCompiled

      protected boolean patternCompiled
    • escapeChar

      protected char escapeChar
  • Constructor Details

    • PatternMatchExp

      protected PatternMatchExp(Object... operands)

      This method will return an escape character for the like clause. The escape character will eventually end up in the query as ...(t0.foo LIKE ? {escape '|'}) where the pipe symbol is the escape character.

      Note that having no escape character is represented as the character 0.

  • Method Details

    • getEscapeChar

      public char getEscapeChar()
    • setEscapeChar

      public void setEscapeChar(char value)

      This method allows the setting of the escape character. The escape character can be used in a LIKE clause. The character 0 signifies no escape character. The escape character '?' is disallowed.

    • isIgnoringCase

      public abstract boolean isIgnoringCase()
    • matchPattern

      protected boolean matchPattern(String string)
    • getPattern

      protected Pattern getPattern()
    • setOperand

      public void setOperand(int index, Object value)
      Description copied from class: Expression
      Sets a value of operand at index, growing the operands array if needed. Operand indexing starts at 0. A Persistent is replaced with its ObjectId. A nested expression is asked first whether this node is a valid parent for it, see Expression.isValidParent(Expression).
      Overrides:
      setOperand in class Expression