Interface AnnotationValue<T,S>
-
- Type Parameters:
T
- The represented value's unloaded type.S
- The represented value's loaded type.
- All Known Implementing Classes:
AnnotationValue.AbstractBase
,AnnotationValue.ForAnnotationDescription
,AnnotationValue.ForConstant
,AnnotationValue.ForDescriptionArray
,AnnotationValue.ForEnumerationDescription
,AnnotationValue.ForEnumerationDescription.WithUnknownConstant
,AnnotationValue.ForIncompatibleType
,AnnotationValue.ForMismatchedType
,AnnotationValue.ForMissingType
,AnnotationValue.ForMissingValue
,AnnotationValue.ForTypeDescription
,TypePool.Default.LazyTypeDescription.LazyAnnotationValue
,TypePool.Default.LazyTypeDescription.LazyAnnotationValue.ForAnnotationValue
,TypePool.Default.LazyTypeDescription.LazyAnnotationValue.ForArray
,TypePool.Default.LazyTypeDescription.LazyAnnotationValue.ForEnumerationValue
,TypePool.Default.LazyTypeDescription.LazyAnnotationValue.ForTypeValue
public interface AnnotationValue<T,S>
Representation of an unloaded annotation value where all values represent either:- Primitive values (as their wrappers),
String
s or arrays of primitive types or strings. - A
TypeDescription
or an array of such a descriptions. - An
EnumerationDescription
or an array of such a description. - An
AnnotationDescription
or an array of such a description.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AnnotationValue.AbstractBase<U,V>
An abstract base implementation of an unloaded annotation value.static class
AnnotationValue.ForAnnotationDescription<U extends java.lang.annotation.Annotation>
A description of anAnnotation
as a value of another annotation.static class
AnnotationValue.ForConstant<U>
Represents a primitive value, aString
or an array of the latter types.static class
AnnotationValue.ForDescriptionArray<U,V>
Describes a complex array that is the value of an annotation.static class
AnnotationValue.ForEnumerationDescription<U extends java.lang.Enum<U>>
A description of anEnum
as a value of an annotation.static class
AnnotationValue.ForIncompatibleType<U,V>
Represents an annotation value where its declared type does not fulfil an expectation.static class
AnnotationValue.ForMismatchedType<U,V>
Describes an annotation value that does not match the annotation' type for a property.static class
AnnotationValue.ForMissingType<U,V>
An annotation value for a type that could not be loaded.static class
AnnotationValue.ForMissingValue<U,V>
Represents a missing annotation property which is not represented by a default value.static class
AnnotationValue.ForTypeDescription<U extends java.lang.Class<U>>
A description of aClass
as a value of an annotation.static interface
AnnotationValue.Loaded<U>
A loaded variant of anAnnotationValue
.static class
AnnotationValue.RenderingDispatcher
A rendering dispatcher is responsible for resolving annotation values toString
representations.static class
AnnotationValue.State
Represents the state of aAnnotationValue.Loaded
annotation property.
-
Field Summary
Fields Modifier and Type Field Description static AnnotationValue<?,?>
UNDEFINED
An undefined annotation value.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnnotationValue<T,S>
filter(MethodDescription.InDefinedShape property)
Filters this annotation value as a valid value of the provided property.AnnotationValue<T,S>
filter(MethodDescription.InDefinedShape property, TypeDefinition typeDefinition)
Filters this annotation value as a valid value of the provided property.AnnotationValue.State
getState()
Returns the state of the represented annotation value.AnnotationValue.Loaded<S>
load(java.lang.ClassLoader classLoader)
Returns the loaded value of this annotation.T
resolve()
Resolves the unloaded value of this annotation.<W> W
resolve(java.lang.Class<? extends W> type)
Resolves the unloaded value of this annotation.
-
-
-
Field Detail
-
UNDEFINED
static final AnnotationValue<?,?> UNDEFINED
An undefined annotation value.
-
-
Method Detail
-
getState
AnnotationValue.State getState()
Returns the state of the represented annotation value.- Returns:
- The state represented by this instance.
-
filter
AnnotationValue<T,S> filter(MethodDescription.InDefinedShape property)
Filters this annotation value as a valid value of the provided property.- Parameters:
property
- The property to filter against.- Returns:
- This annotation value or a new annotation value that describes why this value is not a valid value for the supplied property.
-
filter
AnnotationValue<T,S> filter(MethodDescription.InDefinedShape property, TypeDefinition typeDefinition)
Filters this annotation value as a valid value of the provided property.- Parameters:
property
- The property to filter against.typeDefinition
- The expected type.- Returns:
- This annotation value or a new annotation value that describes why this value is not a valid value for the supplied property.
-
resolve
T resolve()
Resolves the unloaded value of this annotation. The return value of this method is not defined if this annotation value is invalid.- Returns:
- The unloaded value of this annotation.
-
resolve
<W> W resolve(java.lang.Class<? extends W> type)
Resolves the unloaded value of this annotation. The return value of this method is not defined if this annotation value is invalid.- Type Parameters:
W
- The annotation value's unloaded type.- Parameters:
type
- The annotation value's unloaded type.- Returns:
- The unloaded value of this annotation.
-
load
AnnotationValue.Loaded<S> load(java.lang.ClassLoader classLoader)
Returns the loaded value of this annotation.- Parameters:
classLoader
- The class loader for loading this value.- Returns:
- The loaded value of this annotation.
-
-