The class may be created with a bean instance or with a bean name
(e.g. lazy-init bean, prototype bean). Use createWithResolvedBean()
to obtain a HandlerMethod instance with a bean instance resolved
through the associated BeanFactory.
| Modifier and Type | Class and Description |
|---|---|
| private static class | HandlerMethod.
Checks for the presence of |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private final BeanFactory | |
| private final Class | |
| private final String | |
| protected static final Log | logger
Logger that is available to subclasses. |
| private final MessageSource | |
| private HandlerMethod | |
| private HttpStatusCode | |
| private String | |
| private final boolean | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| protected | HandlerMethod(Object bean, Method method, MessageSource messageSource)
Variant of |
| public | HandlerMethod(Object bean, String methodName, Class<?>... parameterTypes)
Create an instance from a bean instance, method name, and parameter types. |
| public | HandlerMethod(String beanName, BeanFactory beanFactory, Method method)
Create an instance from a bean name, a method, and a |
| public | HandlerMethod(String beanName, BeanFactory beanFactory, MessageSource messageSource, Method method)
Variant of |
| protected | |
| private | HandlerMethod(HandlerMethod handlerMethod, Object handler, boolean initValidateFlags)
Re-create HandlerMethod with additional input. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | assertTargetBean(Method method, Object targetBean, Object[] args)
Assert that the target bean class is an instance of the class where the given method is declared. |
| public HandlerMethod | createWithResolvedBean()
If the provided instance contains a bean name rather than an object instance,
the bean name is resolved before a |
| public HandlerMethod | createWithValidateFlags()
Re-create the HandlerMethod and initialize
|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides org. Indicates whether some other object is "equal to" this one. |
| private void | |
| protected String | |
| public Object | |
| public Class | |
| protected Class | getContainingClass()
Overrides org. Expose the containing class for method parameters. |
| public HandlerMethod | getResolvedFromHandlerMethod()
Return the HandlerMethod from which this HandlerMethod instance was
resolved via |
| protected HttpStatusCode | |
| protected String | |
| public String | |
| public int | hashCode()
Overrides org. Returns a hash code value for this object. |
| private static String | |
| public boolean | shouldValidateArguments()
Whether the method arguments are a candidate for method validation, which
is the case when there are parameter |
| public boolean | shouldValidateReturnValue()
Whether the method return value is a candidate for method validation, which
is the case when there are method |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| bean | back to summary |
|---|---|
| private final Object bean | |
| beanFactory | back to summary |
|---|---|
| private final BeanFactory beanFactory
| |
| beanType | back to summary |
|---|---|
| private final Class<?> beanType | |
| description | back to summary |
|---|---|
| private final String description | |
| logger | back to summary |
|---|---|
| protected static final Log logger Logger that is available to subclasses. | |
| messageSource | back to summary |
|---|---|
| private final MessageSource messageSource
| |
| resolvedFromHandlerMethod | back to summary |
|---|---|
| private HandlerMethod resolvedFromHandlerMethod
| |
| responseStatus | back to summary |
|---|---|
| private HttpStatusCode responseStatus
| |
| responseStatusReason | back to summary |
|---|---|
| private String responseStatusReason
| |
| validateArguments | back to summary |
|---|---|
| private final boolean validateArguments | |
| validateReturnValue | back to summary |
|---|---|
| private final boolean validateReturnValue | |
| HandlerMethod | back to summary |
|---|---|
| public HandlerMethod(Object bean, Method method) Create an instance from a bean instance and a method. | |
| HandlerMethod | back to summary |
|---|---|
| protected HandlerMethod(Object bean, Method method, MessageSource messageSource) Variant of
| |
| HandlerMethod | back to summary |
|---|---|
| public HandlerMethod(Object bean, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException Create an instance from a bean instance, method name, and parameter types.
| |
| HandlerMethod | back to summary |
|---|---|
| public HandlerMethod(String beanName, BeanFactory beanFactory, Method method) Create an instance from a bean name, a method, and a | |
| HandlerMethod | back to summary |
|---|---|
| public HandlerMethod(String beanName, BeanFactory beanFactory, MessageSource messageSource, Method method) Variant of | |
| HandlerMethod | back to summary |
|---|---|
| protected HandlerMethod(HandlerMethod handlerMethod) Copy constructor for use in subclasses. | |
| HandlerMethod | back to summary |
|---|---|
| private HandlerMethod(HandlerMethod handlerMethod, Object handler, boolean initValidateFlags) Re-create HandlerMethod with additional input. | |
| assertTargetBean | back to summary |
|---|---|
| protected void assertTargetBean(Method method, Object targetBean, Object[] args) Assert that the target bean class is an instance of the class where the given
method is declared. In some cases the actual controller instance at request-
processing time may be a JDK dynamic proxy (lazy initialization, prototype
beans, and others). | |
| createWithResolvedBean | back to summary |
|---|---|
| public HandlerMethod createWithResolvedBean() If the provided instance contains a bean name rather than an object instance,
the bean name is resolved before a | |
| createWithValidateFlags | back to summary |
|---|---|
| public HandlerMethod createWithValidateFlags() Re-create the HandlerMethod and initialize
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides org. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| evaluateResponseStatus | back to summary |
|---|---|
| private void evaluateResponseStatus() | |
| formatInvokeError | back to summary |
|---|---|
| protected String formatInvokeError(String text, Object[] args) | |
| getBean | back to summary |
|---|---|
| public Object getBean() Return the bean for this handler method. | |
| getBeanType | back to summary |
|---|---|
| public Class This method returns the type of the handler for this handler method. Note that if the bean type is a CGLIB-generated class, the original user-defined class is returned. | |
| getContainingClass | back to summary |
|---|---|
| protected Class Overrides org. Doc from org. Expose the containing class for method parameters.
| |
| getResolvedFromHandlerMethod | back to summary |
|---|---|
| public HandlerMethod getResolvedFromHandlerMethod() Return the HandlerMethod from which this HandlerMethod instance was
resolved via
| |
| getResponseStatus | back to summary |
|---|---|
| protected HttpStatusCode getResponseStatus() Return the specified response status, if any.
| |
| getResponseStatusReason | back to summary |
|---|---|
| protected String getResponseStatusReason() Return the associated response status reason, if any.
| |
| getShortLogMessage | back to summary |
|---|---|
| public String getShortLogMessage() Return a short representation of this handler method for log message purposes.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initDescription | back to summary |
|---|---|
| private static String initDescription(Class<?> beanType, Method method) | |
| shouldValidateArguments | back to summary |
|---|---|
| public boolean shouldValidateArguments() Whether the method arguments are a candidate for method validation, which
is the case when there are parameter The presence of Note if the class is annotated with
| |
| shouldValidateReturnValue | back to summary |
|---|---|
| public boolean shouldValidateReturnValue() Whether the method return value is a candidate for method validation, which
is the case when there are method Note if the class is annotated with
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
@Constraint and @Valid
annotations on the method and method parameters.
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static final Predicate | |
| private static final Predicate |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static boolean | |
| private static Annotation[] | getContainerElementAnnotations(MethodParameter param)
There may be constraints on elements of a container (list, map). |
| private static boolean |
| BEAN_VALIDATION_PRESENT | back to summary |
|---|---|
| private static final boolean BEAN_VALIDATION_PRESENT | |
| CONSTRAINT_PREDICATE | back to summary |
|---|---|
| private static final Predicate<MergedAnnotation<? extends Annotation>> CONSTRAINT_PREDICATE | |
| VALID_PREDICATE | back to summary |
|---|---|
| private static final Predicate<MergedAnnotation<? extends Annotation>> VALID_PREDICATE | |
| MethodValidationInitializer | back to summary |
|---|---|
| private MethodValidationInitializer() | |
| checkArguments | back to summary |
|---|---|
| public static boolean checkArguments(Class<?> beanType, MethodParameter[] parameters) | |
| checkReturnValue | back to summary |
|---|---|
| public static boolean checkReturnValue(Class<?> beanType, Method method) | |
| getContainerElementAnnotations | back to summary |
|---|---|
| private static Annotation[] getContainerElementAnnotations(MethodParameter param) There may be constraints on elements of a container (list, map). | |
| isIndexOrKeyBasedContainer | back to summary |
|---|---|
| private static boolean isIndexOrKeyBasedContainer(Class<?> type) | |