public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMapping implements EmbeddedValueResolverAware
@RequestMapping
アノテーションから RequestMappingInfo
インスタンスを作成する RequestMappingInfoHandlerMapping
の拡張。logger
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターと説明 |
---|
RequestMappingHandlerMapping() |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() 初期化時にハンドラーメソッドを検出します。 |
protected RequestMappingInfo | createRequestMappingInfo(RequestMapping requestMapping, RequestCondition<?> customCondition) 提供された @RequestMapping アノテーションから RequestMappingInfo を作成します。これは、直接宣言されたアノテーション、メタアノテーション、アノテーション階層内のアノテーション属性をマージした合成結果のいずれかです。 |
RequestedContentTypeResolver | getContentTypeResolver() 設定された RequestedContentTypeResolver を返します。 |
protected RequestCondition<?> | getCustomMethodCondition(MethodSE method) カスタムのメソッドレベルのリクエスト条件を指定します。 |
protected RequestCondition<?> | getCustomTypeCondition(ClassSE<?> handlerType) カスタム型レベルのリクエスト条件を指定します。 |
protected RequestMappingInfo | getMappingForMethod(MethodSE method, ClassSE<?> handlerType) メソッドおよび型レベルの @ RequestMapping アノテーションを使用して RequestMappingInfo を作成します。 |
MapSE<StringSE, PredicateSE<ClassSE<?>>> | getPathPrefixes() 構成されたパスは、読み取り専用の、おそらく空のマップとしてプレフィックスします。 |
protected CorsConfiguration | initCorsConfiguration(ObjectSE handler, MethodSE method, RequestMappingInfo mappingInfo) マッピングの CORS 設定を抽出して返します。 |
protected boolean | isHandler(ClassSE<?> beanType) 指定された型がハンドラーメソッドを持つハンドラーかどうか。 |
protected StringSE[] | resolveEmbeddedValuesInPatterns(StringSE[] patterns) 指定されたパターンの配列のプレースホルダー値を解決します。 |
void | setContentTypeResolver(RequestedContentTypeResolver contentTypeResolver) リクエストされたメディア型を判別するために使用する RequestedContentTypeResolver を設定します。 |
void | setEmbeddedValueResolver(StringValueResolver resolver) StringValueResolver を設定して、埋め込まれた定義値の解決に使用します。 |
void | setPathPrefixes(MapSE<StringSE, PredicateSE<ClassSE<?>>> prefixes) コントローラーメソッドに適用するパスプレフィックスを構成します。 |
getMappingComparator, getMatchingMapping, handleMatch, handleNoMatch
createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerInternal, getHandlerMethods, handlerMethodsInitialized, initHandlerMethods, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMapping
formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public void setPathPrefixes(MapSE<StringSE,PredicateSE<ClassSE<?>>> prefixes)
プレフィックスは、コントローラー型がマップ内の対応する Predicate
と一致するすべての @RequestMapping
メソッドのマッピングを強化するために使用されます。入力マップが予測可能な順序であると想定して、最初に一致する述語の接頭辞が使用されます。
HandlerTypePredicate
を使用してコントローラーをグループ化することを検討してください。
prefixes
- キーとしてパス接頭辞を持つマップ HandlerTypePredicate
public MapSE<StringSE,PredicateSE<ClassSE<?>>> getPathPrefixes()
public void setContentTypeResolver(RequestedContentTypeResolver contentTypeResolver)
RequestedContentTypeResolver
を設定します。設定されていない場合、デフォルトのコンストラクターが使用されます。public RequestedContentTypeResolver getContentTypeResolver()
RequestedContentTypeResolver
を返します。public void setEmbeddedValueResolver(StringValueResolver resolver)
EmbeddedValueResolverAware
EmbeddedValueResolverAware
の setEmbeddedValueResolver
public void afterPropertiesSet()
AbstractHandlerMethodMapping
InitializingBean
の afterPropertiesSet
AbstractHandlerMethodMapping<RequestMappingInfo>
の afterPropertiesSet
protected boolean isHandler(ClassSE<?> beanType)
Controller
アノテーションが必要です。AbstractHandlerMethodMapping<RequestMappingInfo>
の isHandler
beanType
- チェックされている Bean の型 protected RequestMappingInfo getMappingForMethod(MethodSE method, ClassSE<?> handlerType)
RequestMapping
アノテーションを使用して RequestMappingInfo を作成します。AbstractHandlerMethodMapping<RequestMappingInfo>
の getMappingForMethod
method
- マッピングを提供する方法 handlerType
- ハンドラー型、場合によってはメソッドの宣言クラスのサブ型 @RequestMapping
アノテーションがない場合は null
getCustomMethodCondition(Method)
, getCustomTypeCondition(Class)
@Nullable protected RequestCondition<?> getCustomTypeCondition(ClassSE<?> handlerType)
RequestCondition
は、カスタムリクエスト条件を組み合わせて比較できるように、このメソッドへのすべての呼び出しから同じ条件型が返される限り、どの型でもかまいません。 カスタム条件型用に AbstractRequestCondition
を継承し、CompositeRequestCondition
を使用して複数のカスタム条件を提供することを検討してください。
handlerType
- 条件を作成するハンドラー型 null
@Nullable protected RequestCondition<?> getCustomMethodCondition(MethodSE method)
RequestCondition
は、カスタムリクエスト条件を組み合わせて比較できるように、このメソッドへのすべての呼び出しから同じ条件型が返される限り、どの型でもかまいません。 カスタム条件型用に AbstractRequestCondition
を継承し、CompositeRequestCondition
を使用して複数のカスタム条件を提供することを検討してください。
method
- 条件を作成するハンドラーメソッド null
protected RequestMappingInfo createRequestMappingInfo(RequestMapping requestMapping, @Nullable RequestCondition<?> customCondition)
@RequestMapping
アノテーションから RequestMappingInfo
を作成します。これは、直接宣言されたアノテーション、メタアノテーション、アノテーション階層内のアノテーション属性をマージした合成結果のいずれかです。protected StringSE[] resolveEmbeddedValuesInPatterns(StringSE[] patterns)
protected CorsConfiguration initCorsConfiguration(ObjectSE handler, MethodSE method, RequestMappingInfo mappingInfo)
AbstractHandlerMethodMapping
AbstractHandlerMethodMapping<RequestMappingInfo>
の initCorsConfiguration