T - 変換されたオブジェクト型 public class SourceHttpMessageConverter<T extends SourceSE> extends AbstractHttpMessageConverter<T>
SourceSE オブジェクトを読み書きできる HttpMessageConverter の実装。logger| コンストラクターと説明 |
|---|
SourceHttpMessageConverter() |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected LongSE | getContentLength(T t, MediaType contentType) 指定された型のコンテンツの長さを返します。 |
boolean | isProcessExternalEntities()XML 外部エンティティが許可されているかどうかを返します。 |
boolean | isSupportDtd()DTD 解析がサポートされているかどうかを返します。 |
protected T | readInternal(ClassSE<? extends T> clazz, HttpInputMessage inputMessage) 実際のオブジェクトを読み取る抽象テンプレートメソッド。 |
void | setProcessExternalEntities(boolean processExternalEntities)Source への変換時に外部 XML エンティティが処理されるかどうかを示します。 |
void | setSupportDtd(boolean supportDtd)DTD 解析をサポートする必要があるかどうかを示します。 |
boolean | supports(ClassSE<?> clazz) 指定されたクラスがこのコンバーターでサポートされているかどうかを示します。 |
protected void | writeInternal(T t, HttpOutputMessage outputMessage) 実際の本文を書き込む抽象テンプレートメソッド。 |
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writecloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEgetSupportedMediaTypespublic void setSupportDtd(boolean supportDtd)
デフォルトは false で、DTD が無効になっています。
public boolean isSupportDtd()
public void setProcessExternalEntities(boolean processExternalEntities)
デフォルトは false です。これは、外部エンティティが解決されないことを意味します。
注意 : このオプションを true に設定すると、setSupportDtd(boolean) が true に自動的に設定されます。
public boolean isProcessExternalEntities()
public boolean supports(ClassSE<?> clazz)
AbstractHttpMessageConverterAbstractHttpMessageConverter<T extends SourceSE> の supports clazz - サポートをテストするクラス true。それ以外の場合は false protected T readInternal(ClassSE<? extends T> clazz, HttpInputMessage inputMessage) throws IOExceptionSE, HttpMessageNotReadableException
AbstractHttpMessageConverterAbstractHttpMessageConverter.read(java.lang.Class<? extends T>, org.springframework.http.HttpInputMessage) から呼び出されます。AbstractHttpMessageConverter<T extends SourceSE> の readInternal clazz - 返すオブジェクトの型 inputMessage - 読み込む HTTP 入力メッセージ IOExceptionSE - I/O エラーの場合 HttpMessageNotReadableException - 変換エラーの場合 @Nullable protected LongSE getContentLength(T t, @Nullable MediaType contentType)
AbstractHttpMessageConverter デフォルトでは、これは null を返します。これは、コンテンツの長さが不明であることを意味します。サブクラスでオーバーライドできます。
AbstractHttpMessageConverter<T extends SourceSE> の getContentLength t - コンテンツの長さを返す型 null protected void writeInternal(T t, HttpOutputMessage outputMessage) throws IOExceptionSE, HttpMessageNotWritableException
AbstractHttpMessageConverterAbstractHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage) から呼び出されます。AbstractHttpMessageConverter<T extends SourceSE> の writeInternal t - 出力メッセージに書き込むオブジェクト outputMessage - 書き込む HTTP 出力メッセージ IOExceptionSE - I/O エラーの場合 HttpMessageNotWritableException - 変換エラーの場合