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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classEndpointIndexer.Builder<T extends EndpointIndexer<T,?, METHOD>, B extends EndpointIndexer.Builder<T, B, METHOD>, METHOD extends org.jboss.resteasy.reactive.common.model.ResourceMethod> static classstatic interfacestatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AdditionalReadersprotected final Set<org.jboss.jandex.DotName> protected final org.jboss.jandex.IndexViewprotected final ApplicationScanningResultstatic final Stringprotected final org.jboss.resteasy.reactive.common.ResteasyReactiveConfigprotected static final String[]protected final booleanprotected final org.jboss.jandex.IndexViewprotected static final org.jboss.logging.Loggerstatic final Stringstatic final Stringstatic final Stringprotected static final Set<org.jboss.jandex.DotName> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEndpointIndexer(EndpointIndexer.Builder<T, ?, METHOD> builder) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected abstract voidaddReaderForType(AdditionalReaders additionalReaders, org.jboss.jandex.Type paramType) protected abstract voidaddWriterForType(AdditionalWriters additionalWriters, org.jboss.jandex.Type paramType) protected String[]applyAdditionalDefaults(org.jboss.jandex.Type nonAsyncReturnType) Optional<org.jboss.resteasy.reactive.common.model.ResourceClass> createEndpoints(org.jboss.jandex.ClassInfo classInfo, boolean considerApplication) 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) protected abstract PARAMprotected abstract org.jboss.resteasy.reactive.common.model.MethodParametercreateMethodParameter(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) protected abstract METHODcreateResourceMethod(org.jboss.jandex.MethodInfo info, org.jboss.jandex.ClassInfo actualEndpointClass, Map<String, Object> methodContext) protected booleandoesMethodHaveBlockingSignature(org.jboss.jandex.MethodInfo info) 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.static String[]extractProducesConsumesValues(org.jboss.jandex.AnnotationInstance annotation, String[] defaultValue) protected AnnotationStoreprotected EndpointIndexer.DeclaredTypesgetDeclaredTypes(org.jboss.jandex.Type paramType, org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo) protected StringgetPartMime(Map<org.jboss.jandex.DotName, org.jboss.jandex.AnnotationInstance> annotations) protected StringgetSeparator(Map<org.jboss.jandex.DotName, org.jboss.jandex.AnnotationInstance> annotations) protected SerializerScanningResultprotected voidhandleAdditionalMethodProcessing(METHOD method, org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.MethodInfo info, AnnotationStore annotationStore) protected voidhandleArrayParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo) protected abstract booleanhandleBeanParam(org.jboss.jandex.ClassInfo actualEndpointInfo, org.jboss.jandex.Type paramType, org.jboss.resteasy.reactive.common.model.MethodParameter[] methodParameters, int i, Set<String> fileFormNames) protected voidhandleClientSubResource(org.jboss.resteasy.reactive.common.model.ResourceMethod resourceMethod, org.jboss.jandex.MethodInfo method, org.jboss.jandex.IndexView index) protected booleanhandleCustomParameter(Map<org.jboss.jandex.DotName, org.jboss.jandex.AnnotationInstance> anns, PARAM builder, org.jboss.jandex.Type paramType, boolean field, Map<String, Object> methodContext) protected voidhandleListParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo) protected voidhandleOptionalParam(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) protected voidhandleOtherParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo) protected voidhandlePathSegmentParam(PARAM builder) protected voidhandleSetParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo) protected voidhandleSortedSetParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters, PARAM builder, String elementType, org.jboss.jandex.MethodInfo currentMethodInfo) protected voidhandleTemporalParam(PARAM builder, org.jboss.jandex.DotName name, Map<org.jboss.jandex.DotName, org.jboss.jandex.AnnotationInstance> parameterAnnotations, org.jboss.jandex.MethodInfo currentMethodInfo) protected StringhandleTrailingSlash(String path) By default, we are not removing the trailing slash.protected booleanprotected booleanhasJson(org.jboss.resteasy.reactive.common.model.ResourceMethod method) protected booleanhasNoTypesDefined(org.jboss.resteasy.reactive.common.model.ResourceMethod method) protected booleanisDefaultJson(DefaultProducesHandler jsonDefaultProducersHandler, DefaultProducesHandler.Context context) protected booleanprotected voidlogMissingJsonWarning(org.jboss.jandex.MethodInfo info) nameBindingNames(org.jboss.jandex.ClassInfo selectedAppClass) nameBindingNames(org.jboss.jandex.MethodInfo methodInfo, Set<String> forClass) protected abstract org.jboss.resteasy.reactive.common.model.InjectableBeanscanInjectableBean(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) protected voidsetupApplyDefaults(org.jboss.jandex.Type nonAsyncReturnType, org.jboss.jandex.DotName httpMethod) protected booleanskipParameter(Map<org.jboss.jandex.DotName, org.jboss.jandex.AnnotationInstance> anns) protected static StringtoClassName(org.jboss.jandex.Type indexType, org.jboss.jandex.ClassInfo currentClass, org.jboss.jandex.ClassInfo actualEndpointClass, org.jboss.jandex.IndexView indexView) protected voidverifyClassThatRequiresFieldInjection(org.jboss.jandex.ClassInfo classInfo) protected voidwarnAboutMissingJsonProviderIfNeeded(org.jboss.resteasy.reactive.common.model.ResourceMethod method, org.jboss.jandex.MethodInfo info, DefaultProducesHandler jsonDefaultProducersHandler, DefaultProducesHandler.Context context) protected voidwarnAboutMissUsedBodyParameter(org.jboss.jandex.DotName httpMethod, org.jboss.jandex.MethodInfo methodInfo)
-
Field Details
-
primitiveTypes
-
SUPPORT_TEMPORAL_PARAMS
-
log
protected static final org.jboss.logging.Logger log -
EMPTY_STRING_ARRAY
-
CDI_WRAPPER_SUFFIX
- See Also:
-
METHOD_CONTEXT_CUSTOM_RETURN_TYPE_KEY
- See Also:
-
METHOD_CONTEXT_ANNOTATION_STORE
- See Also:
-
METHOD_PRODUCES
- See Also:
-
index
protected final org.jboss.jandex.IndexView index -
applicationIndex
protected final org.jboss.jandex.IndexView applicationIndex -
existingConverters
-
injectableBeans
-
hasRuntimeConverters
protected final boolean hasRuntimeConverters -
config
protected final org.jboss.resteasy.reactive.common.ResteasyReactiveConfig config -
additionalReaders
-
applicationScanningResult
-
alreadyHandledRequestScopedResources
-
-
Constructor Details
-
EndpointIndexer
-
-
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
-
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
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
-
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
-
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
-
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
-
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
-
handlePathSegmentParam
-
handleTemporalParam
-
getDeclaredTypes
protected EndpointIndexer.DeclaredTypes getDeclaredTypes(org.jboss.jandex.Type paramType, org.jboss.jandex.ClassInfo currentClassInfo, org.jboss.jandex.ClassInfo actualEndpointInfo) -
handleOtherParam
-
handleSortedSetParam
-
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
-
handleListParam
-
handleArrayParam
-
nameBindingNames
-
nameBindingNames
-
getAnnotationStore
-
getPartMime
-
getSeparator
-
hasJson
-
isJson
-
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
-
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)
-