Top Description Fields Constructors Methods
org.springframework.core.annotation

pack-priv final Class MissingMergedAnnotation<A extends Annotation>

extends AbstractMergedAnnotation<A extends Annotation>
Class Inheritance
Type Parameters
<A>
the annotation type
Imports
java.lang.annotation.Annotation, java.util.Collections, .List, .Map, .NoSuchElementException, .Optional, java.util.function.Function, .Predicate, org.springframework.lang.Nullable

An AbstractMergedAnnotation used as the implementation of MergedAnnotation#missing().
Authors
Phillip Webb, Juergen Hoeller
Since
5.2

Field Summary

Modifier and TypeField and Description
private static final MissingMergedAnnotation<?>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public AnnotationAttributes
asAnnotationAttributes(MergedAnnotation.Adapt...
the adaptations that should be applied to the annotation values
adaptations
)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes.

Implements org.springframework.core.annotation.MergedAnnotation.asAnnotationAttributes.

Create a new mutable AnnotationAttributes instance from this merged annotation.

public Map<String, Object>
asMap(MergedAnnotation.Adapt...
the adaptations that should be applied to the annotation values
adaptations
)

Implements org.springframework.core.annotation.MergedAnnotation.asMap.

Get an immutable Map that contains all the annotation attributes.

public <T extends Map<String, Object>> T
asMap(Function<MergedAnnotation<?>, T>
a map factory
factory
,
MergedAnnotation.Adapt...
the adaptations that should be applied to the annotation values
adaptations
)

Implements org.springframework.core.annotation.MergedAnnotation.asMap.

Create a new Map instance of the given type that contains all the annotation attributes.

protected A
createSynthesizedAnnotation()

Implements abstract org.springframework.core.annotation.AbstractMergedAnnotation.createSynthesizedAnnotation.

Factory method used to create the synthesized annotation.

public MergedAnnotation<A>
filterAttributes(Predicate<String>
a predicate used to filter attribute names
predicate
)

Implements org.springframework.core.annotation.MergedAnnotation.filterAttributes.

Create a new view of the annotation with only attributes that match the given predicate.

public int
getAggregateIndex()

Implements org.springframework.core.annotation.MergedAnnotation.getAggregateIndex.

Get the index of the aggregate collection containing this annotation.

public <T extends Annotation> MergedAnnotation<T>
getAnnotation(String
the attribute name
attributeName
,
Class<T>
the annotation type
type
)

Implements org.springframework.core.annotation.MergedAnnotation.getAnnotation.

Get a required annotation attribute value from the annotation.

public <T extends Annotation> MergedAnnotation<T>[]
getAnnotationArray(String
the attribute name
attributeName
,
Class<T>
the annotation type
type
)

Implements org.springframework.core.annotation.MergedAnnotation.getAnnotationArray.

Get a required annotation array attribute value from the annotation.

protected <T> T
getAttributeValue(String
the attribute name
attributeName
,
Class<T>
the type to return (see MergedAnnotation class documentation for details)
type
)

Implements abstract org.springframework.core.annotation.AbstractMergedAnnotation.getAttributeValue.

Get the underlying attribute value.

public <T> Optional<T>
getDefaultValue(String
the attribute name
attributeName
,
Class<T>
the attribute type. Must be compatible with the underlying attribute type or Object.class.
type
)

Implements org.springframework.core.annotation.MergedAnnotation.getDefaultValue.

Get the default attribute value from the annotation as specified in the annotation declaration.

public int
getDistance()

Implements org.springframework.core.annotation.MergedAnnotation.getDistance.

Get the distance of this annotation related to its use as a meta-annotation.

pack-priv static <A extends Annotation> MergedAnnotation<A>
public MergedAnnotation<?>
getMetaSource()

Implements org.springframework.core.annotation.MergedAnnotation.getMetaSource.

Get the source of the meta-annotation, or null if the annotation is not meta-present.

public List<Class<? extends Annotation>>
getMetaTypes()

Implements org.springframework.core.annotation.MergedAnnotation.getMetaTypes.

