クラス RequestBodyAdviceAdapter
java.lang.ObjectSE
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
- 実装済みのインターフェース一覧:
RequestBodyAdvice
デフォルトのメソッド実装で
RequestBodyAdvice を実装するための便利な出発点。 アドバイスがいつ適用されるかに応じて true を返すには、RequestBodyAdvice.supports(MethodParameter, Type, Class) を実装するためにサブクラスが必要です。
- 導入:
- 4.2
- 作成者:
- Rossen Stoyanchev
コンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明afterBodyRead(ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された InputMessage を返します。handleEmptyBody(@Nullable ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース RequestBodyAdvice から継承されたメソッド
determineReadHints, supports
コンストラクターの詳細
RequestBodyAdviceAdapter
public RequestBodyAdviceAdapter()
メソッドの詳細
beforeBodyRead
public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) throws IOExceptionSE デフォルトの実装は、渡された InputMessage を返します。- 次で指定:
- インターフェース
RequestBodyAdviceのbeforeBodyRead - パラメーター:
inputMessage- リクエストparameter- ターゲットメソッドのパラメーターtargetType- ターゲット型。必ずしもメソッドパラメーター型と同じである必要はありません (例:HttpEntity<String>)。converterType- 本体の逆直列化に使用されるコンバーター- 戻り値:
- 入力リクエストまたは新しいインスタンス (決して
nullではない) - 例外:
IOExceptionSE
afterBodyRead
public ObjectSE afterBodyRead(ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。- 次で指定:
- インターフェース
RequestBodyAdviceのafterBodyRead - パラメーター:
body- 最初のアドバイスが呼び出される前にコンバーターオブジェクトに設定されますinputMessage- リクエストparameter- ターゲットメソッドのパラメーターtargetType- ターゲット型。必ずしもメソッドパラメーター型と同じである必要はありません (例:HttpEntity<String>)。converterType- 本体の逆直列化に使用されるコンバーター- 戻り値:
- 同じ本体または新しいインスタンス
handleEmptyBody
public @Nullable ObjectSE handleEmptyBody(@Nullable ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。- 次で指定:
- インターフェース
RequestBodyAdviceのhandleEmptyBody - パラメーター:
body- 通常、最初のアドバイスが呼び出される前にnullに設定されますinputMessage- リクエストparameter- メソッドパラメーターtargetType- ターゲット型。必ずしもメソッドパラメーター型と同じである必要はありません (例:HttpEntity<String>)。converterType- 選択したコンバーター型- 戻り値:
- 使用する値、または引数が必要な場合に
HttpMessageNotReadableExceptionを発生させる可能性のあるnull