Class ExtraProperty.Matcher

java.lang.Object
org.openrewrite.trait.SimpleTraitMatcher<ExtraProperty>
org.openrewrite.gradle.trait.GradleTraitMatcher<ExtraProperty>
org.openrewrite.gradle.trait.ExtraProperty.Matcher
All Implemented Interfaces:
org.openrewrite.trait.TraitMatcher<ExtraProperty>
Enclosing class:
ExtraProperty

public static class ExtraProperty.Matcher extends GradleTraitMatcher<ExtraProperty>
  • Constructor Details

    • Matcher

      public Matcher()
  • Method Details

    • propertyName

      public ExtraProperty.Matcher propertyName(@Nullable String propertyName)
      Match only properties with the specified name.
    • matchVariableDeclarations

      public ExtraProperty.Matcher matchVariableDeclarations(boolean matchVariableDeclarations)
      Control whether to match variable declarations (def/val). Default is true.
    • test

      protected @Nullable ExtraProperty test(org.openrewrite.Cursor cursor)
      Tests if the cursor points to an extra property with a string literal value. Returns null if:
      • The node is not an extra property declaration
      • The property value is not a string literal (e.g., variable reference, expression)
      • The property name doesn't match the configured filter (if set)
      Specified by:
      test in class org.openrewrite.trait.SimpleTraitMatcher<ExtraProperty>
      Parameters:
      cursor - The cursor to test
      Returns:
      An ExtraProperty trait if matched, null otherwise