类 MissingMergedAnnotation<A extends Annotation>

java.lang.Object
cn.taketoday.core.annotation.AbstractMergedAnnotation<A>
cn.taketoday.core.annotation.MissingMergedAnnotation<A>
类型参数:
A - the annotation type
所有已实现的接口:
MergedAnnotation<A>

final class MissingMergedAnnotation<A extends Annotation> extends AbstractMergedAnnotation<A>
An AbstractMergedAnnotation used as the implementation of MergedAnnotation.missing().
从以下版本开始:
4.0
作者:
Phillip Webb, Juergen Hoeller
  • 字段详细资料

  • 构造器详细资料

    • MissingMergedAnnotation

      private MissingMergedAnnotation()
  • 方法详细资料

    • getType

      public Class<A> getType()
      从接口复制的说明: MergedAnnotation
      Get the Class reference for the actual annotation type.
      返回:
      the annotation type
    • isPresent

      public boolean isPresent()
      从接口复制的说明: MergedAnnotation
      Determine if the annotation is present on the source. Considers directly present and meta-present annotations within the context of the MergedAnnotations.SearchStrategy used.
      返回:
      true if the annotation is present
    • getSource

      @Nullable public Object getSource()
      从接口复制的说明: MergedAnnotation
      Get the source that ultimately declared the root annotation, or null if the source is not known.

      If this merged annotation was created from an AnnotatedElement then this source will be an element of the same type. If the annotation was loaded without using reflection, the source can be of any type, but should have a sensible toString(). Meta-annotations will always return the same source as the root.

      返回:
      the source, or null
    • getMetaSource

      @Nullable public MergedAnnotation<?> getMetaSource()
      从接口复制的说明: MergedAnnotation
      Get the source of the meta-annotation, or null if the annotation is not meta-present.

      The meta-source is the annotation that was meta-annotated with this annotation.

      返回:
      the meta-annotation source or null
      另请参阅:
    • getRoot

      public MergedAnnotation<?> getRoot()
      从接口复制的说明: MergedAnnotation
      Get the root annotation, i.e. the distance 0 annotation as directly declared on the source.
      返回:
      the root annotation
      另请参阅:
    • getMetaTypes

      public List<Class<? extends Annotation>> getMetaTypes()
      从接口复制的说明: MergedAnnotation
      Get the complete list of annotation types within the annotation hierarchy from this annotation to the root.

      Provides a useful way to uniquely identify a merged annotation instance.

      返回:
      the meta types for the annotation
      另请参阅:
    • getDistance

      public int getDistance()
      从接口复制的说明: MergedAnnotation
      Get the distance of this annotation related to its use as a meta-annotation.

      A directly declared annotation has a distance of 0, a meta-annotation has a distance of 1, a meta-annotation on a meta-annotation has a distance of 2, etc. A missing annotation will always return a distance of -1.

      返回:
      the annotation distance or -1 if the annotation is missing
    • getAggregateIndex

      public int getAggregateIndex()
      从接口复制的说明: MergedAnnotation
      Get the index of the aggregate collection containing this annotation.

      Can be used to reorder a stream of annotations, for example, to give a higher priority to annotations declared on a superclass or interface. A missing annotation will always return an aggregate index of -1.

      返回:
      the aggregate index (starting at 0) or -1 if the annotation is missing
    • hasNonDefaultValue

      public boolean hasNonDefaultValue(String attributeName)
      从接口复制的说明: MergedAnnotation
      Determine if the specified attribute name has a non-default value when compared to the annotation declaration.
      指定者:
      hasNonDefaultValue 在接口中 MergedAnnotation<A extends Annotation>
      覆盖:
      hasNonDefaultValue 在类中 AbstractMergedAnnotation<A extends Annotation>
      参数:
      attributeName - the attribute name
      返回:
      true if the attribute value is different from the default value
    • hasDefaultValue

      public boolean hasDefaultValue(String attributeName)
      从接口复制的说明: MergedAnnotation
      Determine if the specified attribute name has a default value when compared to the annotation declaration.
      参数:
      attributeName - the attribute name
      返回:
      true if the attribute value is the same as the default value
    • getValue

      public <T> Optional<T> getValue(String attributeName, Class<T> type)
      从接口复制的说明: MergedAnnotation
      Get an optional attribute value from the annotation.
      指定者:
      getValue 在接口中 MergedAnnotation<A extends Annotation>
      覆盖:
      getValue 在类中 AbstractMergedAnnotation<A extends Annotation>
      参数:
      attributeName - the attribute name
      type - the attribute type. Must be compatible with the underlying attribute type or Object.class.
      返回:
      an optional value or Optional.empty() if there is no matching attribute
    • getDefaultValue

      public <T> Optional<T> getDefaultValue(@Nullable String attributeName, Class<T> type)
      从接口复制的说明: MergedAnnotation
      Get the default attribute value from the annotation as specified in the annotation declaration.
      参数:
      attributeName - the attribute name
      type - the attribute type. Must be compatible with the underlying attribute type or Object.class.
      返回:
      an optional of the default value or Optional.empty() if there is no matching attribute or no defined default
    • filterAttributes

      public MergedAnnotation<A> filterAttributes(Predicate<String> predicate)
      从接口复制的说明: MergedAnnotation
      Create a new view of the annotation with only attributes that match the given predicate.
      参数:
      predicate - a predicate used to filter attribute names
      返回:
      a filtered view of the annotation
      另请参阅:
    • withNonMergedAttributes

      public MergedAnnotation<A> withNonMergedAttributes()
      从接口复制的说明: MergedAnnotation
      Create a new view of the annotation that exposes non-merged attribute values.

      Methods from this view will return attribute values with only alias mirroring rules applied. Aliases to meta-source attributes will not be applied.

      返回:
      a non-merged view of the annotation
    • asAnnotationAttributes

      public AnnotationAttributes asAnnotationAttributes(MergedAnnotation.Adapt... adaptations)
      从接口复制的说明: MergedAnnotation
      Create a new mutable AnnotationAttributes instance from this merged annotation.

      The adaptations may be used to change the way that values are added.

      指定者:
      asAnnotationAttributes 在接口中 MergedAnnotation<A extends Annotation>
      覆盖:
      asAnnotationAttributes 在类中 AbstractMergedAnnotation<A extends Annotation>
      参数:
      adaptations - the adaptations that should be applied to the annotation values
      返回:
      an immutable map containing the attributes and values
    • asMap

      public Map<String,Object> asMap(MergedAnnotation.Adapt... adaptations)
      从接口复制的说明: MergedAnnotation
      Get an immutable Map that contains all the annotation attributes.

      The adaptations may be used to change the way that values are added.

      参数:
      adaptations - the adaptations that should be applied to the annotation values
      返回:
      an immutable map containing the attributes and values
    • asMap

      public <T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>,T> factory, MergedAnnotation.Adapt... adaptations)
      从接口复制的说明: MergedAnnotation
      Create a new Map instance of the given type that contains all the annotation attributes.

      The adaptations may be used to change the way that values are added.

      参数:
      factory - a map factory
      adaptations - the adaptations that should be applied to the annotation values
      返回:
      a map containing the attributes and values
    • isSynthesizable

      public boolean isSynthesizable()
      从接口复制的说明: MergedAnnotation
      Determine if this merged annotation is synthesizable.

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

      返回:
      true if the mapped annotation is synthesizable
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • getAnnotation

      public <T extends Annotation> MergedAnnotation<T> getAnnotation(String attributeName, Class<T> type) throws NoSuchElementException
      从接口复制的说明: MergedAnnotation
      Get a required annotation attribute value from the annotation.
      参数:
      attributeName - the attribute name
      type - the annotation type
      返回:
      the value as a MergedAnnotation
      抛出:
      NoSuchElementException - if there is no matching attribute
    • getAnnotationArray

      public <T extends Annotation> MergedAnnotation<T>[] getAnnotationArray(String attributeName, Class<T> type) throws NoSuchElementException
      从接口复制的说明: MergedAnnotation
      Get a required annotation array attribute value from the annotation.
      参数:
      attributeName - the attribute name
      type - the annotation type
      返回:
      the value as a MergedAnnotation array
      抛出:
      NoSuchElementException - if there is no matching attribute
    • getAttributeValue

      protected <T> T getAttributeValue(String attributeName, Class<T> type)
      从类复制的说明: AbstractMergedAnnotation
      Get the underlying attribute value.
      指定者:
      getAttributeValue 在类中 AbstractMergedAnnotation<A extends Annotation>
      参数:
      attributeName - the attribute name
      type - the type to return (see MergedAnnotation class documentation for details)
      返回:
      the attribute value or null if the value is not found and is not required
    • createSynthesizedAnnotation

      protected A createSynthesizedAnnotation()
      从类复制的说明: AbstractMergedAnnotation
      Factory method used to create the synthesized annotation.

      If the source is an annotation that is not synthesizable, it will be returned unmodified.

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

      指定者:
      createSynthesizedAnnotation 在类中 AbstractMergedAnnotation<A extends Annotation>
    • getInstance

      static <A extends Annotation> MergedAnnotation<A> getInstance()