public class HandlerMethod extends ObjectSE
クラスは、Bean インスタンスまたは Bean 名(例: lazy-init Bean、プロトタイプ Bean)で作成できます。createWithResolvedBean()
を使用して、関連する BeanFactory
によって解決された Bean インスタンスを持つ HandlerMethod
インスタンスを取得します。
修飾子と型 | クラスと説明 |
---|---|
protected class | HandlerMethod.HandlerMethodParameter HandlerMethod 固有の動作を持つ MethodParameter。 |
修飾子 | コンストラクターと説明 |
---|---|
protected | HandlerMethod(HandlerMethod handlerMethod) サブクラスで使用するコンストラクターをコピーします。 |
| HandlerMethod(ObjectSE bean, MethodSE method) Bean インスタンスとメソッドからインスタンスを作成します。 |
protected | HandlerMethod(ObjectSE bean, MethodSE method, MessageSource messageSource) サブクラスから使用するために MessageSource も受け入れる HandlerMethod(Object, Method) のバリアント。 |
| HandlerMethod(ObjectSE bean, StringSE methodName, ClassSE<?>... parameterTypes) Bean インスタンス、メソッド名、パラメーター型からインスタンスを作成します。 |
| HandlerMethod(StringSE beanName, BeanFactory beanFactory, MessageSource messageSource, MethodSE method) MessageSource も受け入れる HandlerMethod(String, BeanFactory, Method) のバリアント。 |
| HandlerMethod(StringSE beanName, BeanFactory beanFactory, MethodSE method) Bean 名、メソッド、 BeanFactory からインスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected void | assertTargetBean(MethodSE method, ObjectSE targetBean, ObjectSE[] args) ターゲット Bean クラスが、指定されたメソッドが宣言されているクラスのインスタンスであることをアサートします。 |
HandlerMethod | createWithResolvedBean() 提供されたインスタンスにオブジェクトインスタンスではなく Bean 名が含まれる場合、 HandlerMethod が作成されて返される前に、Bean 名が解決されます。 |
boolean | equals(ObjectSE other) |
protected static ObjectSE | findProvidedArgument(MethodParameter parameter, ObjectSE... providedArgs) |
protected static StringSE | formatArgumentError(MethodParameter param, StringSE message) |
protected StringSE | formatInvokeError(StringSE text, ObjectSE[] args) |
ObjectSE | getBean() このハンドラーメソッドの Bean を返します。 |
ClassSE<?> | getBeanType() このメソッドは、このハンドラーメソッドのハンドラーの型を返します。 |
protected MethodSE | getBridgedMethod() Bean メソッドがブリッジメソッドである場合、このメソッドはブリッジ(ユーザー定義)メソッドを返します。 |
MethodSE | getMethod() このハンドラーメソッドのメソッドを返します。 |
<A extends AnnotationSE> | getMethodAnnotation(ClassSE<A> annotationType) 指定されたメソッド自体にアノテーションが見つからない場合、そのスーパーメソッドをトラバースする基礎となるメソッドに単一のアノテーションを返します。 |
MethodParameter[] | getMethodParameters() このハンドラーメソッドのメソッドパラメーターを返します。 |
HandlerMethod | getResolvedFromHandlerMethod() この HandlerMethod インスタンスが createWithResolvedBean() を介して解決された HandlerMethod を返します。 |
protected HttpStatus | getResponseStatus() 指定されたレスポンスステータスがあれば返します。 |
protected StringSE | getResponseStatusReason() 関連するレスポンスステータスの理由があれば返します。 |
MethodParameter | getReturnType() HandlerMethod 戻り値の型を返します。 |
MethodParameter | getReturnValueType(ObjectSE returnValue) 実際の戻り値の型を返します。 |
StringSE | getShortLogMessage() ログメッセージのために、このハンドラーメソッドの短い表現を返します。 |
int | hashCode() |
<A extends AnnotationSE> | hasMethodAnnotation(ClassSE<A> annotationType) 指定されたアノテーション型でパラメーターが宣言されているかどうかを返します。 |
boolean | isVoid() メソッドの戻り値の型が void の場合は true を返し、そうでない場合は false を返します。 |
StringSE | toString() |
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
protected static final Log logger
protected HandlerMethod(ObjectSE bean, MethodSE method, @Nullable MessageSource messageSource)
MessageSource
も受け入れる HandlerMethod(Object, Method)
のバリアント。public HandlerMethod(ObjectSE bean, StringSE methodName, ClassSE<?>... parameterTypes) throws NoSuchMethodExceptionSE
NoSuchMethodExceptionSE
- メソッドが見つからない場合 public HandlerMethod(StringSE beanName, BeanFactory beanFactory, MethodSE method)
BeanFactory
からインスタンスを作成します。メソッド createWithResolvedBean()
は、初期化された Bean で HandlerMethod
を再作成するために後で使用できます。public HandlerMethod(StringSE beanName, BeanFactory beanFactory, @Nullable MessageSource messageSource, MethodSE method)
MessageSource
も受け入れる HandlerMethod(String, BeanFactory, Method)
のバリアント。protected HandlerMethod(HandlerMethod handlerMethod)
public ObjectSE getBean()
public MethodSE getMethod()
public ClassSE<?> getBeanType()
Bean 型が CGLIB で生成されたクラスである場合、元のユーザー定義のクラスが返されることに注意してください。
protected MethodSE getBridgedMethod()
getMethod()
と同じメソッドを返します。public MethodParameter[] getMethodParameters()
@Nullable protected HttpStatus getResponseStatus()
ResponseStatus.code()
@Nullable protected StringSE getResponseStatusReason()
ResponseStatus.reason()
public MethodParameter getReturnType()
public MethodParameter getReturnValueType(@Nullable ObjectSE returnValue)
public boolean isVoid()
true
を返し、そうでない場合は false
を返します。@Nullable public <A extends AnnotationSE> A getMethodAnnotation(ClassSE<A> annotationType)
Spring Framework 4.2.2 の時点で、属性オーバーライドを使用してマージされた合成アノテーションもサポートします。
annotationType
- メソッドを内省するためのアノテーションの型 null
AnnotatedElementUtils.findMergedAnnotation(java.lang.reflect.AnnotatedElement, java.lang.Class<A>)
public <A extends AnnotationSE> boolean hasMethodAnnotation(ClassSE<A> annotationType)
annotationType
- 検索するアノテーション型 AnnotatedElementUtils.hasAnnotation(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
@Nullable public HandlerMethod getResolvedFromHandlerMethod()
createWithResolvedBean()
を介して解決された HandlerMethod を返します。public HandlerMethod createWithResolvedBean()
HandlerMethod
が作成されて返される前に、Bean 名が解決されます。public StringSE getShortLogMessage()
public int hashCode()
ObjectSE
の hashCodeSE
public StringSE toString()
ObjectSE
の toStringSE
@Nullable protected static ObjectSE findProvidedArgument(MethodParameter parameter, @Nullable ObjectSE... providedArgs)
protected static StringSE formatArgumentError(MethodParameter param, StringSE message)
protected void assertTargetBean(MethodSE method, ObjectSE targetBean, ObjectSE[] args)
@Controller
は、クラスベースのプロキシメカニズムを優先する必要があります。