类 AbstractMergedAnnotation<A extends Annotation>
- 类型参数:
A- the annotation type
- 所有已实现的接口:
MergedAnnotation<A>
MergedAnnotation implementations.- 从以下版本开始:
- 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.protected abstract AFactory method used to create the synthesized annotation.Create a new view of the annotation with all attributes that have default values removed.protected abstract <T> TgetAttributeValue(String attributeName, Class<T> type) Get the underlying attribute value.booleangetBoolean(String attributeName) Get a required boolean attribute value from the annotation.boolean[]getBooleanArray(String attributeName) Get a required boolean array attribute value from the annotation.byteGet a required byte attribute value from the annotation.byte[]getByteArray(String attributeName) Get a required byte array attribute value from the annotation.charGet a required char attribute value from the annotation.char[]getCharArray(String attributeName) Get a required char array attribute value from the annotation.<T> Class<T>Get a required class attribute value from the annotation.<T> Class<T>[]getClassArray(String attributeName) Get a required class array attribute value from the annotation.getDefaultValue(String attributeName) Get the default attribute value from the annotation as specified in the annotation declaration.doubleGet a required double attribute value from the annotation.double[]getDoubleArray(String attributeName) Get a required double array attribute value from the annotation.<E extends Enum<E>>
EGet a required enum attribute value from the annotation.<E extends Enum<E>>
E[]getEnumArray(String attributeName, Class<E> type) Get a required enum array attribute value from the annotation.floatGet a required float attribute value from the annotation.float[]getFloatArray(String attributeName) Get a required float array attribute value from the annotation.intGet a required int attribute value from the annotation.int[]getIntArray(String attributeName) Get a required int array attribute value from the annotation.longGet a required long attribute value from the annotation.long[]getLongArray(String attributeName) Get a required long array attribute value from the annotation.private <T> TgetRequiredAttributeValue(String attributeName, Class<T> type) shortGet a required short attribute value from the annotation.short[]getShortArray(String attributeName) Get a required short array attribute value from the annotation.Get a required string attribute value from the annotation.String[]getStringArray(String attributeName) Get a required string array attribute value from the annotation.Get an optional attribute value from the annotation.<T> Optional<T>Get an optional attribute value from the annotation.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 directly present on the source.booleanDetermine if the annotation is meta-present on the source.Create a type-safe synthesized version of this merged annotation that can be used directly in code.synthesize(Predicate<? super MergedAnnotation<A>> condition) Optionally create a type-safe synthesized version of this annotation based on a condition predicate.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.core.annotation.MergedAnnotation
asMap, asMap, filterAttributes, getAggregateIndex, getAnnotation, getAnnotationArray, getBooleanValue, getClassValue, getClassValueArray, getDefaultValue, getDistance, getDoubleValue, getIntValue, getLongValue, getMetaSource, getMetaTypes, getRoot, getSource, getStringValue, getStringValueArray, getType, getValue, hasDefaultValue, isPresent, isSynthesizable, withNonMergedAttributes
-
字段详细资料
-
synthesizedAnnotation
-
-
构造器详细资料
-
AbstractMergedAnnotation
AbstractMergedAnnotation()
-
-
方法详细资料
-
isDirectlyPresent
public boolean isDirectlyPresent()从接口复制的说明:MergedAnnotationDetermine if the annotation is directly present on the source.A directly present annotation is one that the user has explicitly declared and not one that is meta-present or
@Inherited.- 指定者:
isDirectlyPresent在接口中MergedAnnotation<A extends Annotation>- 返回:
trueif the annotation is directly present
-
isMetaPresent
public boolean isMetaPresent()从接口复制的说明:MergedAnnotationDetermine if the annotation is meta-present on the source.A meta-present annotation is an annotation that the user hasn't explicitly declared, but has been used as a meta-annotation somewhere in the annotation hierarchy.
- 指定者:
isMetaPresent在接口中MergedAnnotation<A extends Annotation>- 返回:
trueif the annotation is meta-present
-
hasNonDefaultValue
从接口复制的说明:MergedAnnotationDetermine if the specified attribute name has a non-default value when compared to the annotation declaration.- 指定者:
hasNonDefaultValue在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
trueif the attribute value is different from the default value
-
getByte
从接口复制的说明:MergedAnnotationGet a required byte attribute value from the annotation.- 指定者:
getByte在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a byte
-
getByteArray
从接口复制的说明:MergedAnnotationGet a required byte array attribute value from the annotation.- 指定者:
getByteArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a byte array
-
getBoolean
从接口复制的说明:MergedAnnotationGet a required boolean attribute value from the annotation.- 指定者:
getBoolean在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a boolean
-
getBooleanArray
从接口复制的说明:MergedAnnotationGet a required boolean array attribute value from the annotation.- 指定者:
getBooleanArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a boolean array
-
getChar
从接口复制的说明:MergedAnnotationGet a required char attribute value from the annotation.- 指定者:
getChar在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a char
-
getCharArray
从接口复制的说明:MergedAnnotationGet a required char array attribute value from the annotation.- 指定者:
getCharArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a char array
-
getShort
从接口复制的说明:MergedAnnotationGet a required short attribute value from the annotation.- 指定者:
getShort在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a short
-
getShortArray
从接口复制的说明:MergedAnnotationGet a required short array attribute value from the annotation.- 指定者:
getShortArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a short array
-
getInt
从接口复制的说明:MergedAnnotationGet a required int attribute value from the annotation.- 指定者:
getInt在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as an int
-
getIntArray
从接口复制的说明:MergedAnnotationGet a required int array attribute value from the annotation.- 指定者:
getIntArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as an int array
-
getLong
从接口复制的说明:MergedAnnotationGet a required long attribute value from the annotation.- 指定者:
getLong在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a long
-
getLongArray
从接口复制的说明:MergedAnnotationGet a required long array attribute value from the annotation.- 指定者:
getLongArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a long array
-
getDouble
从接口复制的说明:MergedAnnotationGet a required double attribute value from the annotation.- 指定者:
getDouble在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a double
-
getDoubleArray
从接口复制的说明:MergedAnnotationGet a required double array attribute value from the annotation.- 指定者:
getDoubleArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a double array
-
getFloat
从接口复制的说明:MergedAnnotationGet a required float attribute value from the annotation.- 指定者:
getFloat在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a float
-
getFloatArray
从接口复制的说明:MergedAnnotationGet a required float array attribute value from the annotation.- 指定者:
getFloatArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a float array
-
getString
从接口复制的说明:MergedAnnotationGet a required string attribute value from the annotation.- 指定者:
getString在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a string
-
getStringArray
从接口复制的说明:MergedAnnotationGet a required string array attribute value from the annotation.- 指定者:
getStringArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a string array
-
getClass
从接口复制的说明:MergedAnnotationGet a required class attribute value from the annotation.- 指定者:
getClass在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a class
-
getClassArray
从接口复制的说明:MergedAnnotationGet a required class array attribute value from the annotation.- 指定者:
getClassArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- the value as a class array
-
getEnum
从接口复制的说明:MergedAnnotationGet a required enum attribute value from the annotation.- 指定者:
getEnum在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute nametype- the enum type- 返回:
- the value as a enum
-
getEnumArray
从接口复制的说明:MergedAnnotationGet a required enum array attribute value from the annotation.- 指定者:
getEnumArray在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute nametype- the enum type- 返回:
- the value as a enum array
-
getValue
从接口复制的说明:MergedAnnotationGet an optional attribute value from the annotation.- 指定者:
getValue在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- an optional value or
Optional.empty()if there is no matching attribute
-
getValue
从接口复制的说明:MergedAnnotationGet an optional attribute value from the annotation.- 指定者:
getValue在接口中MergedAnnotation<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.- 指定者:
getDefaultValue在接口中MergedAnnotation<A extends Annotation>- 参数:
attributeName- the attribute name- 返回:
- an optional of the default value or
Optional.empty()if there is no matching attribute or no defined default
-
filterDefaultValues
从接口复制的说明:MergedAnnotationCreate a new view of the annotation with all attributes that have default values removed.- 指定者:
filterDefaultValues在接口中MergedAnnotation<A extends Annotation>- 返回:
- a filtered view of the annotation without any attributes that have a default value
- 另请参阅:
-
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>- 参数:
adaptations- the adaptations that should be applied to the annotation values- 返回:
- an immutable map containing the attributes and values
-
synthesize
public Optional<A> synthesize(Predicate<? super MergedAnnotation<A>> condition) throws NoSuchElementException 从接口复制的说明:MergedAnnotationOptionally create a type-safe synthesized version of this annotation based on a condition predicate.The result is synthesized using a JDK
Proxyand as a result may incur a computational cost when first invoked.Consult the documentation for
MergedAnnotation.synthesize()for an explanation of what is considered synthesizable.- 指定者:
synthesize在接口中MergedAnnotation<A extends Annotation>- 参数:
condition- the test to determine if the annotation can be synthesized- 返回:
- an optional containing the synthesized version of the annotation or an empty optional if the condition doesn't match
- 抛出:
NoSuchElementException- on a missing annotation- 另请参阅:
-
synthesize
从接口复制的说明:MergedAnnotationCreate a type-safe synthesized version of this merged annotation that can be used directly in code.The result is synthesized using a JDK
Proxyand as a result may incur a computational cost when first invoked.If this merged annotation was created from a map of annotation attributes or default attribute values, those attributes will always be synthesized into an annotation instance.
If this merged annotation was created from an annotation instance, that annotation will be returned unmodified if it is not synthesizable. An annotation is considered synthesizable if it has not already been synthesized and one of the following is true.
- The annotation declares attributes annotated with
@AliasFor. - The annotation is a composed annotation that relies on convention-based annotation attribute overrides in meta-annotations.
- The annotation declares attributes that are annotations or arrays of annotations that are themselves synthesizable.
- 指定者:
synthesize在接口中MergedAnnotation<A extends Annotation>- 返回:
- a synthesized version of the annotation or the original annotation unmodified
- The annotation declares attributes annotated with
-
getRequiredAttributeValue
-
getAttributeValue
Get the underlying attribute value.- 参数:
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 - 抛出:
IllegalArgumentException- if the source type is not compatibleNoSuchElementException- if the value is required but not found
-
createSynthesizedAnnotation
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.
-