public interface Element extends AnnotationMetadataDelegate, AnnotatedElement, Described
Modifier and Type | Field and Description |
---|---|
static Element[] |
EMPTY_ELEMENT_ARRAY
An empty array of elements.
|
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier and Type | Method and Description |
---|---|
default <T extends java.lang.annotation.Annotation> |
annotate(AnnotationValue<T> annotationValue)
Annotate this element with the given annotation type.
|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.Class<T> annotationType)
Annotate this element with the given annotation type.
|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.Class<T> annotationType,
java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
default Element |
annotate(java.lang.String annotationType)
Annotate this element with the given annotation type.
|
default <T extends java.lang.annotation.Annotation> |
annotate(java.lang.String annotationType,
java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
default java.lang.String |
getDescription()
A description that describes this object.
|
default java.lang.String |
getDescription(boolean simple)
Allows returning a more simple description if requested.
|
default java.util.Optional<java.lang.String> |
getDocumentation() |
default java.util.Set<ElementModifier> |
getModifiers() |
java.lang.String |
getName() |
java.lang.Object |
getNativeType()
Returns the native underlying type.
|
default java.lang.String |
getSimpleName()
The simple name of the element.
|
default boolean |
isAbstract() |
default boolean |
isFinal() |
default boolean |
isPackagePrivate() |
default boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
default boolean |
isStatic() |
default <T extends java.lang.annotation.Annotation> |
removeAnnotation(java.lang.Class<T> annotationType) |
default Element |
removeAnnotation(java.lang.String annotationType)
Removes an annotation of the given type from the element.
|
default <T extends java.lang.annotation.Annotation> |
removeAnnotationIf(java.util.function.Predicate<AnnotationValue<T>> predicate)
Removes all annotations that pass the given predicate.
|
default <T extends java.lang.annotation.Annotation> |
removeStereotype(java.lang.Class<T> annotationType)
Removes a stereotype annotation of the given type from the element.
|
default Element |
removeStereotype(java.lang.String annotationType)
Removes a stereotype of the given name from the element.
|
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
getAnnotationMetadata
static final Element[] EMPTY_ELEMENT_ARRAY
@NonNull java.lang.String getName()
default boolean isPackagePrivate()
boolean isProtected()
boolean isPublic()
@NonNull java.lang.Object getNativeType()
default java.util.Set<ElementModifier> getModifiers()
ElementModifier
types for this class element@NonNull default <T extends java.lang.annotation.Annotation> Element annotate(@NonNull java.lang.String annotationType, @NonNull java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
default Element removeAnnotation(@NonNull java.lang.String annotationType)
If the annotation features any stereotypes these will also be removed unless there are other annotations that reference the stereotype to be removed.
In the case of repeatable annotations this method will remove all repeated annotations, effectively clearing out all declared repeated annotations of the given type.
annotationType
- The annotation typedefault <T extends java.lang.annotation.Annotation> Element removeAnnotation(@NonNull java.lang.Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation typeremoveAnnotation(String)
default <T extends java.lang.annotation.Annotation> Element removeAnnotationIf(@NonNull java.util.function.Predicate<AnnotationValue<T>> predicate)
T
- The annotation generic typepredicate
- The predicatedefault Element removeStereotype(@NonNull java.lang.String annotationType)
annotationType
- The annotation typedefault <T extends java.lang.annotation.Annotation> Element removeStereotype(@NonNull java.lang.Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation type@NonNull default Element annotate(@NonNull java.lang.String annotationType)
annotationType
- The annotation type@NonNull default <T extends java.lang.annotation.Annotation> Element annotate(@NonNull java.lang.Class<T> annotationType, @NonNull java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
@NonNull default <T extends java.lang.annotation.Annotation> Element annotate(@NonNull java.lang.Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation type@NonNull default <T extends java.lang.annotation.Annotation> Element annotate(@NonNull AnnotationValue<T> annotationValue)
T
- The annotation generic typeannotationValue
- The annotation type@NonNull default java.lang.String getSimpleName()
default boolean isAbstract()
default boolean isStatic()
default java.util.Optional<java.lang.String> getDocumentation()
default boolean isPrivate()
default boolean isFinal()
@NonNull default java.lang.String getDescription()
Described
getDescription
in interface Described
@NonNull default java.lang.String getDescription(boolean simple)
Described
getDescription
in interface Described
simple
- True if a simple description is required