Package org.openrewrite.java.trait
@NullMarked
@NonNullFields
package org.openrewrite.java.trait
-
ClassDescriptionThe value of an annotation attribute (a JLS §9.7.1 "element value"), in any of the syntactic shapes annotations permit — not only the plain literals covered by
Literal:AttributeValue.Kind.LITERAL—@Foo(name = "s"),@Foo(count = -1)AttributeValue.Kind.CLASS_LITERAL—@Foo(clazz = A.class),int.class,String[].class; KotlinA::classandA::class.javaAttributeValue.Kind.ENUM_CONSTANT—@Retention(RetentionPolicy.RUNTIME), in qualified, fully qualified, or statically imported spellingAttributeValue.Kind.CONSTANT_REFERENCE—@Foo(name = Constants.NAME)or a statically importedNAMEAttributeValue.Kind.NESTED_ANNOTATION—@Foo(bar = @Bar("x"))AttributeValue.Kind.ARRAY—@Foo(exclude = {A.class, B.class})AttributeValue.Kind.EXPRESSION— everything else, e.g.The syntactic shape of an annotation attribute value.Matches expressions in annotation attribute value position: a positional argument of aJ.Annotation, or the right-hand side of a named argument'sJ.Assignment.A literal in Java is either aJ.Literalor aJ.NewArraythat has a non-null initializer that, itself, contains literals or new arrays that recursively contain these constraints.Deprecated.
Literal.Matcher,VariableAccess.Matcher,MethodAccess.Matcher, orAnnotated.Matcherinstead.