类 AnnotationTypeMapping
java.lang.Object
cn.taketoday.core.annotation.AnnotationTypeMapping
Provides mapping information for a single annotation (or meta-annotation) in
the context of a root annotation type.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Sam Brannen, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) final classA collection ofAnnotationTypeMapping.MirrorSets.MirrorSetinstances that provides details of all defined mirrors. -
字段概要
字段修饰符和类型字段说明private final int[]final AnnotationGet the source annotation for this mapping.final Class<? extends Annotation>Get the type of the mapped annotation.private final int[]private final AnnotationTypeMapping[]private final int[]final intGet the distance of this mapping.private static final AnnotationTypeMapping.MirrorSets.MirrorSet[]final List<Class<? extends Annotation>>final AttributeMethodsthe annotation attributes for the mapping annotation type.Get the mirror sets for this type mapping.final AnnotationTypeMappingGet the root mapping.final AnnotationTypeMappingGet the source of the mapping ornull.final booleanDetermine if the mapped annotation is synthesizable. -
构造器概要
构造器构造器说明AnnotationTypeMapping(AnnotationTypeMapping source, Class<? extends Annotation> annotationType, Annotation annotation, Set<Class<? extends Annotation>> visitedAnnotationTypes) -
方法概要
修饰符和类型方法说明private voidprivate void(专用程序包) voidMethod called after all mappings have been set.private static booleanareEquivalent(Annotation annotation, Object extractedValue, ValueExtractor valueExtractor) private static booleanareEquivalent(Class<?>[] value, String[] extractedValue) private static booleanareEquivalent(Class<?> value, String extractedValue) private static booleanareEquivalent(Object value, Object extractedValue, ValueExtractor valueExtractor) private voidcollectAliases(List<Method> aliases) private booleancomputeSynthesizableFlag(Set<Class<? extends Annotation>> visitedAnnotationTypes) private static int[]filledIntArray(int size) (专用程序包) intgetAliasMapping(int attributeIndex) Get the related index of an alias mapped attribute, or-1if there is no mapping.(专用程序包) Class<? extends Annotation>Get the type of the mapped annotation.(专用程序包) intgetConventionMapping(int attributeIndex) Get the related index of a convention mapped attribute, or-1if there is no mapping.private intgetFirstRootAttributeIndex(ArrayList<Method> aliases) (专用程序包) ObjectgetMappedAnnotationValue(int attributeIndex, boolean metaAnnotationsOnly) Get a mapped attribute value from the most suitablemeta-annotation.private booleanisAliasPair(Method target) private booleanisBetterConventionAnnotationValue(int index, boolean isValueAttribute, AnnotationTypeMapping mapping) private booleanisCompatibleReturnType(Class<?> attributeType, Class<?> targetType) (专用程序包) booleanisEquivalentToDefaultValue(int attributeIndex, Object value, ValueExtractor valueExtractor) Determine if the specified value is equivalent to the default value of the attribute at the given index.private static booleanisEquivalentToDefaultValue(Method attribute, Object value, ValueExtractor valueExtractor) private static <T> List<T>private voidprivate voidprocessAliases(int attributeIndex, ArrayList<Method> aliases) private MethodresolveAliasTarget(Method attribute, AliasFor aliasFor) private MethodresolveAliasTarget(Method attribute, AliasFor aliasFor, boolean checkAliasPair) private voidprivate void
-
字段详细资料
-
EMPTY_MIRROR_SETS
-
source
Get the source of the mapping ornull.the source of the mapping
-
root
Get the root mapping.the root mapping
-
distance
public final int distanceGet the distance of this mapping.the distance of the mapping
-
annotationType
Get the type of the mapped annotation.the annotation type
-
metaTypes
-
annotation
Get the source annotation for this mapping. This will be the meta-annotation, ornullif this is the root mapping.the source annotation of the mapping
-
methods
the annotation attributes for the mapping annotation type.the attribute methods
-
mirrorSets
Get the mirror sets for this type mapping.the attribute mirror sets
-
aliasMappings
private final int[] aliasMappings -
conventionMappings
private final int[] conventionMappings -
annotationValueMappings
private final int[] annotationValueMappings -
annotationValueSource
-
aliasedBy
-
synthesizable
public final boolean synthesizableDetermine if the mapped annotation is synthesizable.Consult the documentation for
MergedAnnotation.synthesize()for an explanation of what is considered synthesizable.trueif the mapped annotation is synthesizable- 从以下版本开始:
- 4.0
-
claimedAliases
-
-
构造器详细资料
-
AnnotationTypeMapping
AnnotationTypeMapping(@Nullable AnnotationTypeMapping source, Class<? extends Annotation> annotationType, @Nullable Annotation annotation, Set<Class<? extends Annotation>> visitedAnnotationTypes)
-
-
方法详细资料
-
merge
-
resolveAliasedForTargets
-
resolveAliasTarget
-
resolveAliasTarget
-
isAliasPair
-
isCompatibleReturnType
-
processAliases
private void processAliases() -
collectAliases
-
processAliases
-
getFirstRootAttributeIndex
-
addConventionMappings
private void addConventionMappings() -
addConventionAnnotationValues
private void addConventionAnnotationValues() -
isBetterConventionAnnotationValue
private boolean isBetterConventionAnnotationValue(int index, boolean isValueAttribute, AnnotationTypeMapping mapping) -
computeSynthesizableFlag
-
afterAllMappingsSet
void afterAllMappingsSet()Method called after all mappings have been set. At this point no further lookups from child mappings will occur. -
validateAllAliasesClaimed
private void validateAllAliasesClaimed() -
validateMirrorSet
-
getAnnotationType
Class<? extends Annotation> getAnnotationType()Get the type of the mapped annotation.- 返回:
- the annotation type
-
getAliasMapping
int getAliasMapping(int attributeIndex) Get the related index of an alias mapped attribute, or-1if there is no mapping. The resulting value is the index of the attribute on the root annotation that can be invoked in order to obtain the actual value.- 参数:
attributeIndex- the attribute index of the source attribute- 返回:
- the mapped attribute index or
-1
-
getConventionMapping
int getConventionMapping(int attributeIndex) Get the related index of a convention mapped attribute, or-1if there is no mapping. The resulting value is the index of the attribute on the root annotation that can be invoked in order to obtain the actual value.- 参数:
attributeIndex- the attribute index of the source attribute- 返回:
- the mapped attribute index or
-1
-
getMappedAnnotationValue
Get a mapped attribute value from the most suitablemeta-annotation.The resulting value is obtained from the closest meta-annotation, taking into consideration both convention and alias based mapping rules. For root mappings, this method will always return
null.- 参数:
attributeIndex- the attribute index of the source attributemetaAnnotationsOnly- if only meta annotations should be considered. If this parameter isfalsethen aliases within the annotation will also be considered.- 返回:
- the mapped annotation value, or
null
-
isEquivalentToDefaultValue
Determine if the specified value is equivalent to the default value of the attribute at the given index.- 参数:
attributeIndex- the attribute index of the source attributevalue- the value to checkvalueExtractor- the value extractor used to extract values from any nested annotations- 返回:
trueif the value is equivalent to the default value
-
filledIntArray
private static int[] filledIntArray(int size) -
isEquivalentToDefaultValue
private static boolean isEquivalentToDefaultValue(Method attribute, Object value, ValueExtractor valueExtractor) -
areEquivalent
private static boolean areEquivalent(@Nullable Object value, @Nullable Object extractedValue, ValueExtractor valueExtractor) -
areEquivalent
-
areEquivalent
-
areEquivalent
private static boolean areEquivalent(Annotation annotation, @Nullable Object extractedValue, ValueExtractor valueExtractor)
-