class SwaggerDefinitionProcessor implements ClassAnnotationProcessor<SwaggerDefinition> {

  @Override
  public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) {
    Swagger swagger = swaggerGenerator.getSwagger();

    if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) {
      swaggerGenerator.setBasePath(definitionAnnotation.basePath());
    }
    if (StringUtils.isNotEmpty(definitionAnnotation.host())) {
      swagger.setHost(definitionAnnotation.host());
    }

    SwaggerUtils.setConsumes(swagger, definitionAnnotation.consumes());
    SwaggerUtils.setProduces(swagger, definitionAnnotation.produces());
    convertSchemes(definitionAnnotation, swagger);
    convertTags(definitionAnnotation, swagger);
    convertInfo(definitionAnnotation.info(), swagger);
    swagger.setExternalDocs(convertExternalDocs(definitionAnnotation.externalDocs()));
  }

}