Class SynthesizingMethodParameter
java.lang.Object
org.springframework.core.MethodParameter
org.springframework.core.annotation.SynthesizingMethodParameter
- Direct Known Subclasses:
- AnnotatedMethod.AnnotatedMethodParameter
A 
MethodParameter variant which synthesizes annotations that
declare attribute aliases via @AliasFor.- Since:
- 4.2
- Author:
- Juergen Hoeller, Sam Brannen
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionSynthesizingMethodParameter(Constructor<?> constructor, int parameterIndex) Create a newSynthesizingMethodParameterfor the given constructor, with nesting level 1.SynthesizingMethodParameter(Constructor<?> constructor, int parameterIndex, int nestingLevel) Create a newSynthesizingMethodParameterfor the given constructor.SynthesizingMethodParameter(Method method, int parameterIndex) Create a newSynthesizingMethodParameterfor the given method, with nesting level 1.SynthesizingMethodParameter(Method method, int parameterIndex, int nestingLevel) Create a newSynthesizingMethodParameterfor the given method.protectedCopy constructor, resulting in an independentSynthesizingMethodParameterbased on the same metadata and cache state that the original object was in.
- 
Method SummaryModifier and TypeMethodDescriptionprotected <A extends Annotation>
 AadaptAnnotation(A annotation) A template method to post-process a given annotation instance before returning it to the caller.protected Annotation[]adaptAnnotationArray(Annotation[] annotations) A template method to post-process a given annotation array before returning it to the caller.clone()static SynthesizingMethodParameterforExecutable(Executable executable, int parameterIndex) Create a new SynthesizingMethodParameter for the given method or constructor.static SynthesizingMethodParameterforParameter(Parameter parameter) Create a new SynthesizingMethodParameter for the given parameter descriptor.Methods inherited from class MethodParameterdecreaseNestingLevel, equals, findParameterIndex, forFieldAwareConstructor, forMethodOrConstructor, getAnnotatedElement, getConstructor, getContainingClass, getDeclaringClass, getExecutable, getGenericParameterType, getMember, getMethod, getMethodAnnotation, getMethodAnnotations, getNestedGenericParameterType, getNestedParameterType, getNestingLevel, getParameter, getParameterAnnotation, getParameterAnnotations, getParameterIndex, getParameterName, getParameterType, getTypeIndexForCurrentLevel, getTypeIndexForLevel, hashCode, hasMethodAnnotation, hasParameterAnnotation, hasParameterAnnotations, increaseNestingLevel, initParameterNameDiscovery, isOptional, nested, nested, nestedIfOptional, setTypeIndexForCurrentLevel, toString, withContainingClass, withTypeIndex
- 
Constructor Details- 
SynthesizingMethodParameterCreate a newSynthesizingMethodParameterfor the given method, with nesting level 1.- Parameters:
- method- the Method to specify a parameter for
- parameterIndex- the index of the parameter: -1 for the method return type; 0 for the first method parameter; 1 for the second method parameter, etc.
 
- 
SynthesizingMethodParameterCreate a newSynthesizingMethodParameterfor the given method.- Parameters:
- method- the Method to specify a parameter for
- parameterIndex- the index of the parameter: -1 for the method return type; 0 for the first method parameter; 1 for the second method parameter, etc.
- nestingLevel- the nesting level of the target type (typically 1; for example, in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
 
- 
SynthesizingMethodParameterCreate a newSynthesizingMethodParameterfor the given constructor, with nesting level 1.- Parameters:
- constructor- the Constructor to specify a parameter for
- parameterIndex- the index of the parameter
 
- 
SynthesizingMethodParameterpublic SynthesizingMethodParameter(Constructor<?> constructor, int parameterIndex, int nestingLevel) Create a newSynthesizingMethodParameterfor the given constructor.- Parameters:
- constructor- the Constructor to specify a parameter for
- parameterIndex- the index of the parameter
- nestingLevel- the nesting level of the target type (typically 1; for example, in case of a List of Lists, 1 would indicate the nested List, whereas 2 would indicate the element of the nested List)
 
- 
SynthesizingMethodParameterCopy constructor, resulting in an independentSynthesizingMethodParameterbased on the same metadata and cache state that the original object was in.- Parameters:
- original- the original SynthesizingMethodParameter object to copy from
 
 
- 
- 
Method Details- 
adaptAnnotationDescription copied from class:MethodParameterA template method to post-process a given annotation instance before returning it to the caller.The default implementation simply returns the given annotation as-is. - Overrides:
- adaptAnnotationin class- MethodParameter
- Parameters:
- annotation- the annotation about to be returned
- Returns:
- the post-processed annotation (or simply the original one)
 
- 
adaptAnnotationArrayDescription copied from class:MethodParameterA template method to post-process a given annotation array before returning it to the caller.The default implementation simply returns the given annotation array as-is. - Overrides:
- adaptAnnotationArrayin class- MethodParameter
- Parameters:
- annotations- the annotation array about to be returned
- Returns:
- the post-processed annotation array (or simply the original one)
 
- 
clone- Overrides:
- clonein class- MethodParameter
 
- 
forExecutableCreate a new SynthesizingMethodParameter for the given method or constructor.This is a convenience factory method for scenarios where a Method or Constructor reference is treated in a generic fashion. - Parameters:
- executable- the Method or Constructor to specify a parameter for
- parameterIndex- the index of the parameter
- Returns:
- the corresponding SynthesizingMethodParameter instance
- Since:
- 5.0
 
- 
forParameterCreate a new SynthesizingMethodParameter for the given parameter descriptor.This is a convenience factory method for scenarios where a Java 8 Parameterdescriptor is already available.- Parameters:
- parameter- the parameter descriptor
- Returns:
- the corresponding SynthesizingMethodParameter instance
- Since:
- 5.0
 
 
-