Get the complete list of annotation types within the annotation hierarchy from this annotation to the root.

public MergedAnnotation<?>
getRoot()

Implements org.springframework.core.annotation.MergedAnnotation.getRoot.

Get the root annotation, i.e. the distance 0 annotation as directly declared on the source.

public Object
getSource()

Implements org.springframework.core.annotation.MergedAnnotation.getSource.

Get the source that ultimately declared the root annotation, or null if the source is not known.

public Class<A>
getType()

Implements org.springframework.core.annotation.MergedAnnotation.getType.

Get the Class reference for the actual annotation type.

public <T> Optional<T>
getValue(String
the attribute name
attributeName
,
Class<T>
the attribute type. Must be compatible with the underlying attribute type or Object.class.
type
)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.getValue.

Implements org.springframework.core.annotation.MergedAnnotation.getValue.

Get an optional attribute value from the annotation.

public boolean
hasDefaultValue(String
the attribute name
attributeName
)

Implements org.springframework.core.annotation.MergedAnnotation.hasDefaultValue.

Determine if the specified attribute name has a default value when compared to the annotation declaration.

public boolean
hasNonDefaultValue(String
the attribute name
attributeName
)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.hasNonDefaultValue.

Implements org.springframework.core.annotation.MergedAnnotation.hasNonDefaultValue.

Determine if the specified attribute name has a non-default value when compared to the annotation declaration.

public boolean
isPresent()

Implements org.springframework.core.annotation.MergedAnnotation.isPresent.

Determine if the annotation is present on the source.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public MergedAnnotation<A>
withNonMergedAttributes()

Implements org.springframework.core.annotation.MergedAnnotation.withNonMergedAttributes.

Create a new view of the annotation that exposes non-merged attribute values.

Inherited from org.springframework.core.annotation.AbstractMergedAnnotation:
filterDefaultValuesgetBooleangetBooleanArraygetBytegetByteArraygetChargetCharArraygetClassgetClassArraygetDefaultValuegetDoublegetDoubleArraygetEnumgetEnumArraygetFloatgetFloatArraygetIntgetIntArraygetLonggetLongArraygetShortgetShortArraygetStringgetStringArraygetValueisDirectlyPresentisMetaPresentsynthesizesynthesize

Field Detail

INSTANCEback to summary
private static final MissingMergedAnnotation<?> INSTANCE

Constructor Detail

MissingMergedAnnotationback to summary
private MissingMergedAnnotation()

Method Detail

asAnnotationAttributesback to summary
public AnnotationAttributes asAnnotationAttributes(MergedAnnotation.Adapt... adaptations)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes.

Implements org.springframework.core.annotation.MergedAnnotation.asAnnotationAttributes.

Doc from org.springframework.core.annotation.MergedAnnotation.asAnnotationAttributes.

Create a new mutable AnnotationAttributes instance from this merged annotation.

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

Parameters
adaptations:MergedAnnotation.Adapt[]

the adaptations that should be applied to the annotation values

Returns:AnnotationAttributes

an immutable map containing the attributes and values

Annotations
@Override
asMapback to summary
public Map<String, Object> asMap(MergedAnnotation.Adapt... adaptations)

Implements org.springframework.core.annotation.MergedAnnotation.asMap.

Doc from org.springframework.core.annotation.MergedAnnotation.asMap.

Get an immutable Map that contains all the annotation attributes.

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

Parameters
adaptations:MergedAnnotation.Adapt[]

the adaptations that should be applied to the annotation values

Returns:Map<String, Object>

an immutable map containing the attributes and values

Annotations
@Override
asMapback to summary
public <T extends Map<String, Object>> T asMap(Function<MergedAnnotation<?>, T> factory, MergedAnnotation.Adapt... adaptations)

Implements org.springframework.core.annotation.MergedAnnotation.asMap.

Doc from org.springframework.core.annotation.MergedAnnotation.asMap.

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.

Parameters
factory:Function<MergedAnnotation<?>, T>

a map factory

adaptations:MergedAnnotation.Adapt[]

