クラス RequestMappingInfo
java.lang.ObjectSE
org.springframework.web.servlet.mvc.method.RequestMappingInfo
- 実装されているすべてのインターフェース:
RequestCondition<RequestMappingInfo>
public final class RequestMappingInfo
extends ObjectSE
implements RequestCondition<RequestMappingInfo>
マッピング情報をリクエストします。次の条件のコンポジット:
- 解析された
PathPatternsを使用したPathPatternsRequestConditionまたはPathMatcherを介したストリングパターンを使用したPatternsRequestCondition RequestMethodsRequestConditionParamsRequestConditionHeadersRequestConditionConsumesRequestConditionProducesRequestConditionRequestCondition(オプションのカスタムリクエスト条件)
- 導入:
- 3.1
- 作成者:
- Arjen Poutsma, Rossen Stoyanchev
ネストされたクラスの要約
ネストされたクラス修飾子と型クラス説明static interfaceRequestMappingInfo を作成するためのビルダーを定義します。static classリクエストマッピングの目的で使用される構成オプションのコンテナー。コンストラクターの概要
コンストラクターコンストラクター説明RequestMappingInfo(StringSE name, PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom) 使用すべきではありません。RequestMappingInfo(PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom) 使用すべきではありません。5.3 の時点で、paths(String...)を介してRequestMappingInfo.Builderを使用することをお勧めします。RequestMappingInfo(RequestMappingInfo info, RequestCondition<?> customRequestCondition) 使用すべきではありません。addCustomCondition(RequestCondition)の使用を推奨する 5.3 以降。メソッドのサマリー
修飾子と型メソッド説明addCustomCondition(RequestCondition<?> customCondition) 現在のインスタンスに基づいて新しいインスタンスを作成し、指定されたカスタム条件も追加します。combine(RequestMappingInfo other) "this" リクエストマッピング情報を組み合わせます(つまりintcompareTo(RequestMappingInfo other, HttpServletRequestEE request) "this" 情報を比較します(つまりboolean<T> RequestCondition<T>null でないかどうかに応じて、getPathPatternsCondition()またはgetPatternsCondition()のいずれかを返します。このRequestMappingInfoの「消費」状態を返します。または、0 のインスタンスは式を使用します(非null)。このRequestMappingInfoまたはnullの「カスタム」条件を返します。パターンではないマッピングパスを返します。このRequestMappingInfoの「ヘッダー」条件を返します。または、ヘッダー式が 0 のインスタンス(nullは使用しないでください)。getMatchingCondition(HttpServletRequestEE request) このリクエストマッピング情報のすべての条件が提供されたリクエストと一致するかどうかを確認し、現在のリクエストに合わせた条件で潜在的に新しいリクエストマッピング情報を返します。このRequestMappingInfoの HTTP リクエストメソッドを返します。または、リクエストメソッドが 0 のインスタンス(nullを使用しない)。getName()このマッピングの名前、またはnullを返します。このRequestMappingInfoの「パラメーター」条件を返します。または、パラメーター式が 0 のインスタンス(非null)。解析されたパターンがenabledの場合、使用中のパターン条件を返します。PathMatcherを介した文字列パターンマッチングが使用されている場合、パターン条件を返します。activeパターン条件のパターンを文字列として返します。このRequestMappingInfoの「プロデュース」状態を返します。または、0 のインスタンスは式を生成します(非null)。inthashCode()booleanリクエストマッピングに空の URL パスマッピングがあるかどうか。mutate()ビルダーを返して、これを変更して新しい RequestMappingInfo を作成します。static RequestMappingInfo.Builder指定されたパスで新しいRequestMappingInfo.Builderを作成します。toString()
コンストラクターの詳細
RequestMappingInfo
@DeprecatedSE public RequestMappingInfo(@Nullable StringSE name, @Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, @Nullable ProducesRequestCondition produces, @Nullable RequestCondition<?> custom) 使用すべきではありません。5.3 の時点で、paths(String...)を介してRequestMappingInfo.Builderを使用することをお勧めします。マッピング名を持つ完全なコンストラクター。RequestMappingInfo
@DeprecatedSE public RequestMappingInfo(@Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, @Nullable ProducesRequestCondition produces, @Nullable RequestCondition<?> custom) 使用すべきではありません。5.3 の時点で、paths(String...)を介してRequestMappingInfo.Builderを使用することをお勧めします。指定された条件でインスタンスを作成します。RequestMappingInfo
@DeprecatedSE public RequestMappingInfo(RequestMappingInfo info, @Nullable RequestCondition<?> customRequestCondition) 使用すべきではありません。addCustomCondition(RequestCondition)の使用を推奨する 5.3 以降。指定されたカスタムリクエスト条件で RequestMappingInfo を再作成します。
メソッドの詳細
getName
このマッピングの名前、またはnullを返します。getPathPatternsCondition
解析されたパターンがenabledの場合、使用中のパターン条件を返します。これは
getPatternsCondition()と相互に排他的であるため、一方がnullを返すと、もう一方はインスタンスを返します。- 導入:
- 5.3
- 関連事項:
getPatternsCondition
PathMatcherを介した文字列パターンマッチングが使用されている場合、パターン条件を返します。これは
getPathPatternsCondition()と相互に排他的であるため、一方がnullを返すと、もう一方はインスタンスを返します。getActivePatternsCondition
null でないかどうかに応じて、getPathPatternsCondition()またはgetPatternsCondition()のいずれかを返します。- 導入:
- 5.3
getDirectPaths
パターンではないマッピングパスを返します。- 導入:
- 5.3
getPatternValues
activeパターン条件のパターンを文字列として返します。- 導入:
- 5.3
isEmptyMapping
public boolean isEmptyMapping()リクエストマッピングに空の URL パスマッピングがあるかどうか。- 導入:
- 6.0.10
getMethodsCondition
このRequestMappingInfoの HTTP リクエストメソッドを返します。または、リクエストメソッドが 0 のインスタンス(nullを使用しない)。getParamsCondition
このRequestMappingInfoの「パラメーター」条件を返します。または、パラメーター式が 0 のインスタンス(非null)。getHeadersCondition
このRequestMappingInfoの「ヘッダー」条件を返します。または、ヘッダー式が 0 のインスタンス(nullは使用しないでください)。getConsumesCondition
このRequestMappingInfoの「消費」状態を返します。または、0 のインスタンスは式を使用します(非null)。getProducesCondition
このRequestMappingInfoの「プロデュース」状態を返します。または、0 のインスタンスは式を生成します(非null)。getCustomCondition
このRequestMappingInfoまたはnullの「カスタム」条件を返します。addCustomCondition
現在のインスタンスに基づいて新しいインスタンスを作成し、指定されたカスタム条件も追加します。- パラメーター:
customCondition- 追加するカスタム条件- 導入:
- 5.3
combine
"this" リクエストマッピング情報(つまり、現在のインスタンス)を別のリクエストマッピング情報インスタンスと結合します。サンプル: 型レベルとメソッドレベルのリクエストマッピングを組み合わせます。
- 次で指定:
- インターフェース
RequestCondition<RequestMappingInfo>のcombine - パラメーター:
other- 組み合わせる条件。- 戻り値:
- 新しいリクエストマッピング情報インスタンス。非
null
getMatchingCondition
このリクエストマッピング情報のすべての条件が提供されたリクエストと一致するかどうかを確認し、現在のリクエストに合わせた条件で潜在的に新しいリクエストマッピング情報を返します。たとえば、返されたインスタンスには、現在のリクエストに一致する URL パターンのサブセットが含まれ、最上位に一致するパターンでソートされます。
- 次で指定:
- インターフェース
RequestCondition<RequestMappingInfo>のgetMatchingCondition - 戻り値:
- 一致した場合の新しいインスタンス。または
nullそれ以外の場合
compareTo
"this" 情報(つまり、現在のインスタンス)をリクエストのコンテキスト内の別の情報と比較します。メモ: 両方のインスタンスが
getMatchingCondition(HttpServletRequest)を介して取得されており、現在のリクエストに関連するコンテンツの条件を備えていると想定されています。- 次で指定:
- インターフェース
RequestCondition<RequestMappingInfo>のcompareTo
equals
hashCode
public int hashCode()toString
mutate
ビルダーを返して、これを変更して新しい RequestMappingInfo を作成します。- 戻り値:
- 新しい変更されたインスタンスを作成するビルダー
- 導入:
- 5.3.4
paths
指定されたパスで新しいRequestMappingInfo.Builderを作成します。- パラメーター:
paths- 使用するパス- 導入:
- 4.2
paths(String...)を介してRequestMappingInfo.Builderを使用することをお勧めします。