本文整理了Java中com.wordnik.swagger.annotations.Api.value()
方法的一些代码示例,展示了Api.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Api.value()
方法的具体详情如下:
包路径:com.wordnik.swagger.annotations.Api
类名称:Api
方法名:value
暂无
代码示例来源:origin: com.github.springdox/springdox-swagger-common
@Override
public Optional<String> apply(Api input) {
if (null != input) {
String stripSlashes = input.value().replace("/", "");
return Optional.fromNullable(emptyToNull(stripSlashes));
}
return Optional.absent();
}
};
代码示例来源:origin: com.mangofactory/swagger-springmvc
@Override
public Optional<String> apply(Api input) {
if (null != input) {
String stripSlashes = input.value().replace("/", "");
return Optional.fromNullable(emptyToNull(stripSlashes));
}
return Optional.absent();
}
};
代码示例来源:origin: com.mangofactory/swagger-springmvc
@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;
}
代码示例来源:origin: com.github.springdox/springdox-swagger-common
@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;
}
代码示例来源:origin: com.mangofactory/swagger-springmvc
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;
}
}
代码示例来源:origin: org.graylog2/graylog2-shared
apiDescription.put("name", info.value());
apiDescription.put("path", path.value());
apiDescription.put("description", info.description());
代码示例来源:origin: rhq-project/rhq
Api api = classElementIn.getAnnotation(Api.class);
if (api!=null) {
String shortDescription = api.value();
setOptionalAttribute(classElement, "shortDesc", shortDescription);
String longDescription = api.description();
代码示例来源:origin: org.restlet.jee/org.restlet.ext.platform
/**
* 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());
}
}
代码示例来源:origin: org.restlet.gae/org.restlet.ext.platform
/**
* 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());
}
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.apispark
/**
* 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());
}
}
代码示例来源:origin: org.restlet.jse/org.restlet.ext.platform
/**
* 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());
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.platform
/**
* 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());
}
}
代码示例来源:origin: jboss-fuse/fabric8
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";
代码示例来源:origin: com.sitewhere/sitewhere-rest
throw new SiteWhereException("Swagger Api annotation missing on documented controller.");
parsed.setResource(api.value());
内容来源于网络,如有侵权,请联系作者删除!