public interface AnnotationScanner
| Modifier and Type | Method and Description |
|---|---|
default void |
addApiReponseFromAnnotation(AnnotationScannerContext context,
org.jboss.jandex.AnnotationInstance apiResponseAnnotation,
org.eclipse.microprofile.openapi.models.Operation operation)
Add api response to api responses using the annotation information
|
default void |
addApiReponseSchemaFromAnnotation(AnnotationScannerContext context,
org.jboss.jandex.AnnotationInstance annotation,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Add api response to api responses using the annotation information
|
boolean |
containsScannerAnnotations(List<org.jboss.jandex.AnnotationInstance> instances,
List<AnnotationScannerExtension> extensions) |
default void |
createResponseFromRestMethod(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Called when a scanner (jax-rs, spring) method's APIResponse annotations have all been processed but
no response was actually created for the operation.This method will create a response
from the method information and add it to the given operation.
|
default boolean |
generateResponse(String status,
org.eclipse.microprofile.openapi.models.Operation operation)
Determine if the default response information should be generated.
|
default String[] |
getConsumes(AnnotationScannerContext context) |
default int |
getDefaultStatus(org.jboss.jandex.MethodInfo method)
Derives a default HTTP status code for the provided REST endpoint implementation
method using the rules defined by @APIResponseSchema#responseCode().
|
String |
getName() |
default String |
getReasonPhrase(int statusCode)
Get the default description for a HTTP Status code
|
default org.jboss.jandex.Type |
getRequestBodyParameterClassType(org.jboss.jandex.MethodInfo method,
List<AnnotationScannerExtension> extensions)
Go through the method parameters looking for one that is not annotated with a jax-rs/spring
annotation.That will be the one that is the request body.
|
default List<org.jboss.jandex.MethodInfo> |
getResourceMethods(AnnotationScannerContext context,
org.jboss.jandex.ClassInfo resource)
Extracts all methods from the provided class and its ancestors that are known to the instance's index
|
boolean |
isAsyncResponse(org.jboss.jandex.MethodInfo method) |
boolean |
isDeleteMethod(org.jboss.jandex.MethodInfo method) |
default boolean |
isEmptySecurityRequirements(org.jboss.jandex.AnnotationTarget target)
Determines whether the target is annotated with an empty
@SecurityRequirements
annotation. |
default boolean |
isMultipartInput(org.jboss.jandex.Type inputType) |
default boolean |
isMultipartOutput(org.jboss.jandex.Type returnType) |
boolean |
isPostMethod(org.jboss.jandex.MethodInfo method) |
default boolean |
isScannerInternalParameter(org.jboss.jandex.Type parameterType) |
default boolean |
isScannerInternalResponse(org.jboss.jandex.Type returnType) |
default boolean |
isVoidResponse(org.jboss.jandex.MethodInfo method) |
default boolean |
isWrapperType(org.jboss.jandex.Type type) |
default void |
processCallback(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Process a callback annotation
|
default void |
processDefinitionAnnotation(AnnotationScannerContext context,
org.jboss.jandex.ClassInfo targetClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
Process a certain class for OpenApiDefinition annotations.
|
default void |
processExtensions(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Process the Extensions annotations
|
default void |
processJavaSecurity(org.jboss.jandex.ClassInfo resourceClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
Process Java security (roles allowed and declared roles)
|
default Optional<org.eclipse.microprofile.openapi.models.Operation> |
processOperation(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method)
While scanning JAX-RS/Spring method, find the operations
|
default void |
processOperationTags(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.OpenAPI openApi,
Set<String> resourceTags,
org.eclipse.microprofile.openapi.models.Operation operation)
Process tags.
|
default org.eclipse.microprofile.openapi.models.parameters.RequestBody |
processRequestBody(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
ResourceParameters params)
Process the request body
|
default void |
processResponse(AnnotationScannerContext context,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation,
Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> exceptionAnnotationMap) |
default void |
processScannerExtensions(AnnotationScannerContext context,
Collection<org.jboss.jandex.ClassInfo> applications)
Scan for scanner extensions
|
default void |
processSecurityRequirementAnnotation(org.jboss.jandex.ClassInfo resourceClass,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Get the security requirements on method and class and add them to the openapi model
|
default void |
processSecuritySchemeAnnotation(AnnotationScannerContext context,
org.jboss.jandex.ClassInfo targetClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
Process a certain class for security annotations.
|
default void |
processServerAnnotation(org.jboss.jandex.ClassInfo targetClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
Process a certain class for server annotations.
|
default void |
processServerAnnotation(org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
Process a certain method for server annotations.
|
default Set<String> |
processTags(AnnotationScannerContext context,
org.jboss.jandex.AnnotationTarget target,
org.eclipse.microprofile.openapi.models.OpenAPI openApi,
boolean nullWhenMissing)
Processes any
Tag or
Tags annotations present on
the annotation target and adds them to the OpenAPI model. |
default boolean |
responseCodeExistInMethodAnnotations(AnnotationScannerContext context,
org.jboss.jandex.AnnotationInstance exMapperApiResponseAnnotation,
List<org.jboss.jandex.AnnotationInstance> methodApiResponseAnnotations)
Check if the response code declared in the ExceptionMapper already defined in one of the ApiReponse annotations of the
method.
|
org.eclipse.microprofile.openapi.models.OpenAPI |
scan(AnnotationScannerContext annotationScannerContext,
org.eclipse.microprofile.openapi.models.OpenAPI oai) |
void |
setContextRoot(String path) |
default void |
setOperationOnPathItem(org.eclipse.microprofile.openapi.models.PathItem.HttpMethod methodType,
org.eclipse.microprofile.openapi.models.PathItem pathItem,
org.eclipse.microprofile.openapi.models.Operation operation)
Set the created operation to the pathItem
|
default void |
sortPaths(org.eclipse.microprofile.openapi.models.OpenAPI openApi)
Now that all paths have been created, sort them.
|
default void |
sortTags(org.eclipse.microprofile.openapi.models.OpenAPI openApi,
boolean tagsDefined)
Sort the tags unless the application has defined the order in OpenAPIDefinition annotation(s)
|
default org.jboss.jandex.Type |
unwrapType(org.jboss.jandex.Type type) |
String getName()
org.eclipse.microprofile.openapi.models.OpenAPI scan(AnnotationScannerContext annotationScannerContext, org.eclipse.microprofile.openapi.models.OpenAPI oai)
boolean isAsyncResponse(org.jboss.jandex.MethodInfo method)
boolean isPostMethod(org.jboss.jandex.MethodInfo method)
boolean isDeleteMethod(org.jboss.jandex.MethodInfo method)
boolean containsScannerAnnotations(List<org.jboss.jandex.AnnotationInstance> instances, List<AnnotationScannerExtension> extensions)
void setContextRoot(String path)
default boolean isMultipartOutput(org.jboss.jandex.Type returnType)
default boolean isMultipartInput(org.jboss.jandex.Type inputType)
default boolean isScannerInternalResponse(org.jboss.jandex.Type returnType)
default boolean isScannerInternalParameter(org.jboss.jandex.Type parameterType)
default boolean isWrapperType(org.jboss.jandex.Type type)
default org.jboss.jandex.Type unwrapType(org.jboss.jandex.Type type)
default void processDefinitionAnnotation(AnnotationScannerContext context, org.jboss.jandex.ClassInfo targetClass, org.eclipse.microprofile.openapi.models.OpenAPI openApi)
context - the scanning contexttargetClass - the class that contain the server annotationopenApi - the current OpenApi model being createddefault void processSecuritySchemeAnnotation(AnnotationScannerContext context, org.jboss.jandex.ClassInfo targetClass, org.eclipse.microprofile.openapi.models.OpenAPI openApi)
targetClass - the class that contain the security annotationopenApi - the current OpenApi model being createddefault void processServerAnnotation(org.jboss.jandex.ClassInfo targetClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
targetClass - the class that contain the server annotationopenApi - the current OpenApi model being createddefault void processJavaSecurity(org.jboss.jandex.ClassInfo resourceClass,
org.eclipse.microprofile.openapi.models.OpenAPI openApi)
openApi - the OpenAPI ModelresourceClass - the Class being scanneddefault void processOperationTags(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.OpenAPI openApi, Set<String> resourceTags, org.eclipse.microprofile.openapi.models.Operation operation)
method - the REST methodopenApi - the OpenApi modelresourceTags - tags passed inoperation - the current operationdefault Set<String> processTags(AnnotationScannerContext context, org.jboss.jandex.AnnotationTarget target, org.eclipse.microprofile.openapi.models.OpenAPI openApi, boolean nullWhenMissing)
Tag or
Tags annotations present on
the annotation target and adds them to the OpenAPI model. The set of tag names found
(with iteration order preserved) is returned.openApi - OpenAPI modeltarget - a MethodInfo or ClassInfo to read for tag annotationsnullWhenMissing - determines if an empty set or a null value is returned when no annotations are found.default List<org.jboss.jandex.MethodInfo> getResourceMethods(AnnotationScannerContext context, org.jboss.jandex.ClassInfo resource)
context - the scanning contextresource - the resource classdefault Optional<org.eclipse.microprofile.openapi.models.Operation> processOperation(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method)
context - the scanning contextmethod - the JAX-RS/Spring methoddefault void processResponse(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.Operation operation, Map<org.jboss.jandex.DotName,org.jboss.jandex.AnnotationInstance> exceptionAnnotationMap)
default void createResponseFromRestMethod(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.Operation operation)
context - the scanning contextmethod - the current methodoperation - the current operationdefault int getDefaultStatus(org.jboss.jandex.MethodInfo method)
method - the endpoint methoddefault boolean isVoidResponse(org.jboss.jandex.MethodInfo method)
default boolean generateResponse(String status, org.eclipse.microprofile.openapi.models.Operation operation)
status - the status determined to be the generated defaultoperation - current operationdefault void addApiReponseFromAnnotation(AnnotationScannerContext context, org.jboss.jandex.AnnotationInstance apiResponseAnnotation, org.eclipse.microprofile.openapi.models.Operation operation)
context - The current scanning contextapiResponseAnnotation - The api response annotationoperation - The method operationdefault void addApiReponseSchemaFromAnnotation(AnnotationScannerContext context, org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.Operation operation)
context - the scanning contextannotation - The APIResponseSchema annotationmethod - the current methodoperation - the method operationdefault boolean responseCodeExistInMethodAnnotations(AnnotationScannerContext context, org.jboss.jandex.AnnotationInstance exMapperApiResponseAnnotation, List<org.jboss.jandex.AnnotationInstance> methodApiResponseAnnotations)
exMapperApiResponseAnnotation - ApiResponse annotation declared in the exception mappermethodApiResponseAnnotations - List of ApiResponse annotations declared in the jax-rs/spring method.default void processSecurityRequirementAnnotation(org.jboss.jandex.ClassInfo resourceClass,
org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
resourceClass - the classmethod - the methodoperation - the operation to add them todefault boolean isEmptySecurityRequirements(org.jboss.jandex.AnnotationTarget target)
@SecurityRequirements
annotation.target - default void processCallback(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.Operation operation)
context - the scanning contextmethod - the methodoperation - the operation to add this todefault void processServerAnnotation(org.jboss.jandex.MethodInfo method,
org.eclipse.microprofile.openapi.models.Operation operation)
method - the method that contain the server annotationoperation - the current Operation model being createddefault void processExtensions(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, org.eclipse.microprofile.openapi.models.Operation operation)
context - the scanning contextmethod - the current REST methodoperation - the current operationdefault void setOperationOnPathItem(org.eclipse.microprofile.openapi.models.PathItem.HttpMethod methodType,
org.eclipse.microprofile.openapi.models.PathItem pathItem,
org.eclipse.microprofile.openapi.models.Operation operation)
methodType - the HTTP method typepathItem - the pathItem to setoperation - the operationdefault void processScannerExtensions(AnnotationScannerContext context, Collection<org.jboss.jandex.ClassInfo> applications)
context - the scanning contextapplications - the scanner applicationsdefault void sortTags(org.eclipse.microprofile.openapi.models.OpenAPI openApi,
boolean tagsDefined)
openApi - the openAPI modeltagsDefined - is the tags defineddefault void sortPaths(org.eclipse.microprofile.openapi.models.OpenAPI openApi)
openApi - the openApi modeldefault org.eclipse.microprofile.openapi.models.parameters.RequestBody processRequestBody(AnnotationScannerContext context, org.jboss.jandex.MethodInfo method, ResourceParameters params)
context - the current scanning contextmethod - the resource methodparams - the paramsdefault String[] getConsumes(AnnotationScannerContext context)
default org.jboss.jandex.Type getRequestBodyParameterClassType(org.jboss.jandex.MethodInfo method,
List<AnnotationScannerExtension> extensions)
method - MethodInfoextensions - available extensionsdefault String getReasonPhrase(int statusCode)
statusCode - Copyright © 2018–2021. All rights reserved.