Package io.smallrye.openapi.jaxrs
Class JaxRsParameterProcessor
- java.lang.Object
-
- io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor
-
- io.smallrye.openapi.jaxrs.JaxRsParameterProcessor
-
public class JaxRsParameterProcessor extends AbstractParameterProcessor
Note, javax.ws.rs.PathParam PathParam targets of javax.ws.rs.core.PathSegment PathSegment are not currently supported.- Author:
- Michael Edgar <michael@xlate.io>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor
AbstractParameterProcessor.ParameterContext, AbstractParameterProcessor.ParameterContextKey
-
-
Field Summary
-
Fields inherited from class io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor
APPLICATION_FORM_URLENCODED, beanValidationScanner, cl, contextPath, extensions, formMediaType, formParams, index, matrixParams, params, readerFunction, scannerContext
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEncoding(Map<String,org.eclipse.microprofile.openapi.models.media.Encoding> encodings, String paramName, org.jboss.jandex.AnnotationTarget paramTarget)protected Set<org.jboss.jandex.DotName>getDefaultAnnotationNames()protected StringgetDefaultAnnotationProperty()protected StringgetDefaultFormMediaType()protected FrameworkParametergetMatrixParameter()protected PatterngetTemplateParameterPattern()protected AbstractParameterProcessor.ParameterContextgetUnannotatedPathParameter(org.jboss.jandex.MethodInfo resourceMethod, String name)protected booleanisParameter(org.jboss.jandex.DotName annotationName)protected booleanisResourceMethod(org.jboss.jandex.MethodInfo method)protected booleanisSubResourceLocator(org.jboss.jandex.MethodInfo method)protected StringpathOf(org.jboss.jandex.AnnotationTarget target)static ResourceParametersprocess(AnnotationScannerContext context, String contextPath, org.jboss.jandex.ClassInfo resourceClass, org.jboss.jandex.MethodInfo resourceMethod, Function<org.jboss.jandex.AnnotationInstance,org.eclipse.microprofile.openapi.models.parameters.Parameter> reader, List<AnnotationScannerExtension> extensions)Process parameter annotations for the given class and method.This method operates in two phases.protected voidprocessPathParameters(org.jboss.jandex.ClassInfo resourceClass, org.jboss.jandex.MethodInfo resourceMethod, ResourceParameters parameters)protected voidreadAnnotatedType(org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.AnnotationInstance beanParamAnnotation, boolean overriddenParametersOnly)-
Methods inherited from class io.smallrye.openapi.runtime.scanner.spi.AbstractParameterProcessor
fullPathOf, generatePath, getDefaultValue, getFormBodyContent, getParameters, getType, hasParameters, isIgnoredParameter, isReadableParameterAnnotation, lastPathSegmentOf, paramName, primitiveToObject, process, processFinalize, processOperationParameters, readAnnotatedType, readFrameworkParameter, readParameter, readParameterAnnotation, readParameterAnnotation, readParameters, readParametersInherited, reset, resolveType, setMediaType, setSchemaProperties, styleOf
-
-
-
-
Method Detail
-
process
public static ResourceParameters process(AnnotationScannerContext context, String contextPath, org.jboss.jandex.ClassInfo resourceClass, org.jboss.jandex.MethodInfo resourceMethod, Function<org.jboss.jandex.AnnotationInstance,org.eclipse.microprofile.openapi.models.parameters.Parameter> reader, List<AnnotationScannerExtension> extensions)
Process parameter annotations for the given class and method.This method operates in two phases. First, class-level parameters are processed and saved in theResourceParameters. Second, method-level parameters are processed. Form parameters are only applicable to the method-level in this component.- Parameters:
context- the AnnotationScannerContextcontextPath- context path for the resource class and methodresourceClass- the class inforesourceMethod- the JAX-RS resource method, annotated with one of the JAX-RS HTTP annotationsreader- callback method for a function producingParameterfrom aParameterextensions- scanner extensions- Returns:
- scanned parameters and modified path contained in a
ResourceParametersobject
-
processPathParameters
protected void processPathParameters(org.jboss.jandex.ClassInfo resourceClass, org.jboss.jandex.MethodInfo resourceMethod, ResourceParameters parameters)- Overrides:
processPathParametersin classAbstractParameterProcessor
-
getTemplateParameterPattern
protected Pattern getTemplateParameterPattern()
- Specified by:
getTemplateParameterPatternin classAbstractParameterProcessor
-
getMatrixParameter
protected FrameworkParameter getMatrixParameter()
- Specified by:
getMatrixParameterin classAbstractParameterProcessor
-
getUnannotatedPathParameter
protected AbstractParameterProcessor.ParameterContext getUnannotatedPathParameter(org.jboss.jandex.MethodInfo resourceMethod, String name)
- Overrides:
getUnannotatedPathParameterin classAbstractParameterProcessor
-
getDefaultFormMediaType
protected String getDefaultFormMediaType()
- Overrides:
getDefaultFormMediaTypein classAbstractParameterProcessor
-
addEncoding
protected void addEncoding(Map<String,org.eclipse.microprofile.openapi.models.media.Encoding> encodings, String paramName, org.jboss.jandex.AnnotationTarget paramTarget)
- Overrides:
addEncodingin classAbstractParameterProcessor
-
readAnnotatedType
protected void readAnnotatedType(org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.AnnotationInstance beanParamAnnotation, boolean overriddenParametersOnly)- Specified by:
readAnnotatedTypein classAbstractParameterProcessor
-
getDefaultAnnotationNames
protected Set<org.jboss.jandex.DotName> getDefaultAnnotationNames()
- Overrides:
getDefaultAnnotationNamesin classAbstractParameterProcessor
-
getDefaultAnnotationProperty
protected String getDefaultAnnotationProperty()
- Overrides:
getDefaultAnnotationPropertyin classAbstractParameterProcessor
-
pathOf
protected String pathOf(org.jboss.jandex.AnnotationTarget target)
- Specified by:
pathOfin classAbstractParameterProcessor
-
isSubResourceLocator
protected boolean isSubResourceLocator(org.jboss.jandex.MethodInfo method)
- Specified by:
isSubResourceLocatorin classAbstractParameterProcessor
-
isResourceMethod
protected boolean isResourceMethod(org.jboss.jandex.MethodInfo method)
- Specified by:
isResourceMethodin classAbstractParameterProcessor
-
isParameter
protected boolean isParameter(org.jboss.jandex.DotName annotationName)
- Specified by:
isParameterin classAbstractParameterProcessor
-
-