Package org.openrewrite.java.trait
Class Annotated
java.lang.Object
org.openrewrite.java.trait.Annotated
- All Implemented Interfaces:
org.openrewrite.trait.Trait<org.openrewrite.java.tree.J.Annotation>
public class Annotated
extends Object
implements org.openrewrite.trait.Trait<org.openrewrite.java.tree.J.Annotation>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String attribute) getAttributeValue(String attribute) getDefaultAttribute(@Nullable String defaultAlias) getDefaultAttributeValue(@Nullable String defaultAlias) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.trait.Trait
getCursor, getTree
-
Constructor Details
-
Annotated
public Annotated()
-
-
Method Details
-
getAttributeValue
- Parameters:
attribute- The name of the annotation attribute.- Returns:
- The attribute's value, or empty when the attribute is not explicitly present in the source. Defaults declared on the annotation type are not resolved.
-
getDefaultAttributeValue
@Incubating(since="8.87.0") public Optional<AttributeValue> getDefaultAttributeValue(@Nullable String defaultAlias) - Parameters:
defaultAlias- The name of the annotation attribute that is aliased to "value", if any.- Returns:
- The attribute value in any syntactic shape.
-
getDefaultAttribute
- Parameters:
defaultAlias- The name of the annotation attribute that is aliased to "value", if any.- Returns:
- The attribute value.
-
getAttribute
-