类 MissingMergedAnnotation<A extends Annotation>
- 类型参数:
A- the annotation type
- 所有已实现的接口:
MergedAnnotation<A>
AbstractMergedAnnotation used as the implementation of
MergedAnnotation.missing().- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Juergen Hoeller
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.core.annotation.MergedAnnotation
MergedAnnotation.Adapt -
字段概要
字段从接口继承的字段 cn.taketoday.core.annotation.MergedAnnotation
VALUE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明asAnnotationAttributes(MergedAnnotation.Adapt... adaptations) Create a new mutableAnnotationAttributesinstance from this merged annotation.asMap(MergedAnnotation.Adapt... adaptations) Get an immutableMapthat contains all the annotation attributes.asMap(Function<MergedAnnotation<?>, T> factory, MergedAnnotation.Adapt... adaptations) Create a newMapinstance of the given type that contains all the annotation attributes.protected AFactory method used to create the synthesized annotation.filterAttributes(Predicate<String> predicate) Create a new view of the annotation with only attributes that match the given predicate.intGet the index of the aggregate collection containing this annotation.<T extends Annotation>
MergedAnnotation<T>getAnnotation(String attributeName, Class<T> type) Get a required annotation attribute value from the annotation.<T extends Annotation>
MergedAnnotation<T>[]getAnnotationArray(String attributeName, Class<T> type) Get a required annotation array attribute value from the annotation.protected <T> TgetAttributeValue(String attributeName, Class<T> type) Get the underlying attribute value.<T> Optional<T>getDefaultValue(String attributeName, Class<T> type) Get the default attribute value from the annotation as specified in the annotation declaration.intGet the distance of this annotation related to its use as a meta-annotation.(专用程序包) static <A extends Annotation>
MergedAnnotation<A>Get the source of the meta-annotation, ornullif the annotation is not meta-present.List<Class<? extends Annotation>>Get the complete list of annotation types within the annotation hierarchy from this annotation to theroot.getRoot()Get the root annotation, i.e. thedistance0annotation as directly declared on the source.Get the source that ultimately declared the root annotation, ornullif the source is not known.getType()Get theClassreference for the actual annotation type.<T> Optional<T>Get an optional attribute value from the annotation.booleanhasDefaultValue(String attributeName) Determine if the specified attribute name has a default value when compared to the annotation declaration.booleanhasNonDefaultValue(String attributeName) Determine if the specified attribute name has a non-default value when compared to the annotation declaration.booleanDetermine if the annotation is present on the source.booleanDetermine if this merged annotation is synthesizable.toString()Create a new view of the annotation that exposes non-merged attribute values.从类继承的方法 cn.taketoday.core.annotation.AbstractMergedAnnotation
filterDefaultValues, getBoolean, getBooleanArray, getByte, getByteArray, getChar, getCharArray, getClass, getClassArray, getDefaultValue, getDouble, getDoubleArray, getEnum, getEnumArray, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getShort, getShortArray, getString, getStringArray, getValue, isDirectlyPresent, isMetaPresent, synthesize, synthesize从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.core.annotation.MergedAnnotation
getBooleanValue, getClassValue, getClassValueArray, getDoubleValue, getIntValue, getLongValue, getStringValue, getStringValueArray, getValue
-
字段详细资料
-
INSTANCE
-
-
构造器详细资料
-
MissingMergedAnnotation
private MissingMergedAnnotation()
-
-
方法详细资料
-
getType
从接口复制的说明:MergedAnnotationGet theClassreference for the actual annotation type.- 返回:
- the annotation type
-
isPresent
public boolean isPresent()从接口复制的说明:MergedAnnotationDetermine if the annotation is present on the source. Considers directly present and meta-present annotations within the context of theMergedAnnotations.SearchStrategyused.- 返回:
trueif the annotation is present
-
getSource
从接口复制的说明:MergedAnnotationGet the source that ultimately declared the root annotation, ornullif the source is not known.If this merged annotation was created
fromanAnnotatedElementthen 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 sensibletoString(). Meta-annotations will always return the same source as theroot.- 返回:
- the source, or
null
-
getMetaSource
从接口复制的说明:MergedAnnotationGet the source of the meta-annotation, ornullif 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
从接口复制的说明:MergedAnnotationGet the root annotation, i.e. thedistance0annotation as directly declared on the source.- 返回:
- the root annotation
- 另请参阅:
-
getMetaTypes
从接口复制的说明:MergedAnnotationGet the complete list of annotation types within the annotation hierarchy from this annotation to theroot.Provides a useful way to uniquely identify a merged annotation instance.
- 返回:
- the meta types for the annotation
- 另请参阅:
-
getDistance
public int getDistance()从接口复制的说明:MergedAnnotationGet 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 of1, a meta-annotation on a meta-annotation has a distance of2, etc. A missing annotation will always return a distance of-1.- 返回:
- the annotation distance or
-1if the annotation is missing
-
getAggregateIndex
public int getAggregateIndex()从接口复制的说明:MergedAnnotationGet 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-1if the annotation is missing
-
hasNonDefaultValue
从接口复制的说明:MergedAnnotationDetermine 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- 返回:
trueif the attribute value is different from the default value
-
hasDefaultValue
从接口复制的说明:MergedAnnotationDetermine if the specified attribute name has a default value when compared to the annotation declaration.- 参数:
attributeName- the attribute name- 返回:
trueif the attribute value is the same as the default value
-
getValue
从接口复制的说明:MergedAnnotationGet an optional attribute value from the annotation.- 指定者:
getValue在接口中MergedAnnotation<A extends Annotation>- 覆盖:
getValue在类中AbstractMergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute nametype- the attribute type. Must be compatible with the underlying attribute type orObject.class.- 返回:
- an optional value or
Optional.empty()if there is no matching attribute
-
getDefaultValue
从接口复制的说明:MergedAnnotationGet the default attribute value from the annotation as specified in the annotation declaration.- 参数:
attributeName- the attribute nametype- the attribute type. Must be compatible with the underlying attribute type orObject.class.- 返回:
- an optional of the default value or
Optional.empty()if there is no matching attribute or no defined default
-
filterAttributes
从接口复制的说明:MergedAnnotationCreate 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
从接口复制的说明:MergedAnnotationCreate 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-sourceattributes will not be applied.- 返回:
- a non-merged view of the annotation
-
asAnnotationAttributes
从接口复制的说明:MergedAnnotationCreate a new mutableAnnotationAttributesinstance from this merged annotation.The
adaptationsmay 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
从接口复制的说明:MergedAnnotationGet an immutableMapthat contains all the annotation attributes.The
adaptationsmay 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) 从接口复制的说明:MergedAnnotationCreate a newMapinstance of the given type that contains all the annotation attributes.The
adaptationsmay be used to change the way that values are added.- 参数:
factory- a map factoryadaptations- the adaptations that should be applied to the annotation values- 返回:
- a map containing the attributes and values
-
isSynthesizable
public boolean isSynthesizable()从接口复制的说明:MergedAnnotationDetermine if this merged annotation is synthesizable.Consult the documentation for
MergedAnnotation.synthesize()for an explanation of what is considered synthesizable.- 返回:
trueif the mapped annotation is synthesizable
-
toString
-
getAnnotation
public <T extends Annotation> MergedAnnotation<T> getAnnotation(String attributeName, Class<T> type) throws NoSuchElementException 从接口复制的说明:MergedAnnotationGet a required annotation attribute value from the annotation.- 参数:
attributeName- the attribute nametype- 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 从接口复制的说明:MergedAnnotationGet a required annotation array attribute value from the annotation.- 参数:
attributeName- the attribute nametype- the annotation type- 返回:
- the value as a
MergedAnnotationarray - 抛出:
NoSuchElementException- if there is no matching attribute
-
getAttributeValue
从类复制的说明:AbstractMergedAnnotationGet the underlying attribute value.- 指定者:
getAttributeValue在类中AbstractMergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute nametype- the type to return (seeMergedAnnotationclass documentation for details)- 返回:
- the attribute value or
nullif the value is not found and is not required
-
createSynthesizedAnnotation
从类复制的说明:AbstractMergedAnnotationFactory 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
-