the adaptations that should be applied to the annotation values

Returns:T

a map containing the attributes and values

Annotations
@Override
createSynthesizedAnnotationback to summary
protected A createSynthesizedAnnotation()

Implements abstract org.springframework.core.annotation.AbstractMergedAnnotation.createSynthesizedAnnotation.

Doc from org.springframework.core.annotation.AbstractMergedAnnotation.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.

Annotations
@Override
filterAttributesback to summary
public MergedAnnotation<A> filterAttributes(Predicate<String> predicate)

Implements org.springframework.core.annotation.MergedAnnotation.filterAttributes.

Doc from org.springframework.core.annotation.MergedAnnotation.filterAttributes.

Create a new view of the annotation with only attributes that match the given predicate.

Parameters
predicate:Predicate<String>

a predicate used to filter attribute names

Returns:MergedAnnotation<A>

a filtered view of the annotation

Annotations
@Override
getAggregateIndexback to summary
public int getAggregateIndex()

Implements org.springframework.core.annotation.MergedAnnotation.getAggregateIndex.

Doc from org.springframework.core.annotation.MergedAnnotation.getAggregateIndex.

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.

Returns:int

the aggregate index (starting at 0) or -1 if the annotation is missing

Annotations
@Override
getAnnotationback to summary
public <T extends Annotation> MergedAnnotation<T> getAnnotation(String attributeName, Class<T> type) throws NoSuchElementException

Implements org.springframework.core.annotation.MergedAnnotation.getAnnotation.

Doc from org.springframework.core.annotation.MergedAnnotation.getAnnotation.

Get a required annotation attribute value from the annotation.

Parameters
attributeName:String

the attribute name

type:Class<T>

the annotation type

Returns:MergedAnnotation<T>

the value as a MergedAnnotation

Annotations
@Override
Exceptions
NoSuchElementException:
if there is no matching attribute
getAnnotationArrayback to summary
public <T extends Annotation> MergedAnnotation<T>[] getAnnotationArray(String attributeName, Class<T> type) throws NoSuchElementException

Implements org.springframework.core.annotation.MergedAnnotation.getAnnotationArray.

Doc from org.springframework.core.annotation.MergedAnnotation.getAnnotationArray.

Get a required annotation array attribute value from the annotation.

Parameters
attributeName:String

the attribute name

type:Class<T>

the annotation type

Returns:MergedAnnotation<T>[]

the value as a MergedAnnotation array

Annotations
@Override
Exceptions
NoSuchElementException:
if there is no matching attribute
getAttributeValueback to summary
protected <T> T getAttributeValue(String attributeName, Class<T> type)

Implements abstract org.springframework.core.annotation.AbstractMergedAnnotation.getAttributeValue.

Doc from org.springframework.core.annotation.AbstractMergedAnnotation.getAttributeValue.

Get the underlying attribute value.

Parameters
attributeName:String

the attribute name

type:Class<T>

the type to return (see MergedAnnotation class documentation for details)

Returns:T

the attribute value or null if the value is not found and is not required

Annotations
@Override
getDefaultValueback to summary
public <T> Optional<T> getDefaultValue(String attributeName, Class<T> type)

Implements org.springframework.core.annotation.MergedAnnotation.getDefaultValue.

Doc from org.springframework.core.annotation.MergedAnnotation.getDefaultValue.

Get the default attribute value from the annotation as specified in the annotation declaration.

Parameters
attributeName:String

the attribute name

type:Class<T>

the attribute type. Must be compatible with the underlying attribute type or Object.class.

Returns:Optional<T>

an optional of the default value or Optional#empty() if there is no matching attribute or no defined default

Annotations
@Override
getDistanceback to summary
public int getDistance()

Implements org.springframework.core.annotation.MergedAnnotation.getDistance.

Doc from org.springframework.core.annotation.MergedAnnotation.getDistance.

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.

Returns:int

the annotation distance or -1 if the annotation is missing

