类 AnnotationTypeMapping

java.lang.Object
cn.taketoday.core.annotation.AnnotationTypeMapping

final class AnnotationTypeMapping extends Object
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
另请参阅:
  • 字段详细资料

    • EMPTY_MIRROR_SETS

      private static final AnnotationTypeMapping.MirrorSets.MirrorSet[] EMPTY_MIRROR_SETS
    • source

      @Nullable public final AnnotationTypeMapping source
      Get the source of the mapping or null.

      the source of the mapping

    • root

      public final AnnotationTypeMapping root
      Get the root mapping.

      the root mapping

    • distance

      public final int distance
      Get the distance of this mapping.

      the distance of the mapping

    • annotationType

      public final Class<? extends Annotation> annotationType
      Get the type of the mapped annotation.

      the annotation type

    • metaTypes

      public final List<Class<? extends Annotation>> metaTypes
    • annotation

      @Nullable public final Annotation annotation
      Get the source annotation for this mapping. This will be the meta-annotation, or null if this is the root mapping.

      the source annotation of the mapping

    • methods

      public final AttributeMethods methods
      the annotation attributes for the mapping annotation type.

      the attribute methods

    • mirrorSets

      public final AnnotationTypeMapping.MirrorSets 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

      private final AnnotationTypeMapping[] annotationValueSource
    • aliasedBy

      private final Map<Method,List<Method>> aliasedBy
    • synthesizable

      public final boolean synthesizable
      Determine if the mapped annotation is synthesizable.

      Consult the documentation for MergedAnnotation.synthesize() for an explanation of what is considered synthesizable.

      true if the mapped annotation is synthesizable

    • claimedAliases

      private final Set<Method> claimedAliases
  • 构造器详细资料

  • 方法详细资料

    • merge

      private static <T> List<T> merge(@Nullable List<T> existing, T element)
    • resolveAliasedForTargets

      private Map<Method,List<Method>> resolveAliasedForTargets()
    • resolveAliasTarget

      private Method resolveAliasTarget(Method attribute, AliasFor aliasFor)
    • resolveAliasTarget

      private Method resolveAliasTarget(Method attribute, AliasFor aliasFor, boolean checkAliasPair)
    • isAliasPair

      private boolean isAliasPair(Method target)
    • isCompatibleReturnType

      private boolean isCompatibleReturnType(Class<?> attributeType, Class<?> targetType)
    • processAliases

      private void processAliases()
    • collectAliases

      private void collectAliases(List<Method> aliases)
    • processAliases

      private void processAliases(int attributeIndex, ArrayList<Method> aliases)
    • getFirstRootAttributeIndex

      private int getFirstRootAttributeIndex(ArrayList<Method> aliases)
    • addConventionMappings

      private void addConventionMappings()
    • addConventionAnnotationValues

      private void addConventionAnnotationValues()
    • isBetterConventionAnnotationValue

      private boolean isBetterConventionAnnotationValue(int index, boolean isValueAttribute, AnnotationTypeMapping mapping)
    • computeSynthesizableFlag

      private boolean computeSynthesizableFlag(Set<Class<? extends Annotation>> visitedAnnotationTypes)
    • 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

      private void validateMirrorSet(AnnotationTypeMapping.MirrorSets.MirrorSet mirrorSet)
    • 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 -1 if 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 -1 if 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

      @Nullable Object getMappedAnnotationValue(int attributeIndex, boolean metaAnnotationsOnly)
      Get a mapped attribute value from the most suitable meta-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 attribute
      metaAnnotationsOnly - if only meta annotations should be considered. If this parameter is false then aliases within the annotation will also be considered.
      返回:
      the mapped annotation value, or null
    • isEquivalentToDefaultValue

      boolean isEquivalentToDefaultValue(int attributeIndex, Object value, ValueExtractor valueExtractor)
      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 attribute
      value - the value to check
      valueExtractor - the value extractor used to extract values from any nested annotations
      返回:
      true if 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

      private static boolean areEquivalent(Class<?>[] value, String[] extractedValue)
    • areEquivalent

      private static boolean areEquivalent(Class<?> value, String extractedValue)
    • areEquivalent

      private static boolean areEquivalent(Annotation annotation, @Nullable Object extractedValue, ValueExtractor valueExtractor)