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 void
applyConsumes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the consumes from the method's annotations and applies these to the operation.void
applyDescription(io.swagger.models.Operation operation, Method method)
Reads the description from the method's annotations and applies it to the operation.void
applyExtensions(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the extensions from the method's annotations and applies these to the operation.void
applyImplicitParameters(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the implicit parameters from the method's annotations and applies these to the operation.void
applyOperationId(io.swagger.models.Operation operation, Method method)
Reads the operation id from the method's annotations and applies it to the operation.void
applyParameters(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.void
applyProduces(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the produces from the method's annotations and applies these to the operation.void
applyResponses(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the responses from the method's annotations and applies these to the operation.void
applySchemes(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the schemes from the method's annotations and applies these to the operation.void
applySecurityRequirements(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the security requirement from the method's annotations and applies these to the operation.void
applySummary(io.swagger.models.Operation operation, Method method)
Reads the summary from the method's annotations and applies it to the operation.void
applyTags(ReaderContext context, io.swagger.models.Operation operation, Method method)
Reads the tags from the method's annotations and applies these to the operation.String
getHttpMethod(ReaderContext context, Method method)
Returns http method.String
getPath(ReaderContext context, Method method)
Returns operation's path.int
getPriority()
Returns this extension's priority.boolean
isReadable(ReaderContext context)
Checks that a resource should be scanned.void
setDeprecated(io.swagger.models.Operation operation, Method method)
Sets the deprecated flag to the operation.
-
-
-
Method Detail
-
getPriority
public int getPriority()
Description copied from interface:ReaderExtension
Returns this extension's priority. Note: Extension will be executed first with lowest priority.- Specified by:
getPriority
in interfaceReaderExtension
- Returns:
- this extension's priority
-
isReadable
public boolean isReadable(ReaderContext context)
Description copied from interface:ReaderExtension
Checks that a resource should be scanned.- Specified by:
isReadable
in 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:ReaderExtension
Reads the consumes from the method's annotations and applies these to the operation.- Specified by:
applyConsumes
in 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:ReaderExtension
Reads the produces from the method's annotations and applies these to the operation.- Specified by:
applyProduces
in 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:ReaderExtension
Returns http method.- Specified by:
getHttpMethod
in 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:ReaderExtension
Returns operation's path.- Specified by:
getPath
in 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:ReaderExtension
Reads the operation id from the method's annotations and applies it to the operation.- Specified by:
applyOperationId
in 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:ReaderExtension
Reads the summary from the method's annotations and applies it to the operation.- Specified by:
applySummary
in 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:ReaderExtension
Reads the description from the method's annotations and applies it to the operation.- Specified by:
applyDescription
in 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:ReaderExtension
Reads the schemes from the method's annotations and applies these to the operation.- Specified by:
applySchemes
in 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:ReaderExtension
Sets the deprecated flag to the operation.- Specified by:
setDeprecated
in 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:ReaderExtension
Reads the security requirement from the method's annotations and applies these to the operation.- Specified by:
applySecurityRequirements
in 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:ReaderExtension
Reads the tags from the method's annotations and applies these to the operation.- Specified by:
applyTags
in 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:ReaderExtension
Reads the responses from the method's annotations and applies these to the operation.- Specified by:
applyResponses
in 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:ReaderExtension
Reads the parameters from the method's annotations and applies these to the operation.- Specified by:
applyParameters
in 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:ReaderExtension
Reads the implicit parameters from the method's annotations and applies these to the operation.- Specified by:
applyImplicitParameters
in 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:ReaderExtension
Reads the extensions from the method's annotations and applies these to the operation.- Specified by:
applyExtensions
in interfaceReaderExtension
- Parameters:
context
- is the resource contextoperation
- is the container for the operation datamethod
- is the method for reading annotations
-
-