クラス MarshallingView
java.lang.ObjectSE
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.xml.MarshallingView
- 実装されているすべてのインターフェース:
- Aware、- BeanNameAware、- ApplicationContextAware、- ServletContextAware、- View
Marshaller によるマーシャリングの結果としてレンダリングされるレスポンスコンテキストを可能にする Spring-MVC View。 マーシャリングされるオブジェクトは、モデルのパラメーターとして提供され、レスポンスのレンダリング中に検出されます。ユーザーは、sourceKey プロパティを使用してモデルの特定のエントリを指定するか、Spring に Source オブジェクトを配置させることができます。
- 導入:
- 3.0
- 作成者:
- Arjen Poutsma, Juergen Hoeller
- フィールドのサマリーフィールド- クラス org.springframework.context.support.ApplicationObjectSupport から継承されたフィールド- logger- インターフェース org.springframework.web.servlet.View から継承されたフィールド- PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
- コンストラクターの概要コンストラクターコンストラクター説明- Marshallerが設定されていない新しい- MarshallingViewを構築します。- MarshallingView- (Marshaller marshaller) 指定された- Marshallerセットで新しい- MarshallingViewを構築します。
- メソッドのサマリー修飾子と型メソッド説明- protected voidサブクラスは、カスタム初期化動作のためにこれをオーバーライドできます。- protected boolean- isEligibleForMarshalling- (StringSE modelKey, ObjectSE value) 現在のビューのモデルからの指定された値が、構成された- Marshallerによるマーシャリングに適格かどうかを確認します。- protected ObjectSE- locateToBeMarshalled- (MapSE<StringSE, - ObjectSE> model) マーシャリングするオブジェクトを見つけます。- protected void- renderMergedOutputModel- (MapSE<StringSE, - ObjectSE> model, HttpServletRequestEE request, HttpServletResponseEE response) ビューを実際にレンダリングするには、サブクラスでこのメソッドを実装する必要があります。- void- setMarshaller- (Marshaller marshaller) このビューで使用する- Marshallerを設定します。- void- setModelKey- (StringSE modelKey) マーシャリングするオブジェクトを表すモデルキーの名前を設定します。- クラス org.springframework.web.servlet.view.AbstractView から継承されたメソッド- addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse- クラス org.springframework.web.context.support.WebApplicationObjectSupport から継承されたメソッド- getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext- クラス org.springframework.context.support.ApplicationObjectSupport から継承されたメソッド- getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
- フィールドの詳細- DEFAULT_CONTENT_TYPEデフォルトのコンテンツ型。Bean プロパティとしてオーバーライド可能。- 関連事項:
 
 
- コンストラクターの詳細- MarshallingViewpublic MarshallingView()- Marshallerが設定されていない新しい- MarshallingViewを構築します。マーシャラーは、構築後に- setMarshaller(org.springframework.oxm.Marshaller)を呼び出して設定する必要があります。
- MarshallingView指定された- Marshallerセットで新しい- MarshallingViewを構築します。
 
- メソッドの詳細- setMarshallerこのビューで使用する- Marshallerを設定します。
- setModelKeyマーシャリングするオブジェクトを表すモデルキーの名前を設定します。指定されていない場合、サポートされている値型についてモデルマップが検索されます。
- initApplicationContextprotected void initApplicationContext()クラスからコピーされた説明:- ApplicationObjectSupportサブクラスは、カスタム初期化動作のためにこれをオーバーライドできます。- デフォルトの実装は空です。 - ApplicationObjectSupport.initApplicationContext(ApplicationContext)によって呼び出されます。
- renderMergedOutputModelprotected void renderMergedOutputModel- (MapSE<StringSE, - ObjectSE> model, HttpServletRequestEE request, HttpServletResponseEE response) throws ExceptionSEクラスからコピーされた説明:- AbstractViewビューを実際にレンダリングするには、サブクラスでこのメソッドを実装する必要があります。- 最初のステップは、リクエストの準備です。JSP の場合、これはモデルオブジェクトをリクエスト属性として設定することを意味します。2 番目のステップは、たとえば RequestDispatcher を介した JSP を含む、実際のビューのレンダリングです。 - 次で指定:
-  クラス AbstractViewのrenderMergedOutputModel
- パラメーター:
- model- 静的な属性よりも動的な値が優先される、結合された出力マップ(非- null)
- request- 現在の HTTP リクエスト
- response- 現在の HTTP レスポンス
- 例外:
- ExceptionSE- レンダリングに失敗した場合
 
- locateToBeMarshalled@Nullable protected ObjectSE locateToBeMarshalled- (MapSE<StringSE, - ObjectSE> model) throws IllegalStateExceptionSEマーシャリングするオブジェクトを見つけます。- デフォルトの実装では、サポートされている型のオブジェクトの検索を試みる前に、構成されたモデルキーがある場合、最初にそのキーの下を調べます。 - パラメーター:
- model- モデルマップ
- 戻り値:
-  整列化されるオブジェクト (見つからない場合は null)
- 例外:
- IllegalStateExceptionSE- モデルキーで指定されたモデルオブジェクトがマーシャラーでサポートされていない場合
- 関連事項:
 
- isEligibleForMarshalling現在のビューのモデルからの指定された値が、構成された- Marshallerによるマーシャリングに適格かどうかを確認します。- デフォルトの実装は - Marshaller.supports(Class)を呼び出し、該当する場合は、指定された- JAXBElementEE を最初にアンラップします。- パラメーター:
- modelKey- モデル内の値のキー (非- null)
- value- チェックする値 (非- null)
- 戻り値:
- 指定された値が適格と見なされるかどうか
- 関連事項: