org.springframework.expression.spel.ast

## Class OperatorMatches

- java.lang.Object
- - org.springframework.expression.spel.ast.SpelNodeImpl
  - - org.springframework.expression.spel.ast.Operator
    - - org.springframework.expression.spel.ast.OperatorMatches

- All Implemented Interfaces:
    SpelNode

      public class OperatorMatches
      extends Operator

  Implements the matches operator. Matches takes two operands. The first is a string and the second is a java regex. It will return true when getValue() is called if the first operand matches the regex.
  Since:
    3.0
  Author:
    Andy Clement

- - ### Field Summary

    - ### Fields inherited from class org.springframework.expression.spel.ast.SpelNodeImpl

      `children, pos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OperatorMatches(int pos, SpelNodeImpl... operands)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BooleanTypedValue` | `getValueInternal(ExpressionState state)` Check the first operand matches the regex specified as the second operand.

    - ### Methods inherited from class org.springframework.expression.spel.ast.Operator

      `getLeftOperand, getOperatorName, getRightOperand, toStringAST`

    - ### Methods inherited from class org.springframework.expression.spel.ast.SpelNodeImpl

      `getChild, getChildCount, getEndPosition, getObjectClass, getPreviousChild, getStartPosition, getTypedValue, getValue, getValue, getValueRef, isWritable, nextChildIs, setValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OperatorMatches

          public OperatorMatches(int pos,
                         SpelNodeImpl... operands)

  - ### Method Detail

    - #### getValueInternal

          public BooleanTypedValue getValueInternal(ExpressionState state)
                                             throws EvaluationException

      Check the first operand matches the regex specified as the second operand.
      Specified by:
        `getValueInternal` in class `SpelNodeImpl`
      Parameters:
        `state` - the expression state
      Returns:
        true if the first operand matches the regex specified as the second operand, otherwise false
      Throws:
        `EvaluationException` - if there is a problem evaluating the expression (e.g. the regex is invalid)