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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <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 AttributeValue
    test(org.openrewrite.Cursor cursor)
     

    Methods inherited from class org.openrewrite.trait.SimpleTraitMatcher

    get, higher, lower

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.openrewrite.trait.TraitMatcher

    asVisitor, get, lower, require, require
  • Constructor Details

    • Matcher

      public Matcher()
  • Method Details

    • mapper

      public AttributeValue.Matcher mapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Parameters:
      mapper - A customized mapper, which should be rare. See Literal.Matcher.mapper(ObjectMapper).
      Returns:
      This matcher with a customized mapper set.
    • test

      protected @Nullable AttributeValue test(org.openrewrite.Cursor cursor)
      Specified by:
      test in class org.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:
      asVisitor in interface org.openrewrite.trait.TraitMatcher<AttributeValue>
      Overrides:
      asVisitor in class org.openrewrite.trait.SimpleTraitMatcher<AttributeValue>