Package gov.nih.mipav.model.file
Class MetadataExtractor.Tag
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.Tag
-
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.Tag extends java.lang.Object
Models a particular tag within acom.drew.metadata.Directory
and provides methods for obtaining its value. Immutable.- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
Fields Modifier and Type Field Description private MetadataExtractor.Directory
_directory
private int
_tagType
-
Constructor Summary
Constructors Constructor Description Tag(int tagType, MetadataExtractor.Directory directory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Get a description of the tag's value, considering enumerated values and units.java.lang.String
getDirectoryName()
Get the name of thecom.drew.metadata.Directory
in which the tag exists, such asExif
,GPS
orInteroperability
.java.lang.String
getTagName()
Get the name of the tag, such asAperture
, orInteropVersion
.int
getTagType()
Gets the tag type as an intjava.lang.String
getTagTypeHex()
Gets the tag type in hex notation as a String with padded leading zeroes if necessary (i.e.boolean
hasTagName()
Get whether this tag has a name.java.lang.String
toString()
A basic representation of the tag's type and value.
-
-
-
Field Detail
-
_tagType
private final int _tagType
-
_directory
private final MetadataExtractor.Directory _directory
-
-
Constructor Detail
-
Tag
public Tag(int tagType, MetadataExtractor.Directory directory)
-
-
Method Detail
-
getTagType
public int getTagType()
Gets the tag type as an int- Returns:
- the tag type as an int
-
getTagTypeHex
public java.lang.String getTagTypeHex()
Gets the tag type in hex notation as a String with padded leading zeroes if necessary (i.e.0x100e
).- Returns:
- the tag type as a string in hexadecimal notation
-
getDescription
public java.lang.String getDescription()
Get a description of the tag's value, considering enumerated values and units.- Returns:
- a description of the tag's value
-
hasTagName
public boolean hasTagName()
Get whether this tag has a name. Iftrue
, it may be accessed viagetTagName()
. Iffalse
,getTagName()
will return a string resembling"Unknown tag (0x1234)"
.- Returns:
- whether this tag has a name
-
getTagName
public java.lang.String getTagName()
Get the name of the tag, such asAperture
, orInteropVersion
.- Returns:
- the tag's name
-
getDirectoryName
public java.lang.String getDirectoryName()
Get the name of thecom.drew.metadata.Directory
in which the tag exists, such asExif
,GPS
orInteroperability
.- Returns:
- name of the
com.drew.metadata.Directory
in which this tag exists
-
toString
public java.lang.String toString()
A basic representation of the tag's type and value. EG:[Exif IFD0] FNumber - f/2.8
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the tag's type and value
-
-