public class PatternsRequestCondition extends AbstractRequestCondition<PatternsRequestCondition>
解析された PathPattern
を使用する PathPatternsRequestCondition
とは対照的に、この条件は AntPathMatcher
を介して文字列パターンマッチングを実行します。
コンストラクターと説明 |
---|
PatternsRequestCondition(StringSE... patterns) 必要に応じて "/" が前に付いた URL パターンを持つコンストラクター。 |
PatternsRequestCondition(StringSE[] patterns, boolean useTrailingSlashMatch, PathMatcher pathMatcher) PathMatcher と末尾のスラッシュを一致させるためのフラグを持つ PatternsRequestCondition(String...) のバリアント。 |
PatternsRequestCondition(StringSE[] patterns, UrlPathHelper urlPathHelper, PathMatcher pathMatcher, boolean useTrailingSlashMatch) 使用すべきではありません。 |
PatternsRequestCondition(StringSE[] patterns, UrlPathHelper urlPathHelper, PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch) 使用すべきではありません。 5.2.4 現在。パス拡張設定オプションの非推奨については、 RequestMappingHandlerMapping のクラスレベルの注意を参照してください。 |
PatternsRequestCondition(StringSE[] patterns, UrlPathHelper urlPathHelper, PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch, ListSE<StringSE> fileExtensions) 使用すべきではありません。 5.2.4 現在。パス拡張設定オプションの非推奨については、 RequestMappingHandlerMapping のクラスレベルの注意を参照してください。 |
修飾子と型 | メソッドと説明 |
---|---|
PatternsRequestCondition | combine(PatternsRequestCondition other) 次のように、現在のインスタンス("this" )と「その他」のインスタンスからの URL パターンを含む新しいインスタンスを返します。両方のインスタンスにパターンがある場合は、"this" のパターンを PathMatcher.combine(String, String) を使用して「その他」のパターンと組み合わせます。 |
int | compareTo(PatternsRequestCondition other, HttpServletRequestEE request) 含まれている URL パターンに基づいて 2 つの条件を比較します。 |
protected CollectionSE<StringSE> | getContent() リクエスト条件を構成する個別のアイテムを返します。 |
SetSE<StringSE> | getDirectPaths() パターンではないマッピングパスを返します。 |
PatternsRequestCondition | getMatchingCondition(HttpServletRequestEE request) パターンのいずれかが指定されたリクエストと一致するかどうかを確認し、 PathMatcher.getPatternComparator(String) でソートされた、一致するパターンを含むことが保証されているインスタンスを返します。 |
ListSE<StringSE> | getMatchingPatterns(StringSE lookupPath) 指定されたルックアップパスに一致するパターンを検索します。 |
SetSE<StringSE> | getPatterns() |
protected StringSE | getToStringInfix() コンテンツの個別のアイテムを出力するときに使用する表記。 |
boolean | isEmptyPathMapping() 条件が ""(空のパス)マッピングであるかどうか。 |
equals, hashCode, isEmpty, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public PatternsRequestCondition(StringSE... patterns)
patterns
- 0 個以上の URL パターン。パターンがない場合、すべてのリクエストに一致する空のパス ""
マッピングが生成されます。public PatternsRequestCondition(StringSE[] patterns, boolean useTrailingSlashMatch, @Nullable PathMatcher pathMatcher)
PathMatcher
と末尾のスラッシュを一致させるためのフラグを持つ PatternsRequestCondition(String...)
のバリアント。@DeprecatedSE public PatternsRequestCondition(StringSE[] patterns, @Nullable UrlPathHelper urlPathHelper, @Nullable PathMatcher pathMatcher, boolean useTrailingSlashMatch)
PatternsRequestCondition(String[], boolean, PathMatcher)
が優先されます。PatternsRequestCondition(String...)
と UrlPathHelper
および PathMatcher
のバリアント、および末尾のスラッシュと一致するかどうか。5.3 では、パスは静的メソッド UrlPathHelper.getResolvedLookupPath(javax.servlet.ServletRequest)
を介して取得され、UrlPathHelper
を渡す必要はありません。
@DeprecatedSE public PatternsRequestCondition(StringSE[] patterns, @Nullable UrlPathHelper urlPathHelper, @Nullable PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch)
RequestMappingHandlerMapping
のクラスレベルの注意を参照してください。UrlPathHelper
および PathMatcher
を含む PatternsRequestCondition(String...)
のバリアント、および接尾辞と末尾のスラッシュと一致するフラグ。5.3 では、パスは静的メソッド UrlPathHelper.getResolvedLookupPath(javax.servlet.ServletRequest)
を介して取得され、UrlPathHelper
を渡す必要はありません。
@DeprecatedSE public PatternsRequestCondition(StringSE[] patterns, @Nullable UrlPathHelper urlPathHelper, @Nullable PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch, @Nullable ListSE<StringSE> fileExtensions)
RequestMappingHandlerMapping
のクラスレベルの注意を参照してください。UrlPathHelper
および PathMatcher
を含む PatternsRequestCondition(String...)
のバリアント、および特定の拡張子とともに、接尾辞および末尾のスラッシュと照合するためのフラグ。5.3 では、パスは静的メソッド UrlPathHelper.getResolvedLookupPath(javax.servlet.ServletRequest)
を介して取得され、UrlPathHelper
を渡す必要はありません。
protected CollectionSE<StringSE> getContent()
AbstractRequestCondition
たとえば、URL パターン、HTTP リクエストメソッド、パラメーター式など。
AbstractRequestCondition<PatternsRequestCondition>
の getContent
null
)protected StringSE getToStringInfix()
AbstractRequestCondition
たとえば、URL パターンの " || "
または param 式の " && "
。
public boolean isEmptyPathMapping()
public PatternsRequestCondition combine(PatternsRequestCondition other)
PathMatcher.combine(String, String)
を使用して「その他」のパターンと組み合わせます。other
- 組み合わせる条件。@Nullable public PatternsRequestCondition getMatchingCondition(HttpServletRequestEE request)
PathMatcher.getPatternComparator(String)
でソートされた、一致するパターンを含むことが保証されているインスタンスを返します。一致するパターンは、次の順序でチェックを行うことによって取得されます。
request
- 現在のリクエスト null
。public ListSE<StringSE> getMatchingPatterns(StringSE lookupPath)
getMatchingCondition(javax.servlet.http.HttpServletRequest)
を呼び出した場合と同等の結果が得られます。このメソッドは、リクエストが利用できない場合に使用される代替手段として提供されます(イントロスペクション、ツールなど)。lookupPath
- 既存のパターンに一致するルックアップパス public int compareTo(PatternsRequestCondition other, HttpServletRequestEE request)
PathMatcher.getPatternComparator(String)
を介して上から下に一度に 1 つずつ比較されます。比較されたすべてのパターンが同等に一致するが、1 つのインスタンスにさらに多くのパターンがある場合、より近い一致と見なされます。 両方のインスタンスが getMatchingCondition(HttpServletRequest)
を介して取得され、リクエストに一致するパターンのみが含まれ、最も一致するものが上にソートされることを前提としています。