本文整理了Java中io.swagger.models.Tag.getDescription()
方法的一些代码示例,展示了Tag.getDescription()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.getDescription()
方法的具体详情如下:
包路径:io.swagger.models.Tag
类名称:Tag
方法名:getDescription
暂无
代码示例来源:origin: Swagger2Markup/swagger2markup
private String mapToString(Tag tag) {
String name = tag.getName();
String description = tag.getDescription();
if (isNotBlank(description)) {
return name + COLON + description;
} else {
return name;
}
}
代码示例来源:origin: stackoverflow.com
try
{
// Extract metadata.
Metadata metadata = ImageMetadataReader.readMetadata(new BufferedInputStream(new ByteArrayInputStream(imageData)), imageData.length);
// Log each directory.
for(Directory directory : metadata.getDirectories())
{
Log.d("LOG", "Directory: " + directory.getName());
// Log all errors.
for(String error : directory.getErrors())
{
Log.d("LOG", "> error: " + error);
}
// Log all tags.
for(Tag tag : directory.getTags())
{
Log.d("LOG", "> tag: " + tag.getTagName() + " = " + tag.getDescription());
}
}
}
catch(Exception e)
{
// TODO: handle exception
}
代码示例来源:origin: Swagger2Markup/swagger2markup
String description = tag.getDescription();
if (StringUtils.isNotBlank(description)) {
markupDocBuilder.paragraph(description);
代码示例来源:origin: kongchen/swagger-maven-plugin
private void updateTagDescriptions(Map<String, Tag> discoveredTags) {
if (swagger.getTags() != null) {
for (Tag tag : swagger.getTags()) {
Tag rightTag = discoveredTags.get(tag.getName());
if (rightTag != null && rightTag.getDescription() != null) {
tag.setDescription(rightTag.getDescription());
}
}
}
}
代码示例来源:origin: io.github.swagger2markup/swagger2markup
private String mapToString(Tag tag) {
String name = tag.getName();
String description = tag.getDescription();
if (isNotBlank(description)) {
return name + COLON + description;
} else {
return name;
}
}
代码示例来源:origin: io.swagger/swagger-models
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("Tag {\n");
b.append("\tname: ").append(getName()).append("\n");
b.append("\tdescription: ").append(getDescription()).append("\n");
b.append("\texternalDocs: ").append(getExternalDocs()).append("\n");
b.append("\textensions:").append(vendorExtensions.toString());
b.append("}");
return b.toString();
}
代码示例来源:origin: stackoverflow.com
Metadata metadata = ImageMetadataReader.readMetadata(file);
Iterable<Directory> directories = metadata.getDirectories();
Iterator<Directory> iterator = directories.iterator();
while(iterator.hasNext()) {
Directory dir = iterator.next();
Collection<Tag> tags = dir.getTags();
for(Tag tag: tags) {
System.out.println(tag.getTagName() + " " + tag.getDescription() + " " + tag.getTagTypeHex());
}
}
代码示例来源:origin: stackoverflow.com
Metadata header;
try {
ByteArrayInputStream bais= new ByteArrayInputStream(data);
ExifReader reader = new ExifReader(bais);
header = reader.extract();
Iterator<Directory> iter = header.getDirectoryIterator();
while(iter.hasNext()){
Directory d = iter.next();
Iterator<Tag> iterTag = d.getTagIterator();
while(iterTag.hasNext()){
Tag t = iterTag.next();
Log.e("DEBUG", "TAG: " + t.getTagName() + " : " + t.getDescription());
}
}
} catch (JpegProcessingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MetadataException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
代码示例来源:origin: gitblit/fathom
/**
* Returns the Tag for a controller.
*
* @param controllerClass
* @return a controller tag or null
*/
protected Tag getControllerTag(Class<? extends Controller> controllerClass) {
if (controllerClass.isAnnotationPresent(ApiOperations.class)) {
ApiOperations annotation = controllerClass.getAnnotation(ApiOperations.class);
io.swagger.models.Tag tag = new io.swagger.models.Tag();
tag.setName(Optional.fromNullable(Strings.emptyToNull(annotation.tag())).or(controllerClass.getSimpleName()));
tag.setDescription(translate(annotation.descriptionKey(), annotation.description()));
if (!Strings.isNullOrEmpty(annotation.externalDocs())) {
ExternalDocs docs = new ExternalDocs();
docs.setUrl(annotation.externalDocs());
tag.setExternalDocs(docs);
}
if (!Strings.isNullOrEmpty(tag.getDescription())) {
return tag;
}
}
return null;
}
代码示例来源:origin: com.gitblit.fathom/fathom-rest-swagger
/**
* Returns the Tag for a controller.
*
* @param controllerClass
* @return a controller tag or null
*/
protected Tag getControllerTag(Class<? extends Controller> controllerClass) {
if (controllerClass.isAnnotationPresent(ApiOperations.class)) {
ApiOperations annotation = controllerClass.getAnnotation(ApiOperations.class);
io.swagger.models.Tag tag = new io.swagger.models.Tag();
tag.setName(Optional.fromNullable(Strings.emptyToNull(annotation.tag())).or(controllerClass.getSimpleName()));
tag.setDescription(translate(annotation.descriptionKey(), annotation.description()));
if (!Strings.isNullOrEmpty(annotation.externalDocs())) {
ExternalDocs docs = new ExternalDocs();
docs.setUrl(annotation.externalDocs());
tag.setExternalDocs(docs);
}
if (!Strings.isNullOrEmpty(tag.getDescription())) {
return tag;
}
}
return null;
}
代码示例来源:origin: swagger-api/swagger-parser
private List<Tag> convertTags(List<io.swagger.models.Tag> v2tags) {
List<Tag> v3tags = new ArrayList<>();
for (io.swagger.models.Tag v2tag : v2tags) {
Tag v3tag = new Tag();
v3tag.setDescription(v2tag.getDescription());
v3tag.setName(v2tag.getName());
if (v2tag.getExternalDocs() != null) {
v3tag.setExternalDocs(convert(v2tag.getExternalDocs()));
}
Map<String, Object> extensions = convert(v2tag.getVendorExtensions());
if (extensions != null) {
v3tag.setExtensions(extensions);
}
v3tags.add(v3tag);
}
return v3tags;
}
代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v2-converter
private List<Tag> convertTags(List<io.swagger.models.Tag> v2tags) {
List<Tag> v3tags = new ArrayList<>();
for (io.swagger.models.Tag v2tag : v2tags) {
Tag v3tag = new Tag();
v3tag.setDescription(v2tag.getDescription());
v3tag.setName(v2tag.getName());
if (v2tag.getExternalDocs() != null) {
v3tag.setExternalDocs(convert(v2tag.getExternalDocs()));
}
Map<String, Object> extensions = convert(v2tag.getVendorExtensions());
if (extensions != null) {
v3tag.setExtensions(extensions);
}
v3tags.add(v3tag);
}
return v3tags;
}
代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v2-converter
private List<Tag> convertTags(List<io.swagger.models.Tag> v2tags) {
List<Tag> v3tags = new ArrayList<>();
for (io.swagger.models.Tag v2tag : v2tags) {
Tag v3tag = new Tag();
v3tag.setDescription(v2tag.getDescription());
v3tag.setName(v2tag.getName());
if (v2tag.getExternalDocs() != null) {
v3tag.setExternalDocs(convert(v2tag.getExternalDocs()));
}
Map<String, Object> extensions = convert(v2tag.getVendorExtensions());
if (extensions != null) {
v3tag.setExtensions(extensions);
}
v3tags.add(v3tag);
}
return v3tags;
}
代码示例来源:origin: com.gitblit.fathom/fathom-rest-swagger
swagger.addDefinition(modelTag.getName(), model);
if (!Strings.isNullOrEmpty(modelTag.getDescription())) {
model.setDescription(modelTag.getDescription());
代码示例来源:origin: io.github.swagger2markup/swagger2markup
String description = tag.getDescription();
if (StringUtils.isNotBlank(description)) {
markupDocBuilder.paragraph(description);
代码示例来源:origin: gitblit/fathom
swagger.addDefinition(modelTag.getName(), model);
if (!Strings.isNullOrEmpty(modelTag.getDescription())) {
model.setDescription(modelTag.getDescription());
代码示例来源:origin: com.reprezen.genflow/swagger-doc
String _description = null;
if (_modelTag!=null) {
_description=_modelTag.getDescription();
代码示例来源:origin: com.gitblit.fathom/fathom-rest-swagger
property.setDescription(headerTag.getDescription());
response.addHeader(property.getName(), property);
代码示例来源:origin: gitblit/fathom
property.setDescription(headerTag.getDescription());
response.addHeader(property.getName(), property);
代码示例来源:origin: com.reprezen.genflow/swagger-doc
String _description = null;
if (_modelTag!=null) {
_description=_modelTag.getDescription();
内容来源于网络,如有侵权,请联系作者删除!