public abstract class AbstractView extends ObjectSE implements View, ApplicationContextAware
View 実装の基本クラス。| 修飾子と型 | フィールドと説明 |
|---|---|
protected Log | logger サブクラスで利用可能なロガー |
static StringSE | REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAMEBean ファクトリでの RequestDataValueProcessor のよく知られた名前 |
| コンストラクターと説明 |
|---|
AbstractView() |
AbstractView(ReactiveAdapterRegistry registry) |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected RequestContext | createRequestContext(ServerWebExchange exchange, MapSE<StringSE, ObjectSE> model) 指定された属性名で公開する RequestContext を作成します。 |
ApplicationContext | getApplicationContext() |
CharsetSE | getDefaultCharset() コンテンツ型に文字セットが含まれていない場合に使用されるデフォルトの文字セットを返します。 |
protected reactor.core.publisher.Mono<MapSE<StringSE, ObjectSE>> | getModelAttributes(MapSE<StringSE,?> model, ServerWebExchange exchange) レンダリングに使用するモデルを準備します。 |
StringSE | getRequestContextAttribute()RequestContext 属性の名前を返します(存在する場合)。 |
protected RequestDataValueProcessor | getRequestDataValueProcessor() 使用する RequestDataValueProcessor を返します。 |
ListSE<MediaType> | getSupportedMediaTypes() このビューでサポートされている設定済みのメディア型を返します。 |
protected ApplicationContext | obtainApplicationContext() 実際に使用するために ApplicationContext を取得します。 |
reactor.core.publisher.Mono<VoidSE> | render(MapSE<StringSE,?> model, MediaType contentType, ServerWebExchange exchange) レンダリングするモデルを準備します。 |
protected abstract reactor.core.publisher.Mono<VoidSE> | renderInternal(MapSE<StringSE, ObjectSE> renderAttributes, MediaType contentType, ServerWebExchange exchange) ビューを実際にレンダリングするには、サブクラスでこのメソッドを実装する必要があります。 |
protected reactor.core.publisher.Mono<VoidSE> | resolveAsyncAttributes(MapSE<StringSE, ObjectSE> model) デフォルトでは、 ReactiveAdapterRegistry でサポートされている非同期属性を対応するブロッキング属性に解決します。 |
void | setApplicationContext(ApplicationContext applicationContext) このオブジェクトが実行される ApplicationContext を設定します。 |
void | setDefaultCharset(CharsetSE defaultCharset) このビューのデフォルトの文字セットを設定します。コンテンツ型に文字セットが含まれていない場合に使用されます。 |
void | setRequestContextAttribute(StringSE requestContextAttribute) このビューの RequestContext 属性の名前を設定します。 |
void | setSupportedMediaTypes(ListSE<MediaType> supportedMediaTypes) このビューでサポートされるメディア型を設定します。 |
StringSE | toString() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEisRedirectViewpublic static final StringSE REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME
protected final Log logger
public AbstractView()
public AbstractView(ReactiveAdapterRegistry registry)
public void setSupportedMediaTypes(@Nullable ListSE<MediaType> supportedMediaTypes)
public ListSE<MediaType> getSupportedMediaTypes()
View の getSupportedMediaTypes public void setDefaultCharset(CharsetSE defaultCharset)
public void setRequestContextAttribute(@Nullable StringSE requestContextAttribute)
@Nullable public StringSE getRequestContextAttribute()
public void setApplicationContext(@Nullable ApplicationContext applicationContext)
ApplicationContextAware 通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet() またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) および MessageSourceAware の後に呼び出されます(該当する場合)。
ApplicationContextAware の setApplicationContext applicationContext - このオブジェクトによって使用される ApplicationContext オブジェクト BeanInitializationException@Nullable public ApplicationContext getApplicationContext()
protected final ApplicationContext obtainApplicationContext()
null)IllegalStateExceptionSE - ApplicationContext セットがない場合 public reactor.core.publisher.Mono<VoidSE> render(@Nullable MapSE<StringSE,?> model, @Nullable MediaType contentType, ServerWebExchange exchange)
View の render model - 名前の文字列をキーとして、対応するモデルオブジェクトを値としてマップします。(空のモデルの場合、マップは null にすることもできます)contentType - レンダリングするために選択されたコンテンツ型。supported media types のいずれかと一致する必要があります。exchange - 現在の交換 Mono は、レンダリングが成功した場合と成功した場合を表します protected reactor.core.publisher.Mono<MapSE<StringSE,ObjectSE>> getModelAttributes(@Nullable MapSE<StringSE,?> model, ServerWebExchange exchange)
デフォルトの実装では、モデルと静的属性を含む結合出力マップが作成され、前者が優先されます。
protected reactor.core.publisher.Mono<VoidSE> resolveAsyncAttributes(MapSE<StringSE,ObjectSE> model)
ReactiveAdapterRegistry でサポートされている非同期属性を対応するブロッキング属性に解決します。リアクティブ型を利用できるビューの実装では、必要に応じてこのメソッドをオーバーライドできます。
Mono protected RequestContext createRequestContext(ServerWebExchange exchange, MapSE<StringSE,ObjectSE> model)
デフォルトの実装では、指定されたリクエストとモデルの標準 RequestContext インスタンスが作成されます。カスタムインスタンスのサブクラスでオーバーライドできます。
exchange - 現在の交換 model - 静的な属性よりも動的な値が優先される、結合された出力マップ(非 null)setRequestContextAttribute(java.lang.String)@Nullable protected RequestDataValueProcessor getRequestDataValueProcessor()
RequestDataValueProcessor を返します。 デフォルトの実装では、REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME という名前の RequestDataValueProcessor Bean を Spring configuration で探します。
protected abstract reactor.core.publisher.Mono<VoidSE> renderInternal(MapSE<StringSE,ObjectSE> renderAttributes, @Nullable MediaType contentType, ServerWebExchange exchange)
renderAttributes - 静的な属性よりも動的な値が優先される、結合された出力マップ(非 null)contentType - レンダリングするために選択されたコンテンツ型。supported media types のいずれかと一致する必要があります。exchange - 現在の交換 @return Mono は、レンダリングが成功した場合と成功した場合を表します public StringSE toString()
ObjectSE の toStringSE