Package io.swagger.servlet.extensions
Class ServletReaderExtension
- java.lang.Object
-
- io.swagger.servlet.extensions.ServletReaderExtension
-
- All Implemented Interfaces:
ReaderExtension
public class ServletReaderExtension extends Object implements ReaderExtension
-
-
Constructor Summary
Constructors Constructor Description ServletReaderExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyConsumes(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the consumes from the method's annotations and applies these to the operation.voidapplyDescription(io.swagger.models.Operation operation, Method method)Reads the description from the method's annotations and applies it to the operation.voidapplyExtensions(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the extensions from the method's annotations and applies these to the operation.voidapplyImplicitParameters(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the implicit parameters from the method's annotations and applies these to the operation.voidapplyOperationId(io.swagger.models.Operation operation, Method method)Reads the operation id from the method's annotations and applies it to the operation.voidapplyParameters(ReaderContext context, io.swagger.models.Operation operation, Type type, Annotation[] annotations)Reads the parameters from the method's annotations and applies these to the operation.voidapplyProduces(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the produces from the method's annotations and applies these to the operation.voidapplyResponses(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the responses from the method's annotations and applies these to the operation.voidapplySchemes(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the schemes from the method's annotations and applies these to the operation.voidapplySecurityRequirements(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the security requirement from the method's annotations and applies these to the operation.voidapplySummary(io.swagger.models.Operation operation, Method method)Reads the summary from the method's annotations and applies it to the operation.voidapplyTags(ReaderContext context, io.swagger.models.Operation operation, Method method)Reads the tags from the method's annotations and applies these to the operation.StringgetHttpMethod(ReaderContext context, Method method)Returns http method.StringgetPath(ReaderContext context, Method method)Returns operation's path.intgetPriority()Returns this extension's priority.booleanisReadable(ReaderContext context)Checks that a resource should be scanned.voidsetDeprecated(io.swagger.models.Operation operation, Method method)Sets the deprecated flag to the operation.
-
-
-
Method Detail
-
getPriority
public int getPriority()
Description copied from interface:ReaderExtensionReturns this extension's priority. Note: Extension will be executed first with lowest priority.- Specified by:
getPriorityin interfaceReaderExtension- Returns:
- this extension's priority
-
isReadable
public boolean isReadable(ReaderContext context)
Description copied from interface:ReaderExtensionChecks that a resource should be scanned.- Specified by:
isReadablein interfaceReaderExtension- Parameters:
context- is the resource context- Returns:
- true if the resource needs to be scanned, otherwise false
-
applyConsumes
public void applyConsumes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the consumes from the method's annotations and applies these to the operation.- Specified by:
applyConsumesin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
applyProduces
public void applyProduces(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the produces from the method's annotations and applies these to the operation.- Specified by:
applyProducesin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
getHttpMethod
public String getHttpMethod(ReaderContext context, Method method)
Description copied from interface:ReaderExtensionReturns http method.- Specified by:
getHttpMethodin interfaceReaderExtension- Parameters:
context- is the resource contextmethod- is the method for reading annotations- Returns:
- http method
-
getPath
public String getPath(ReaderContext context, Method method)
Description copied from interface:ReaderExtensionReturns operation's path.- Specified by:
getPathin interfaceReaderExtension- Parameters:
context- is the resource contextmethod- is the method for reading annotations- Returns:
- operation's path
-
applyOperationId
public void applyOperationId(io.swagger.models.Operation operation, Method method)Description copied from interface:ReaderExtensionReads the operation id from the method's annotations and applies it to the operation.- Specified by:
applyOperationIdin interfaceReaderExtension- Parameters:
operation- is the container for the operation datamethod- is the method for reading annotations
-
applySummary
public void applySummary(io.swagger.models.Operation operation, Method method)Description copied from interface:ReaderExtensionReads the summary from the method's annotations and applies it to the operation.- Specified by:
applySummaryin interfaceReaderExtension- Parameters:
operation- is the container for the operation datamethod- is the method for reading annotations
-
applyDescription
public void applyDescription(io.swagger.models.Operation operation, Method method)Description copied from interface:ReaderExtensionReads the description from the method's annotations and applies it to the operation.- Specified by:
applyDescriptionin interfaceReaderExtension- Parameters:
operation- is the container for the operation datamethod- is the method for reading annotations
-
applySchemes
public void applySchemes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the schemes from the method's annotations and applies these to the operation.- Specified by:
applySchemesin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
setDeprecated
public void setDeprecated(io.swagger.models.Operation operation, Method method)Description copied from interface:ReaderExtensionSets the deprecated flag to the operation.- Specified by:
setDeprecatedin interfaceReaderExtension- Parameters:
operation- is the container for the operation datamethod- is the method for reading annotations
-
applySecurityRequirements
public void applySecurityRequirements(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the security requirement from the method's annotations and applies these to the operation.- Specified by:
applySecurityRequirementsin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
applyTags
public void applyTags(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the tags from the method's annotations and applies these to the operation.- Specified by:
applyTagsin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
applyResponses
public void applyResponses(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the responses from the method's annotations and applies these to the operation.- Specified by:
applyResponsesin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
applyParameters
public void applyParameters(ReaderContext context, io.swagger.models.Operation operation, Type type, Annotation[] annotations)
Description copied from interface:ReaderExtensionReads the parameters from the method's annotations and applies these to the operation.- Specified by:
applyParametersin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datatype- is the type of parameterannotations- are the method's annotations
-
applyImplicitParameters
public void applyImplicitParameters(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the implicit parameters from the method's annotations and applies these to the operation.- Specified by:
applyImplicitParametersin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
applyExtensions
public void applyExtensions(ReaderContext context, io.swagger.models.Operation operation, Method method)
Description copied from interface:ReaderExtensionReads the extensions from the method's annotations and applies these to the operation.- Specified by:
applyExtensionsin interfaceReaderExtension- Parameters:
context- is the resource contextoperation- is the container for the operation datamethod- is the method for reading annotations
-
-