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 Annotation> |
annotate(AnnotationValue<T> annotationValue)
Annotate this element with the given annotation type.
|
default <T extends Annotation> |
annotate(Class<T> annotationType)
Annotate this element with the given annotation type.
|
default <T extends Annotation> |
annotate(Class<T> annotationType,
Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
default Element |
annotate(String annotationType)
Annotate this element with the given annotation type.
|
default <T extends Annotation> |
annotate(String annotationType,
Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
default String |
getDescription()
A description that describes this object.
|
default String |
getDescription(boolean simple)
Allows returning a more simple description if requested.
|
default Optional<String> |
getDocumentation() |
default Set<ElementModifier> |
getModifiers() |
String |
getName() |
Object |
getNativeType()
Returns the native underlying type.
|
default 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 Annotation> |
removeAnnotation(Class<T> annotationType) |
default Element |
removeAnnotation(String annotationType)
Removes an annotation of the given type from the element.
|
default <T extends Annotation> |
removeAnnotationIf(Predicate<AnnotationValue<T>> predicate)
Removes all annotations that pass the given predicate.
|
default <T extends Annotation> |
removeStereotype(Class<T> annotationType)
Removes a stereotype annotation of the given type from the element.
|
default Element |
removeStereotype(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, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, 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
getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
getAnnotationMetadata
static final Element[] EMPTY_ELEMENT_ARRAY
default boolean isPackagePrivate()
boolean isProtected()
boolean isPublic()
@NonNull Object getNativeType()
default Set<ElementModifier> getModifiers()
ElementModifier
types for this class element@NonNull default <T extends Annotation> Element annotate(@NonNull String annotationType, @NonNull Consumer<AnnotationValueBuilder<T>> consumer)
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
default Element removeAnnotation(@NonNull 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 Annotation> Element removeAnnotation(@NonNull Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation typeremoveAnnotation(String)
default <T extends Annotation> Element removeAnnotationIf(@NonNull Predicate<AnnotationValue<T>> predicate)
T
- The annotation generic typepredicate
- The predicatedefault Element removeStereotype(@NonNull String annotationType)
annotationType
- The annotation typedefault <T extends Annotation> Element removeStereotype(@NonNull Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation type@NonNull default Element annotate(@NonNull String annotationType)
annotationType
- The annotation type@NonNull default <T extends Annotation> Element annotate(@NonNull Class<T> annotationType, @NonNull Consumer<AnnotationValueBuilder<T>> consumer)
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
@NonNull default <T extends Annotation> Element annotate(@NonNull Class<T> annotationType)
T
- The annotation generic typeannotationType
- The annotation type@NonNull default <T extends Annotation> Element annotate(@NonNull AnnotationValue<T> annotationValue)
T
- The annotation generic typeannotationValue
- The annotation type@NonNull default String getSimpleName()
default boolean isAbstract()
default boolean isStatic()
default boolean isPrivate()
default boolean isFinal()
@NonNull default String getDescription()
Described
getDescription
in interface Described
@NonNull default String getDescription(boolean simple)
Described
getDescription
in interface Described
simple
- True if a simple description is required