クラス CompositeUriComponentsContributor
java.lang.ObjectSE
org.springframework.web.method.support.CompositeUriComponentsContributor
- 実装されたすべてのインターフェース:
UriComponentsContributor
委譲する他のコントリビューターのリストを含む
UriComponentsContributor
と、メソッド引数値を文字列としてフォーマットするために使用する特定の ConversionService
をカプセル化します。- 導入:
- 4.0
- 作成者:
- Rossen Stoyanchev, Juergen Hoeller, Sam Brannen
コンストラクターの概要
コンストラクターコンストラクター説明CompositeUriComponentsContributor
(CollectionSE<?> contributors) UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。CompositeUriComponentsContributor
(CollectionSE<?> contributors, ConversionService cs) UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。CompositeUriComponentsContributor
(UriComponentsContributor... contributors) UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明void
contributeMethodArgument
(MethodParameter parameter, ObjectSE value, UriComponentsBuilder builder, MapSE<StringSE, ObjectSE> uriVariables) 構築時に作成された ConversionService を使用するオーバーロードメソッド。void
contributeMethodArgument
(MethodParameter parameter, ObjectSE value, UriComponentsBuilder builder, MapSE<StringSE, ObjectSE> uriVariables, ConversionService conversionService) 指定されたメソッド引数を処理し、UriComponentsBuilder
を更新するか、すべての引数が処理された後に URI を展開するために使用する URI 変数でマップに追加します。boolean
このCompositeUriComponentsContributor
にコントリビューターがいるかどうかを確認します。boolean
supportsParameter
(MethodParameter parameter) このコントリビュータが指定されたメソッドパラメーターをサポートするかどうか。
コンストラクターの詳細
CompositeUriComponentsContributor
UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。これらは両方とも同じクラスによって実装される傾向があるため、最も便利なオプションは、RequestMappingHandlerAdapter
で構成済みのHandlerMethodArgumentResolvers
を取得し、それをこのコンストラクターに提供することです。- パラメーター:
contributors
-UriComponentsContributor
またはHandlerMethodArgumentResolvers
のコレクション
CompositeUriComponentsContributor
UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。これらは両方とも同じクラスによって実装される傾向があるため、最も便利なオプションは、RequestMappingHandlerAdapter
で構成済みのHandlerMethodArgumentResolvers
を取得し、それをこのコンストラクターに提供することです。- パラメーター:
contributors
-UriComponentsContributor
またはHandlerMethodArgumentResolvers
のコレクション
CompositeUriComponentsContributor
public CompositeUriComponentsContributor(@Nullable CollectionSE<?> contributors, @Nullable ConversionService cs) UriComponentsContributors
またはHandlerMethodArgumentResolvers
のコレクションからインスタンスを作成します。これらの両方が同じクラスによって実装される傾向があるため、最も便利なオプションは、RequestMappingHandlerAdapter
で構成済みのHandlerMethodArgumentResolvers
を取得し、それをこのコンストラクターに提供することです。ConversionService
引数がnull
の場合、デフォルトでDefaultFormattingConversionService
が使用されます。- パラメーター:
contributors
-UriComponentsContributor
またはHandlerMethodArgumentResolvers
のコレクションcs
- メソッドの引数値を URI に追加する前に文字列としてフォーマットする必要がある場合に使用する ConversionService
メソッドの詳細
hasContributors
public boolean hasContributors()このCompositeUriComponentsContributor
にコントリビューターがいるかどうかを確認します。- 戻り値:
- この
CompositeUriComponentsContributor
が委譲先のコントリビューターとともに作成された場合はtrue
supportsParameter
インターフェースからコピーされた説明:UriComponentsContributor
このコントリビュータが指定されたメソッドパラメーターをサポートするかどうか。- 次で指定:
- インターフェース
UriComponentsContributor
のsupportsParameter
contributeMethodArgument
public void contributeMethodArgument(MethodParameter parameter, ObjectSE value, UriComponentsBuilder builder, MapSE<StringSE, ObjectSE> uriVariables, ConversionService conversionService) インターフェースからコピーされた説明:UriComponentsContributor
指定されたメソッド引数を処理し、UriComponentsBuilder
を更新するか、すべての引数が処理された後に URI を展開するために使用する URI 変数でマップに追加します。- 次で指定:
- インターフェース
UriComponentsContributor
のcontributeMethodArgument
- パラメーター:
parameter
- コントローラーメソッドパラメーター (非null
)value
- 引数値 (おそらくnull
)builder
- 更新するビルダー (非null
)uriVariables
- URI 変数を追加するマップ (非null
)conversionService
- 値を文字列としてフォーマットする ConversionService
contributeMethodArgument
public void contributeMethodArgument(MethodParameter parameter, ObjectSE value, UriComponentsBuilder builder, MapSE<StringSE, ObjectSE> uriVariables) 構築時に作成された ConversionService を使用するオーバーロードメソッド。