private String mapToString(Tag tag) { String name = tag.getName(); String description = tag.getDescription(); if (isNotBlank(description)) { return name + COLON + description; } else { return name; } }
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 }
String description = tag.getDescription(); if (StringUtils.isNotBlank(description)) { markupDocBuilder.paragraph(description);
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()); } } } }
private String mapToString(Tag tag) { String name = tag.getName(); String description = tag.getDescription(); if (isNotBlank(description)) { return name + COLON + description; } else { return name; } }
@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(); }
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()); } }
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(); }
/** * 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; }
/** * 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; }
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; }
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; }
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; }
swagger.addDefinition(modelTag.getName(), model); if (!Strings.isNullOrEmpty(modelTag.getDescription())) { model.setDescription(modelTag.getDescription());
String description = tag.getDescription(); if (StringUtils.isNotBlank(description)) { markupDocBuilder.paragraph(description);
swagger.addDefinition(modelTag.getName(), model); if (!Strings.isNullOrEmpty(modelTag.getDescription())) { model.setDescription(modelTag.getDescription());
String _description = null; if (_modelTag!=null) { _description=_modelTag.getDescription();
property.setDescription(headerTag.getDescription()); response.addHeader(property.getName(), property);
property.setDescription(headerTag.getDescription()); response.addHeader(property.getName(), property);
String _description = null; if (_modelTag!=null) { _description=_modelTag.getDescription();