コード例 #1
0
 private void setBasePathFromAnnotation() {
   for (Class<?> aClass : getValidClasses(SwaggerDefinition.class)) {
     SwaggerDefinition swaggerDefinition =
         AnnotationUtils.findAnnotation(aClass, SwaggerDefinition.class);
     basePath = swaggerDefinition.basePath();
   }
 }
コード例 #2
0
 private void setHostFromAnnotation() {
   for (Class<?> aClass : getValidClasses(SwaggerDefinition.class)) {
     SwaggerDefinition swaggerDefinition =
         AnnotationUtils.findAnnotation(aClass, SwaggerDefinition.class);
     host = swaggerDefinition.host();
   }
 }
コード例 #3
0
 private void setInfoFromAnnotation() {
   Info resultInfo = new Info();
   for (Class<?> aClass : getValidClasses(SwaggerDefinition.class)) {
     SwaggerDefinition swaggerDefinition =
         AnnotationUtils.findAnnotation(aClass, SwaggerDefinition.class);
     io.swagger.annotations.Info infoAnnotation = swaggerDefinition.info();
     Info info =
         new Info()
             .title(infoAnnotation.title())
             .description(infoAnnotation.description())
             .version(infoAnnotation.version())
             .termsOfService(infoAnnotation.termsOfService())
             .license(from(infoAnnotation.license()))
             .contact(from(infoAnnotation.contact()));
     resultInfo.mergeWith(info);
   }
   info = resultInfo;
 }