Package org.openrewrite.java.trait
Class AttributeValue.Matcher
java.lang.Object
org.openrewrite.trait.SimpleTraitMatcher<AttributeValue>
org.openrewrite.java.trait.AttributeValue.Matcher
- All Implemented Interfaces:
org.openrewrite.trait.TraitMatcher<AttributeValue>
- Enclosing class:
AttributeValue
public static class AttributeValue.Matcher
extends org.openrewrite.trait.SimpleTraitMatcher<AttributeValue>
Matches expressions in annotation attribute value position: a positional argument of
a
J.Annotation, or the right-hand side of a named argument's
J.Assignment. Attribute name identifiers, J.Empty (as in
@Foo()), and array initializer ELEMENTS are not matched standalone —
elements are reachable through AttributeValue.getElements().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P> org.openrewrite.TreeVisitor<? extends org.openrewrite.Tree, P> asVisitor(org.openrewrite.trait.VisitFunction2<AttributeValue, P> visitor) mapper(com.fasterxml.jackson.databind.ObjectMapper mapper) protected @Nullable AttributeValuetest(org.openrewrite.Cursor cursor) Methods inherited from class org.openrewrite.trait.SimpleTraitMatcher
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
-
mapper
- Parameters:
mapper- A customized mapper, which should be rare. SeeLiteral.Matcher.mapper(ObjectMapper).- Returns:
- This matcher with a customized mapper set.
-
test
- Specified by:
testin classorg.openrewrite.trait.SimpleTraitMatcher<AttributeValue>
-
asVisitor
public <P> org.openrewrite.TreeVisitor<? extends org.openrewrite.Tree,P> asVisitor(org.openrewrite.trait.VisitFunction2<AttributeValue, P> visitor) - Specified by:
asVisitorin interfaceorg.openrewrite.trait.TraitMatcher<AttributeValue>- Overrides:
asVisitorin classorg.openrewrite.trait.SimpleTraitMatcher<AttributeValue>
-