public abstract class RequestBodyAdviceAdapter extends ObjectSE implements RequestBodyAdvice
ResponseBodyAdvice
を実装するための便利な出発点。 サブクラスは、アドバイスが適用されるタイミングに応じて true を返すために RequestBodyAdvice.supports(org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>>)
を実装する必要があります。
コンストラクターと説明 |
---|
RequestBodyAdviceAdapter() |
修飾子と型 | メソッドと説明 |
---|---|
ObjectSE | afterBodyRead(ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。 |
HttpInputMessage | beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された InputMessage を返します。 |
ObjectSE | handleEmptyBody(ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) デフォルトの実装は、渡された本体を返します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
supports
public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType) throws IOExceptionSE
RequestBodyAdvice
の beforeBodyRead
inputMessage
- リクエスト parameter
- ターゲットメソッドのパラメーター targetType
- ターゲットのタイプ。必ずしもメソッドのパラメーターのタイプと同じではありません。HttpEntity<String>
の場合。converterType
- 本体の逆直列化に使用されるコンバーター null
は使用しない IOExceptionSE
public ObjectSE afterBodyRead(ObjectSE body, HttpInputMessage inputMessage, MethodParameter parameter, TypeSE targetType, ClassSE<? extends HttpMessageConverter<?>> converterType)
RequestBodyAdvice
の afterBodyRead
body
- 最初のアドバイスが呼び出される前にコンバーターオブジェクトに設定されます inputMessage
- リクエスト parameter
- ターゲットメソッドのパラメーター targetType
- ターゲットのタイプ。必ずしもメソッドのパラメーターのタイプと同じではありません。HttpEntity<String>
の場合。converterType
- 本体の逆直列化に使用されるコンバーター @Nullable public 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