T - ハンドラーメソッドを受信リクエストに一致させるために必要な条件を含む HandlerMethod のマッピング。public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMapping implements InitializingBean
HandlerMethod の間のマッピングを定義する HandlerMapping 実装の抽象基本クラス。 登録された各ハンドラーメソッドについて、マッピング型 <T> の詳細を定義するサブクラスで一意のマッピングが維持されます。
mappingsLoggerloggerBEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| コンストラクターと説明 |
|---|
AbstractHandlerMethodMapping() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() 初期化時にハンドラーメソッドを検出します。 |
protected HandlerMethod | createHandlerMethod(ObjectSE handler, MethodSE method)HandlerMethod インスタンスを作成します。 |
protected void | detectHandlerMethods(ObjectSE handler) ハンドラーでハンドラーメソッドを探します。 |
protected CorsConfiguration | getCorsConfiguration(ObjectSE handler, ServerWebExchange exchange) 指定されたハンドラーの CORS 構成を取得します。 |
protected SetSE<StringSE> | getDirectPaths(T mapping) パターンではないリクエストマッピングパスを返します。 |
reactor.core.publisher.Mono<HandlerMethod> | getHandlerInternal(ServerWebExchange exchange) 指定されたリクエストのハンドラーメソッドを検索します。 |
MapSE<T, HandlerMethod> | getHandlerMethods() すべてのマッピングと HandlerMethod を含む(読み取り専用)マップを返します。 |
protected abstract ComparatorSE<T> | getMappingComparator(ServerWebExchange exchange) 一致するマッピングをソートするためのコンパレーターを返します。 |
protected abstract T | getMappingForMethod(MethodSE method, ClassSE<?> handlerType) ハンドラーメソッドのマッピングを提供します。 |
protected abstract T | getMatchingMapping(T mapping, ServerWebExchange exchange) マッピングが現在のリクエストに一致するかどうかを確認し、現在のリクエストに関連する条件を含む(潜在的に新しい)マッピングを返します。 |
protected void | handleMatch(T mapping, HandlerMethod handlerMethod, ServerWebExchange exchange) 一致するマッピングが見つかったときに呼び出されます。 |
protected HandlerMethod | handleNoMatch(SetSE<T> mappings, ServerWebExchange exchange) 一致するマッピングが見つからないときに呼び出されます。 |
protected void | handlerMethodsInitialized(MapSE<T, HandlerMethod> handlerMethods) すべてのハンドラーメソッドが検出された後に呼び出されます。 |
protected boolean | hasCorsConfigurationSource(ObjectSE handler) このハンドラーに CorsConfigurationSource がある場合、true を返します。 |
protected CorsConfiguration | initCorsConfiguration(ObjectSE handler, MethodSE method, T mapping) マッピングの CORS 設定を抽出して返します。 |
protected void | initHandlerMethods()ApplicationContext で Bean をスキャンし、ハンドラーメソッドを検出して登録します。 |
protected abstract boolean | isHandler(ClassSE<?> beanType) 指定された型がハンドラーメソッドを持つハンドラーかどうか。 |
protected HandlerMethod | lookupHandlerMethod(ServerWebExchange exchange) 現在のリクエストに最適なハンドラーメソッドを検索します。 |
protected void | registerHandlerMethod(ObjectSE handler, MethodSE method, T mapping) ハンドラーメソッドとその一意のマッピングを登録します。 |
void | registerMapping(T mapping, ObjectSE handler, MethodSE method) 指定されたマッピングを登録します。 |
void | unregisterMapping(T mapping) 指定されたマッピングを登録解除します。 |
formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatchgetApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContextcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic MapSE<T,HandlerMethod> getHandlerMethods()
public void registerMapping(T mapping, ObjectSE handler, MethodSE method)
このメソッドは、初期化が完了した後、実行時に呼び出すことができます。
mapping - ハンドラーメソッドのマッピング handler - ハンドラー method - メソッド public void unregisterMapping(T mapping)
このメソッドは、初期化が完了した後、実行時に呼び出すことができます。
mapping - 登録解除するマッピング public void afterPropertiesSet()
InitializingBean の afterPropertiesSet protected void initHandlerMethods()
protected void detectHandlerMethods(ObjectSE handler)
handler - ハンドラーまたはハンドラーインスタンスの Bean 名 protected void registerHandlerMethod(ObjectSE handler, MethodSE method, T mapping)
handler - ハンドラーまたはハンドラーインスタンスの Bean 名 method - 登録する方法 mapping - ハンドラーメソッドに関連付けられたマッピング条件 IllegalStateExceptionSE - 別のメソッドが同じマッピングですでに登録されている場合 protected HandlerMethod createHandlerMethod(ObjectSE handler, MethodSE method)
handler - Bean 名または実際のハンドラーインスタンス method - ターゲットメソッド @Nullable protected CorsConfiguration initCorsConfiguration(ObjectSE handler, MethodSE method, T mapping)
protected void handlerMethodsInitialized(MapSE<T,HandlerMethod> handlerMethods)
handlerMethods - ハンドラーメソッドとマッピングを含む読み取り専用マップ。public reactor.core.publisher.Mono<HandlerMethod> getHandlerInternal(ServerWebExchange exchange)
AbstractHandlerMapping の getHandlerInternal exchange - 現在の交換 Mono (存在する場合)@Nullable protected HandlerMethod lookupHandlerMethod(ServerWebExchange exchange) throws ExceptionSE
exchange - 現在の交換 null ExceptionSEhandleMatch(T, org.springframework.web.method.HandlerMethod, org.springframework.web.server.ServerWebExchange), handleNoMatch(java.util.Set<T>, org.springframework.web.server.ServerWebExchange)protected void handleMatch(T mapping, HandlerMethod handlerMethod, ServerWebExchange exchange)
mapping - 一致するマッピング handlerMethod - マッチング方法 exchange - 現在の交換 @Nullable protected HandlerMethod handleNoMatch(SetSE<T> mappings, ServerWebExchange exchange) throws ExceptionSE
mappings - 登録済みのすべてのマッピング exchange - 現在の交換 nullExceptionSE - エラーステータスコードに変換できる詳細を提供します protected boolean hasCorsConfigurationSource(ObjectSE handler)
AbstractHandlerMappingCorsConfigurationSource がある場合、true を返します。AbstractHandlerMapping の hasCorsConfigurationSource protected CorsConfiguration getCorsConfiguration(ObjectSE handler, ServerWebExchange exchange)
AbstractHandlerMappingAbstractHandlerMapping の getCorsConfiguration handler - チェックするハンドラー (非 null)exchange - 現在の交換 null protected abstract boolean isHandler(ClassSE<?> beanType)
beanType - チェックされている Bean の型 @Nullable protected abstract T getMappingForMethod(MethodSE method, ClassSE<?> handlerType)
method - マッピングを提供する方法 handlerType - ハンドラー型、場合によってはメソッドの宣言クラスのサブ型 null @Nullable protected abstract T getMatchingMapping(T mapping, ServerWebExchange exchange)
mapping - 一致を取得するマッピング exchange - 現在の交換 null protected abstract ComparatorSE<T> getMappingComparator(ServerWebExchange exchange)
exchange - 現在の交換 null)