Package org.openrewrite.gradle.trait
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmatchVariableDeclarations(boolean matchVariableDeclarations) Control whether to match variable declarations (def/val).propertyName(@Nullable String propertyName) Match only properties with the specified name.protected @Nullable ExtraPropertytest(org.openrewrite.Cursor cursor) Tests if the cursor points to an extra property with a string literal value.Methods inherited from class org.openrewrite.gradle.trait.GradleTraitMatcher
getGradleProject, withinBlockMethods inherited from class org.openrewrite.trait.SimpleTraitMatcher
asVisitor, get, higher, lowerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.trait.TraitMatcher
asVisitor, get, lower, require, require
-
Constructor Details
-
Matcher
public Matcher()
-
-
Method Details
-
propertyName
Match only properties with the specified name. -
matchVariableDeclarations
Control whether to match variable declarations (def/val). Default is true. -
test
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:
testin classorg.openrewrite.trait.SimpleTraitMatcher<ExtraProperty>- Parameters:
cursor- The cursor to test- Returns:
- An ExtraProperty trait if matched, null otherwise
-