@Internal public abstract class AbstractEnvironmentAnnotationMetadata extends Object implements AnnotationMetadata
AnnotationMetadata that is environment specific.CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBEREMPTY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEnvironmentAnnotationMetadata(AnnotationMetadata targetMetadata)
Construct a new environment aware annotation metadata.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<Boolean> |
booleanValue(Class<? extends Annotation> annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
Optional<Boolean> |
booleanValue(String annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
Optional<Class> |
classValue(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
Optional<Class> |
classValue(String annotation,
String member)
The value of the annotation as a Class.
|
<T> Class<T>[] |
classValues(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
<T> Class<T>[] |
classValues(String annotation,
String member)
The value of the annotation as a Class.
|
OptionalDouble |
doubleValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
OptionalDouble |
doubleValue(String annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
<E extends Enum> |
enumValue(Class<? extends Annotation> annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
<E extends Enum> |
enumValue(String annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
<E extends Enum> |
enumValues(String annotation,
String member,
Class<E> enumType)
The enum values for the given annotation.
|
<T extends Annotation> |
findAnnotation(String annotation)
Find an
AnnotationValue for the given annotation name. |
<T extends Annotation> |
findDeclaredAnnotation(String annotation)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
AnnotationMetadata |
getAnnotationMetadata() |
Set<String> |
getAnnotationNames()
All the annotation names this metadata declares.
|
List<String> |
getAnnotationNamesByStereotype(String stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
Optional<Class<? extends Annotation>> |
getAnnotationType(String name)
Gets the type for a given annotation if it is present on the classpath.
|
Optional<Class<? extends Annotation>> |
getAnnotationType(String name,
ClassLoader classLoader)
Gets the type for a given annotation if it is present on the classpath.
|
Optional<Class<? extends Annotation>> |
getAnnotationTypeByStereotype(Class<? extends Annotation> stereotype)
Find the first annotation name for the given stereotype.
|
Optional<Class<? extends Annotation>> |
getAnnotationTypeByStereotype(String stereotype)
Find the first annotation name for the given stereotype.
|
<T extends Annotation> |
getAnnotationValuesByType(Class<T> annotationType)
Gets all the annotation values by the given repeatable type.
|
Set<String> |
getDeclaredAnnotationNames()
All the declared annotation names this metadata declares.
|
List<String> |
getDeclaredAnnotationNamesByStereotype(String stereotype)
Resolve all of the annotations names for the given stereotype that are declared annotations.
|
<T extends Annotation> |
getDeclaredAnnotationValuesByType(Class<T> annotationType)
Gets only declared annotation values by the given repeatable type.
|
<T> Optional<T> |
getDefaultValue(String annotation,
String member,
Argument<T> requiredType)
Return the default value for the given annotation member.
|
<T> Optional<T> |
getDefaultValue(String annotation,
String member,
Class<T> requiredType)
Return the default value for the given annotation member.
|
protected abstract Environment |
getEnvironment()
Resolves the
Environment for this metadata. |
<T> Optional<T> |
getValue(String annotation,
String member,
Argument<T> requiredType)
Get the value of the given annotation member.
|
<T> OptionalValues<T> |
getValues(String annotation,
Class<T> valueType)
Get all of the values for the given annotation and type of the underlying values.
|
boolean |
hasAnnotation(String annotation)
Checks whether this object has the given annotation on the object itself or inherited from a parent.
|
boolean |
hasDeclaredAnnotation(String annotation)
Checks whether this object has the given annotation directly declared on the object.
|
boolean |
hasDeclaredStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
|
boolean |
hasStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
|
OptionalInt |
intValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
OptionalInt |
intValue(String annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
boolean |
isFalse(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isFalse(String annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(String annotation,
String member)
Returns whether the value of the given member is true.
|
OptionalLong |
longValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
OptionalLong |
longValue(String annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
Optional<String> |
stringValue(Class<? extends Annotation> annotation,
String member)
The value as an optional string for the given annotation and member.
|
Optional<String> |
stringValue(String annotation,
String member)
The value as an optional string for the given annotation and member.
|
String[] |
stringValues(Class<? extends Annotation> annotation,
String member)
The values as string array for the given annotation and member.
|
<T extends Annotation> |
synthesize(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends Annotation> |
synthesizeAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
<T extends Annotation> |
synthesizeDeclared(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends Annotation> |
synthesizeDeclaredAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbooleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, enumValue, enumValue, enumValues, enumValues, enumValues, findAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, intValue, isAnnotationPresent, isAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, stringValue, stringValue, stringValues, stringValues, stringValuesgetAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, synthesize, synthesizeAll, synthesizeDeclared, synthesizeDeclaredprotected AbstractEnvironmentAnnotationMetadata(AnnotationMetadata targetMetadata)
targetMetadata - The target annotation metadatapublic AnnotationMetadata getAnnotationMetadata()
@Nullable public <T extends Annotation> T synthesize(@NonNull Class<T> annotationClass)
AnnotationSourcesynthesize in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation class@Nullable public <T extends Annotation> T synthesizeDeclared(@NonNull Class<T> annotationClass)
AnnotationSourceThis method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation classpublic <T> Optional<T> getValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType)
AnnotationMetadatagetValue in interface AnnotationMetadataT - The valueannotation - The annotation classmember - The annotation memberrequiredType - The required typeOptional of the valuepublic <T> Class<T>[] classValues(@NonNull String annotation, @NonNull String member)
AnnotationMetadataclassValues in interface AnnotationMetadataT - The type of the classannotation - The annotationmember - The annotation memberOptional classpublic <T> Class<T>[] classValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataclassValues in interface AnnotationMetadataT - The type of the classannotation - The annotationmember - The annotation memberOptional classpublic boolean isTrue(@NonNull String annotation, @NonNull String member)
AnnotationMetadataisTrue in interface AnnotationMetadataannotation - The annotation classmember - The annotation memberpublic boolean isFalse(@NonNull String annotation, @NonNull String member)
AnnotationMetadataisFalse in interface AnnotationMetadataannotation - The annotation classmember - The annotation member@NonNull public Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@NonNull Class<? extends Annotation> stereotype)
AnnotationMetadatagetAnnotationTypeByStereotype in interface AnnotationMetadatastereotype - The stereotype@NonNull public Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nullable String stereotype)
AnnotationMetadatagetAnnotationTypeByStereotype in interface AnnotationMetadatastereotype - The stereotype@NonNull public Optional<Class> classValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadataclassValue in interface AnnotationMetadataannotation - The annotationmember - The annotation memberOptional class@NonNull public Optional<Class> classValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataclassValue in interface AnnotationMetadataannotation - The annotationmember - The annotation memberOptional classpublic <E extends Enum> Optional<E> enumValue(@NonNull String annotation, @NonNull String member, Class<E> enumType)
AnnotationMetadataenumValue in interface AnnotationMetadataE - The enum typeannotation - The annotationmember - The annotation memberenumType - The enum typeOptional classpublic <E extends Enum> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType)
AnnotationMetadataenumValue in interface AnnotationMetadataE - The enum typeannotation - The annotationmember - The annotation memberenumType - The enum typeOptional classpublic <E extends Enum> E[] enumValues(@NonNull String annotation, @NonNull String member, Class<E> enumType)
AnnotationMetadataenumValues in interface AnnotationMetadataE - The enum typeannotation - The annotationmember - The annotation memberenumType - The enum typepublic Optional<Boolean> booleanValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadatabooleanValue in interface AnnotationMetadataannotation - The annotationmember - The memberpublic Optional<Boolean> booleanValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadatabooleanValue in interface AnnotationMetadataannotation - The annotationmember - The member@NonNull public Optional<String> stringValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadatastringValue in interface AnnotationMetadataannotation - The annotationmember - The member@NonNull public String[] stringValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadatastringValues in interface AnnotationMetadataannotation - The annotationmember - The member@NonNull public Optional<String> stringValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadatastringValue in interface AnnotationMetadataannotation - The annotationmember - The memberpublic OptionalLong longValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadataOptionalLong for the given annotation and member.longValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalLong valuepublic OptionalLong longValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataOptionalLong for the given annotation and member.longValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalLong value@NonNull public OptionalInt intValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadataOptionalInt for the given annotation and member.intValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalInt value@NonNull public OptionalInt intValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataOptionalInt for the given annotation and member.intValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalInt value@NonNull public OptionalDouble doubleValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadataOptionalDouble for the given annotation and member.doubleValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalDouble value@NonNull public OptionalDouble doubleValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataOptionalDouble for the given annotation and member.doubleValue in interface AnnotationMetadataannotation - The annotationmember - The memberOptionalDouble valuepublic boolean isTrue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataisTrue in interface AnnotationMetadataannotation - The annotation classmember - The annotation memberpublic boolean isFalse(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadataisFalse in interface AnnotationMetadataannotation - The annotation classmember - The annotation member@NonNull public Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name)
AnnotationMetadatagetAnnotationType in interface AnnotationMetadataname - The type name@NonNull public Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name, @NonNull ClassLoader classLoader)
AnnotationMetadatagetAnnotationType in interface AnnotationMetadataname - The type nameclassLoader - The ClassLoader to load the type@NonNull public <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByType(@NonNull Class<T> annotationType)
AnnotationMetadatagetAnnotationValuesByType in interface AnnotationMetadataT - The annotation typeannotationType - The annotation type@NonNull public <T extends Annotation> List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull Class<T> annotationType)
AnnotationMetadatagetDeclaredAnnotationValuesByType in interface AnnotationMetadataT - The annotation typeannotationType - The annotation type@NonNull public <T extends Annotation> T[] synthesizeAnnotationsByType(@NonNull Class<T> annotationClass)
AnnotationSourcesynthesizeAnnotationsByType in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation type@NonNull public <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(@NonNull Class<T> annotationClass)
AnnotationSourcesynthesizeDeclaredAnnotationsByType in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation typepublic boolean hasDeclaredAnnotation(@Nullable String annotation)
AnnotationMetadatahasDeclaredAnnotation in interface AnnotationMetadataannotation - The annotationpublic boolean hasAnnotation(@Nullable String annotation)
AnnotationMetadatahasAnnotation in interface AnnotationMetadataannotation - The annotationpublic boolean hasStereotype(@Nullable String annotation)
AnnotationMetadataChecks whether this object has the given annotation stereotype on the object itself or inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
hasStereotype in interface AnnotationMetadataannotation - The annotationpublic boolean hasDeclaredStereotype(@Nullable String annotation)
AnnotationMetadataChecks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
hasDeclaredStereotype in interface AnnotationMetadataannotation - The annotation@NonNull public List<String> getAnnotationNamesByStereotype(String stereotype)
AnnotationMetadatagetAnnotationNamesByStereotype in interface AnnotationMetadatastereotype - The annotation names@NonNull public Set<String> getAnnotationNames()
AnnotationMetadatagetAnnotationNames in interface AnnotationMetadata@NonNull public Set<String> getDeclaredAnnotationNames()
AnnotationMetadatagetDeclaredAnnotationNames in interface AnnotationMetadata@NonNull public List<String> getDeclaredAnnotationNamesByStereotype(String stereotype)
AnnotationMetadatagetDeclaredAnnotationNamesByStereotype in interface AnnotationMetadatastereotype - The stereotype@NonNull public <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(@NonNull String annotation)
AnnotationSourceAnnotationValue for the given annotation name.findAnnotation in interface AnnotationSourceT - The annotation typeannotation - The annotation nameAnnotationValue instance@NonNull public <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull String annotation)
AnnotationSourcefindDeclaredAnnotation in interface AnnotationSourceT - The annotation typeannotation - The annotation nameAnnotationValue instance@NonNull public <T> OptionalValues<T> getValues(@NonNull String annotation, @NonNull Class<T> valueType)
AnnotationMetadatagetValues in interface AnnotationMetadataT - Generic typeannotation - The annotation namevalueType - valueTypeOptionalValues@NonNull public <T> Optional<T> getDefaultValue(@NonNull String annotation, @NonNull String member, @NonNull Class<T> requiredType)
AnnotationMetadatagetDefaultValue in interface AnnotationMetadataT - The required generic typeannotation - The annotationmember - The memberrequiredType - The required type@NonNull public <T> Optional<T> getDefaultValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType)
AnnotationMetadatagetDefaultValue in interface AnnotationMetadataT - The required generic typeannotation - The annotationmember - The memberrequiredType - The required type@Nullable protected abstract Environment getEnvironment()
Environment for this metadata.