Class EndpointIndexer<T extends EndpointIndexer<T,PARAM,METHOD>,PARAM extends IndexedParameter<PARAM>,METHOD extends org.jboss.resteasy.reactive.common.model.ResourceMethod>

java.lang.Object
org.jboss.resteasy.reactive.common.processor.EndpointIndexer<T,PARAM,METHOD>

public abstract class EndpointIndexer<T extends EndpointIndexer<T,PARAM,METHOD>,PARAM extends IndexedParameter<PARAM>,METHOD extends org.jboss.resteasy.reactive.common.model.ResourceMethod> extends Object
  • Field Details

    • primitiveTypes

      public static final Map<String,String> primitiveTypes
    • SUPPORT_TEMPORAL_PARAMS

      protected static final Set<org.jboss.jandex.DotName> SUPPORT_TEMPORAL_PARAMS
    • log

      protected static final org.jboss.logging.Logger log
    • EMPTY_STRING_ARRAY

      protected static final String[] EMPTY_STRING_ARRAY
    • CDI_WRAPPER_SUFFIX

      public static final String CDI_WRAPPER_SUFFIX
      See Also:
    • METHOD_CONTEXT_CUSTOM_RETURN_TYPE_KEY

      public static final String METHOD_CONTEXT_CUSTOM_RETURN_TYPE_KEY
      See Also:
    • METHOD_CONTEXT_ANNOTATION_STORE

      public static final String METHOD_CONTEXT_ANNOTATION_STORE
      See Also:
    • METHOD_PRODUCES

      public static final String METHOD_PRODUCES
      See Also:
    • index

      protected final org.jboss.jandex.IndexView index
    • applicationIndex

      protected final org.jboss.jandex.IndexView applicationIndex
    • existingConverters

      protected final Map<String,String> existingConverters
    • injectableBeans

      protected final Map<String,org.jboss.resteasy.reactive.common.model.InjectableBean> injectableBeans
    • hasRuntimeConverters

      protected final boolean hasRuntimeConverters
    • config

      protected final org.jboss.resteasy.reactive.common.ResteasyReactiveConfig config
    • additionalReaders

      protected final AdditionalReaders additionalReaders
    • applicationScanningResult

      protected final ApplicationScanningResult applicationScanningResult
    • alreadyHandledRequestScopedResources

      protected final Set<org.jboss.jandex.DotName> alreadyHandledRequestScopedResources
  • Constructor Details

  • Method Details

    • createEndpoints

      public Optional<org.jboss.resteasy.reactive.common.model.ResourceClass> createEndpoints(org.jboss.jandex.ClassInfo classInfo, boolean considerApplication)
    • verifyClassThatRequiresFieldInjection

      protected void verifyClassThatRequiresFieldInjection(org.jboss.jandex.ClassInfo classInfo)
    • createResourceMethod

      protected abstract METHOD createResourceMethod(org.jboss.jandex.MethodInfo info, org.jboss.jandex.ClassInfo actualEndpointClass, Map<String,Object> methodContext)
    • createEndpoints

      protected List<org.jboss.resteasy.reactive.common.model.ResourceMethod> createEndpoints(org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo, Set<String> seenMethods, Set<String> existingClassNameBindings, Set<String> pathParameters, String resourceClassPath, boolean considerApplication)
    • handleTrailingSlash

      protected String handleTrailingSlash(String path)
      By default, we are not removing the trailing slash.
    • warnAboutMissUsedBodyParameter

      protected void warnAboutMissUsedBodyParameter(org.jboss.jandex.DotName httpMethod, org.jboss.jandex.MethodInfo methodInfo)
    • skipParameter

      protected boolean skipParameter(Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> anns)
    • handleClientSubResource

      protected void handleClientSubResource(org.jboss.resteasy.reactive.common.model.ResourceMethod resourceMethod, org.jboss.jandex.MethodInfo method, org.jboss.jandex.IndexView index)
    • doesMethodHaveBlockingSignature

      protected boolean doesMethodHaveBlockingSignature(org.jboss.jandex.MethodInfo info)
    • handleBeanParam

      protected abstract boolean handleBeanParam(org.jboss.jandex.ClassInfo actualEndpointInfo, org.jboss.jandex.Type paramType, org.jboss.resteasy.reactive.common.model.MethodParameter[] methodParameters, int i, Set<String> fileFormNames)
    • handleAdditionalMethodProcessing

      protected void handleAdditionalMethodProcessing(METHOD method, org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.MethodInfo info, AnnotationStore annotationStore)
    • additionalRegisterClassForReflectionCheck

      public boolean additionalRegisterClassForReflectionCheck(EndpointIndexer.ResourceMethodCallbackEntry entry)
    • scanInjectableBean

      protected abstract org.jboss.resteasy.reactive.common.model.InjectableBean scanInjectableBean(org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo, Map<String,String> existingConverters, AdditionalReaders additionalReaders, Map<String,org.jboss.resteasy.reactive.common.model.InjectableBean> injectableBeans, boolean hasRuntimeConverters)
    • createMethodParameter

      protected abstract org.jboss.resteasy.reactive.common.model.MethodParameter createMethodParameter(org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo, boolean encoded, org.jboss.jandex.Type paramType, PARAM parameterResult, String name, String defaultValue, org.jboss.resteasy.reactive.common.model.ParameterType type, String elementType, boolean single, String signature, Set<String> fileFormNames)
    • setupApplyDefaults

      protected void setupApplyDefaults(org.jboss.jandex.Type nonAsyncReturnType, org.jboss.jandex.DotName httpMethod)
    • applyAdditionalDefaults

      protected String[] applyAdditionalDefaults(org.jboss.jandex.Type nonAsyncReturnType)
    • addWriterForType

      protected abstract void addWriterForType(AdditionalWriters additionalWriters, org.jboss.jandex.Type paramType)
    • addReaderForType

      protected abstract void addReaderForType(AdditionalReaders additionalReaders, org.jboss.jandex.Type paramType)
    • extractProducesConsumesValues

      public static String[] extractProducesConsumesValues(org.jboss.jandex.AnnotationInstance annotation, String[] defaultValue)
    • toClassName

      protected static String toClassName(org.jboss.jandex.Type indexType, org.jboss.jandex.ClassInfo currentClass, org.jboss.jandex.ClassInfo actualEndpointClass, org.jboss.jandex.IndexView indexView)
    • createIndexedParam

      protected abstract PARAM createIndexedParam()
    • extractParameterInfo

      public PARAM extractParameterInfo(org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo, org.jboss.jandex.MethodInfo currentMethodInfo, Map<String,String> existingConverters, AdditionalReaders additionalReaders, Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> anns, org.jboss.jandex.Type paramType, String errorLocation, Object[] errorLocationParameters, boolean field, boolean hasRuntimeConverters, Set<String> pathParameters, String sourceName, String[] declaredConsumes, Map<String,Object> methodContext)
      Analyzes an endpoint parameter and encapsulates its details into a `PARAM` object.

      Steps performed:

      • Initialization: Creates a `PARAM` object with basic information about the class, method, and annotations.
      • Parameter type identification: Retrieves annotations like `@PathParam`, `@QueryParam`, `@FormParam`, etc. If multiple such annotations are present, an error is thrown. The parameter type is set accordingly.
      • Special processing based on type: Handles collections (`List`, `Set`, `Map`, `Optional`) differently and applies specific rules for `byte[]`, `SseEventSink`, and `AsyncResponse`.
      • Conversion and compatibility: Searches for registered converters if the parameter is convertible, configuring handlers for lists, maps, or primitive types.
      • Finalization: Determines if the parameter is single or multiple. If it does not match previous cases, it is treated as the request body (`@Body`).

      In short, this method identifies, classifies, and configures an endpoint parameter, ensuring proper conversion and handling.

    • handleCustomParameter

      protected boolean handleCustomParameter(Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> anns, PARAM builder, org.jboss.jandex.Type paramType, boolean field, Map<String,Object> methodContext)
    • handlePathSegmentParam

      protected void handlePathSegmentParam(PARAM builder)
    • handleTemporalParam

      protected void handleTemporalParam(PARAM builder, org.jboss.jandex.DotName name, Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> parameterAnnotations, org.jboss.jandex.MethodInfo currentMethodInfo)
    • getDeclaredTypes

      protected EndpointIndexer.DeclaredTypes getDeclaredTypes(org.jboss.jandex.Type paramType, org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo)
    • handleOtherParam

      protected void handleOtherParam(Map<String,String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • handleSortedSetParam

      protected void handleSortedSetParam(Map<String,String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • handleOptionalParam

      protected void handleOptionalParam(Map<String,String> existingConverters, Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> parameterAnnotations, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, String genericElementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • handleSetParam

      protected void handleSetParam(Map<String,String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • handleListParam

      protected void handleListParam(Map<String,String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • handleArrayParam

      protected void handleArrayParam(Map<String,String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo)
    • nameBindingNames

      public Set<String> nameBindingNames(org.jboss.jandex.ClassInfo selectedAppClass)
    • nameBindingNames

      public Set<String> nameBindingNames(org.jboss.jandex.MethodInfo methodInfo, Set<String> forClass)
    • getAnnotationStore

      protected AnnotationStore getAnnotationStore()
    • getPartMime

      protected String getPartMime(Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> annotations)
    • getSeparator

      protected String getSeparator(Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> annotations)
    • hasJson

      protected boolean hasJson(String[] types)
    • isJson

      protected boolean isJson(String type)
    • hasJson

      protected boolean hasJson(org.jboss.resteasy.reactive.common.model.ResourceMethod method)
    • hasNoTypesDefined

      protected boolean hasNoTypesDefined(org.jboss.resteasy.reactive.common.model.ResourceMethod method)
    • isDefaultJson

      protected boolean isDefaultJson(DefaultProducesHandler jsonDefaultProducersHandler, DefaultProducesHandler.Context context)
    • getSerializerScanningResult

      protected SerializerScanningResult getSerializerScanningResult()
    • warnAboutMissingJsonProviderIfNeeded

      protected void warnAboutMissingJsonProviderIfNeeded(org.jboss.resteasy.reactive.common.model.ResourceMethod method, org.jboss.jandex.MethodInfo info, DefaultProducesHandler jsonDefaultProducersHandler, DefaultProducesHandler.Context context)
    • logMissingJsonWarning

      protected void logMissingJsonWarning(org.jboss.jandex.MethodInfo info)