@Override public Optional<String> apply(Api input) { if (null != input) { String stripSlashes = input.value().replace("/", ""); return Optional.fromNullable(emptyToNull(stripSlashes)); } return Optional.absent(); } };
@Override public Optional<String> apply(Api input) { if (null != input) { String stripSlashes = input.value().replace("/", ""); return Optional.fromNullable(emptyToNull(stripSlashes)); } return Optional.absent(); } };
@Override public Integer getResourcePosition(RequestMappingInfo requestMappingInfo, HandlerMethod handlerMethod) { Class<?> controllerClass = handlerMethod.getBeanType(); Api apiAnnotation = AnnotationUtils.findAnnotation(controllerClass, Api.class); if (null != apiAnnotation && hasText(apiAnnotation.value())) { return apiAnnotation.position(); } return 0; }
@Override public Integer getResourcePosition(RequestMappingInfo requestMappingInfo, HandlerMethod handlerMethod) { Class<?> controllerClass = handlerMethod.getBeanType(); Api apiAnnotation = AnnotationUtils.findAnnotation(controllerClass, Api.class); if (null != apiAnnotation && hasText(apiAnnotation.value())) { return apiAnnotation.position(); } return 0; }
private String getDescription(HandlerMethod handlerMethod) { Class<?> controllerClass = handlerMethod.getBeanType(); String description = splitCamelCase(controllerClass.getSimpleName(), " "); Api apiAnnotation = AnnotationUtils.findAnnotation(controllerClass, Api.class); if (null != apiAnnotation) { String descriptionFromAnnotation = Optional.fromNullable(emptyToNull(apiAnnotation.value())) .or(apiAnnotation.description()); if (!isNullOrEmpty(descriptionFromAnnotation)) { return descriptionFromAnnotation; } } return description; } }
apiDescription.put("name", info.value()); apiDescription.put("path", path.value()); apiDescription.put("description", info.description());
Api api = classElementIn.getAnnotation(Api.class); if (api!=null) { String shortDescription = api.value(); setOptionalAttribute(classElement, "shortDesc", shortDescription); String longDescription = api.description();
/** * Adds data from the {@link Api} annotation to the resource. * * @param api * The {@link Api} annotation. * @param resource * The {@link Resource} to update. */ public static void processApi(Api api, Resource resource) { if (!StringUtils.isNullOrEmpty(api.value())) { resource.setName(api.value()); } if (!StringUtils.isNullOrEmpty(api.description())) { resource.setDescription(api.description()); } }
/** * Adds data from the {@link Api} annotation to the resource. * * @param api * The {@link Api} annotation. * @param resource * The {@link Resource} to update. */ public static void processApi(Api api, Resource resource) { if (!StringUtils.isNullOrEmpty(api.value())) { resource.setName(api.value()); } if (!StringUtils.isNullOrEmpty(api.description())) { resource.setDescription(api.description()); } }
/** * Adds data from the {@link Api} annotation to the resource. * * @param api * The {@link Api} annotation. * @param resource * The {@link Resource} to update. */ public static void processApi(Api api, Resource resource) { if (!StringUtils.isNullOrEmpty(api.value())) { resource.setName(api.value()); } if (!StringUtils.isNullOrEmpty(api.description())) { resource.setDescription(api.description()); } }
/** * Adds data from the {@link Api} annotation to the resource. * * @param api * The {@link Api} annotation. * @param resource * The {@link Resource} to update. */ public static void processApi(Api api, Resource resource) { if (!StringUtils.isNullOrEmpty(api.value())) { resource.setName(api.value()); } if (!StringUtils.isNullOrEmpty(api.description())) { resource.setDescription(api.description()); } }
/** * Adds data from the {@link Api} annotation to the resource. * * @param api * The {@link Api} annotation. * @param resource * The {@link Resource} to update. */ public static void processApi(Api api, Resource resource) { if (!StringUtils.isNullOrEmpty(api.value())) { resource.setName(api.value()); } if (!StringUtils.isNullOrEmpty(api.description())) { resource.setDescription(api.description()); } }
com.wordnik.swagger.annotations.Api api = resourceClass.getAnnotation(com.wordnik.swagger.annotations.Api.class); if (api != null) { String apiPath = api.value(); String serverAddress = server.getEndpoint().getEndpointInfo().getAddress(); String apiDocs = serverAddress + "/api-docs";
throw new SiteWhereException("Swagger Api annotation missing on documented controller."); parsed.setResource(api.value());