Annotations
@Override
getInstanceback to summary
pack-priv static <A extends Annotation> MergedAnnotation<A> getInstance()
Annotations
@SuppressWarnings:unchecked
getMetaSourceback to summary
public MergedAnnotation<?> getMetaSource()

Implements org.springframework.core.annotation.MergedAnnotation.getMetaSource.

Doc from org.springframework.core.annotation.MergedAnnotation.getMetaSource.

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.

Returns:MergedAnnotation<?>

the meta-annotation source or null

Annotations
@Override
@Nullable
getMetaTypesback to summary
public List<Class<? extends Annotation>> getMetaTypes()

Implements org.springframework.core.annotation.MergedAnnotation.getMetaTypes.

Doc from org.springframework.core.annotation.MergedAnnotation.getMetaTypes.

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.

Returns:List<Class<? extends Annotation>>

the meta types for the annotation

Annotations
@Override
getRootback to summary
public MergedAnnotation<?> getRoot()

Implements org.springframework.core.annotation.MergedAnnotation.getRoot.

Doc from org.springframework.core.annotation.MergedAnnotation.getRoot.

Get the root annotation, i.e. the distance 0 annotation as directly declared on the source.

Returns:MergedAnnotation<?>

the root annotation

Annotations
@Override
getSourceback to summary
public Object getSource()

Implements org.springframework.core.annotation.MergedAnnotation.getSource.

Doc from org.springframework.core.annotation.MergedAnnotation.getSource.

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.

Returns:Object

the source, or null

Annotations
@Override
@Nullable
getTypeback to summary
public Class<A> getType()

Implements org.springframework.core.annotation.MergedAnnotation.getType.

Doc from org.springframework.core.annotation.MergedAnnotation.getType.

Get the Class reference for the actual annotation type.

Returns:Class<A>

the annotation type

Annotations
@Override
getValueback to summary
public <T> Optional<T> getValue(String attributeName, Class<T> type)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.getValue.

Implements org.springframework.core.annotation.MergedAnnotation.getValue.

Doc from org.springframework.core.annotation.MergedAnnotation.getValue.

Get an optional attribute value from the annotation.

Parameters
attributeName:String

the attribute name

type:Class<T>

the attribute type. Must be compatible with the underlying attribute type or Object.class.

Returns:Optional<T>

an optional value or Optional#empty() if there is no matching attribute

Annotations
@Override
hasDefaultValueback to summary
public boolean hasDefaultValue(String attributeName)

Implements org.springframework.core.annotation.MergedAnnotation.hasDefaultValue.

Doc from org.springframework.core.annotation.MergedAnnotation.hasDefaultValue.

Determine if the specified attribute name has a default value when compared to the annotation declaration.

Parameters
attributeName:String

the attribute name

Returns:boolean

true if the attribute value is the same as the default value

Annotations
@Override
hasNonDefaultValueback to summary
public boolean hasNonDefaultValue(String attributeName)

Overrides org.springframework.core.annotation.AbstractMergedAnnotation.hasNonDefaultValue.

Implements org.springframework.core.annotation.MergedAnnotation.hasNonDefaultValue.

Doc from org.springframework.core.annotation.MergedAnnotation.hasNonDefaultValue.

Determine if the specified attribute name has a non-default value when compared to the annotation declaration.

Parameters
attributeName:String

the attribute name

Returns:boolean

true if the attribute value is different from the default value

Annotations
@Override
isPresentback to summary
public boolean isPresent()

Implements org.springframework.core.annotation.MergedAnnotation.isPresent.

Doc from org.springframework.core.annotation.MergedAnnotation.isPresent.

Determine if the annotation is present on the source. Considers directly present and meta-present annotations within the context of the SearchStrategy used.

Returns:boolean

true if the annotation is present

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
withNonMergedAttributesback to summary
public MergedAnnotation<A> withNonMergedAttributes()

Implements org.springframework.core.annotation.MergedAnnotation.withNonMergedAttributes.

Doc from org.springframework.core.annotation.MergedAnnotation.withNonMergedAttributes.

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.

Returns:MergedAnnotation<A>

a non-merged view of the annotation

Annotations
@Override