Package: org.codehaus.groovy.macro.matcher.internal

## [Groovy] Class MatchingConstraintsBuilder

- org.codehaus.groovy.macro.matcher.internal.MatchingConstraintsBuilder

-     class MatchingConstraintsBuilder
      extends Object

  Builder for MatchingConstraints instances.

  Since:
    2.5.0

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `ConstraintPredicate<TreeContext>` | `eventually` Predicate that must match somewhere in the current tree context path.
    `Set<String>` | `placeholders` Placeholder names accepted during matching.
    `ConstraintPredicate<Token>` | `tokenPredicate` Predicate used to compare tokens.
    `Set<String>` | `varargPlaceholders` Placeholder names that can absorb multiple arguments.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `MatchingConstraintsBuilder()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `MatchingConstraintsBuilder` | `anyToken()` Configures token matching to accept any token.
    `` | `MatchingConstraints` | `build(Closure spec)` Builds constraints from the supplied builder closure.
    `` | `MatchingConstraintsBuilder` | `eventually(Closure<Boolean> predicate)` Configures a predicate that must match an enclosing tree context.
    `` | `MatchingConstraintsBuilder` | `placeholder(String[] names)` Registers one or more placeholder names.
    `` | `Object` | `propertyMissing(String name)` Treats unknown property names as placeholder identifiers.
    `` | `MatchingConstraintsBuilder` | `token(Closure<Boolean> predicate)` Configures a token predicate.
    `` | `MatchingConstraintsBuilder` | `varargPlaceholder(String[] names)` Registers one or more vararg placeholder names.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### ConstraintPredicate<TreeContext> eventually

      Predicate that must match somewhere in the current tree context path.

    - #### Set<String> placeholders

      Placeholder names accepted during matching.

    - #### ConstraintPredicate<Token> tokenPredicate

      Predicate used to compare tokens.

    - #### Set<String> varargPlaceholders

      Placeholder names that can absorb multiple arguments.

  - ### Constructor Detail

    - #### MatchingConstraintsBuilder()

  - ### Method Detail

    - #### MatchingConstraintsBuilder anyToken()

      Configures token matching to accept any token.

      Returns:
        this builder

    - #### MatchingConstraints build(@DelegatesTo(value=MatchingConstraintsBuilder, strategy=Closure.DELEGATE_ONLY)
      Closure spec)

      Builds constraints from the supplied builder closure.

      Parameters:
        `spec` - the builder closure
      Returns:
        the built constraints

    - #### MatchingConstraintsBuilder eventually(@DelegatesTo(value=TreeContext, strategy=Closure.DELEGATE_FIRST)
      Closure<Boolean> predicate)

      Configures a predicate that must match an enclosing tree context.

      Parameters:
        `predicate` - the tree-context predicate closure
      Returns:
        this builder

    - #### MatchingConstraintsBuilder placeholder(String[] names)

      Registers one or more placeholder names.

      Parameters:
        `names` - the placeholder names
      Returns:
        this builder

    - #### Object propertyMissing(String name)

      Treats unknown property names as placeholder identifiers.

      Parameters:
        `name` - the missing property name
      Returns:
        `name`

    - #### MatchingConstraintsBuilder token(@DelegatesTo(value=Token, strategy=Closure.DELEGATE_FIRST)
      Closure<Boolean> predicate)

      Configures a token predicate.

      Parameters:
        `predicate` - the token predicate closure
      Returns:
        this builder

    - #### MatchingConstraintsBuilder varargPlaceholder(String[] names)

      Registers one or more vararg placeholder names.

      Parameters:
        `names` - the vararg placeholder names
      Returns:
        this builder