Package com.drew.metadata
Class TagDescriptor<T extends Directory>
- java.lang.Object
-
- com.drew.metadata.TagDescriptor<T>
-
- Direct Known Subclasses:
AdobeJpegDescriptor,AppleMakernoteDescriptor,AppleRunTimeMakernoteDescriptor,AviDescriptor,BmpHeaderDescriptor,CanonMakernoteDescriptor,CasioType1MakernoteDescriptor,CasioType2MakernoteDescriptor,EpsDescriptor,ExifDescriptorBase,FileSystemDescriptor,FileTypeDescriptor,FujifilmMakernoteDescriptor,GifAnimationDescriptor,GifCommentDescriptor,GifControlDescriptor,GifHeaderDescriptor,GifImageDescriptor,GpsDescriptor,HeifDescriptor,HuffmanTablesDescriptor,IccDescriptor,IcoDescriptor,IptcDescriptor,JfifDescriptor,JfxxDescriptor,JpegCommentDescriptor,JpegDescriptor,KodakMakernoteDescriptor,KyoceraMakernoteDescriptor,LeicaMakernoteDescriptor,LeicaType5MakernoteDescriptor,Mp3Descriptor,Mp4Descriptor,Mp4HintDescriptor,Mp4MetaDescriptor,Mp4SoundDescriptor,Mp4TextDescriptor,Mp4UuidBoxDescriptor,Mp4VideoDescriptor,NikonType1MakernoteDescriptor,NikonType2MakernoteDescriptor,OlympusCameraSettingsMakernoteDescriptor,OlympusEquipmentMakernoteDescriptor,OlympusFocusInfoMakernoteDescriptor,OlympusImageProcessingMakernoteDescriptor,OlympusMakernoteDescriptor,OlympusRawDevelopment2MakernoteDescriptor,OlympusRawDevelopmentMakernoteDescriptor,OlympusRawInfoMakernoteDescriptor,PanasonicMakernoteDescriptor,PanasonicRawDistortionDescriptor,PanasonicRawIFD0Descriptor,PanasonicRawWbInfo2Descriptor,PanasonicRawWbInfoDescriptor,PcxDescriptor,PentaxMakernoteDescriptor,PhotoshopDescriptor,PngDescriptor,PrintIMDescriptor,PsdHeaderDescriptor,QuickTimeDescriptor,ReconyxHyperFire2MakernoteDescriptor,ReconyxHyperFireMakernoteDescriptor,ReconyxUltraFireMakernoteDescriptor,RicohMakernoteDescriptor,SamsungType2MakernoteDescriptor,SanyoMakernoteDescriptor,SigmaMakernoteDescriptor,SonyType1MakernoteDescriptor,SonyType6MakernoteDescriptor,WavDescriptor,WebpDescriptor,XmpDescriptor
public class TagDescriptor<T extends Directory> extends java.lang.ObjectBase class for all tag descriptor classes. Implementations are responsible for providing the human-readable string representation of tag values stored in a directory. The directory is provided to the tag descriptor via its constructor.
-
-
Field Summary
Fields Modifier and Type Field Description protected T_directory
-
Constructor Summary
Constructors Constructor Description TagDescriptor(T directory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringconvertBytesToVersionString(int[] components, int majorDigits)Takes a series of 4 bytes from the specified offset, and converts these to a well-known version number, where possible.protected java.lang.Stringget7BitStringFromBytes(int tagType)protected java.lang.StringgetBitFlagDescription(int tagType, java.lang.Object... labels)LSB first.protected java.lang.StringgetByteLengthDescription(int tagType)protected java.lang.StringgetDecimalRational(int tagType, int decimalPlaces)java.lang.StringgetDescription(int tagType)Returns a descriptive value of the specified tag for this image.protected java.lang.StringgetEncodedTextDescription(int tagType)protected java.lang.StringgetEpochTimeDescription(int tagType)protected static java.lang.StringgetFocalLengthDescription(double mm)protected java.lang.StringgetFormattedFloat(int tagType, java.lang.String format)protected java.lang.StringgetFormattedInt(int tagType, java.lang.String format)protected java.lang.StringgetFormattedString(int tagType, java.lang.String format)protected static java.lang.StringgetFStopDescription(double fStop)protected java.lang.StringgetIndexedDescription(int tagType, int baseIndex, java.lang.String... descriptions)protected java.lang.StringgetIndexedDescription(int tagType, java.lang.String... descriptions)protected java.lang.StringgetLensSpecificationDescription(int tag)protected java.lang.StringgetOrientationDescription(int tag)protected java.lang.StringgetRationalOrDoubleString(int tagType)protected java.lang.StringgetShutterSpeedDescription(int tag)protected java.lang.StringgetSimpleRational(int tagType)protected java.lang.StringgetStringFromBytes(int tag, java.nio.charset.Charset cs)protected java.lang.StringgetVersionBytesDescription(int tagType, int majorDigits)
-
-
-
Constructor Detail
-
TagDescriptor
public TagDescriptor(T directory)
-
-
Method Detail
-
getDescription
public java.lang.String getDescription(int tagType)
Returns a descriptive value of the specified tag for this image. Where possible, known values will be substituted here in place of the raw tokens actually kept in the metadata segment. If no substitution is available, the value provided bygetString(tagType)will be returned.- Parameters:
tagType- the tag to find a description for- Returns:
- a description of the image's value for the specified tag, or
nullif the tag hasn't been defined.
-
convertBytesToVersionString
public static java.lang.String convertBytesToVersionString(int[] components, int majorDigits)Takes a series of 4 bytes from the specified offset, and converts these to a well-known version number, where possible.Two different formats are processed:
- [30 32 31 30] -> 2.10
- [0 1 0 0] -> 1.00
- Parameters:
components- the four version valuesmajorDigits- the number of components to be- Returns:
- the version as a string of form "2.10" or null if the argument cannot be converted
-
getVersionBytesDescription
protected java.lang.String getVersionBytesDescription(int tagType, int majorDigits)
-
getIndexedDescription
protected java.lang.String getIndexedDescription(int tagType, java.lang.String... descriptions)
-
getIndexedDescription
protected java.lang.String getIndexedDescription(int tagType, int baseIndex, java.lang.String... descriptions)
-
getByteLengthDescription
protected java.lang.String getByteLengthDescription(int tagType)
-
getSimpleRational
protected java.lang.String getSimpleRational(int tagType)
-
getDecimalRational
protected java.lang.String getDecimalRational(int tagType, int decimalPlaces)
-
getFormattedInt
protected java.lang.String getFormattedInt(int tagType, java.lang.String format)
-
getFormattedFloat
protected java.lang.String getFormattedFloat(int tagType, java.lang.String format)
-
getFormattedString
protected java.lang.String getFormattedString(int tagType, java.lang.String format)
-
getEpochTimeDescription
protected java.lang.String getEpochTimeDescription(int tagType)
-
getBitFlagDescription
protected java.lang.String getBitFlagDescription(int tagType, java.lang.Object... labels)LSB first. Labels may be null, a String, or a String[2] with (low label,high label) values.
-
get7BitStringFromBytes
protected java.lang.String get7BitStringFromBytes(int tagType)
-
getStringFromBytes
protected java.lang.String getStringFromBytes(int tag, java.nio.charset.Charset cs)
-
getRationalOrDoubleString
protected java.lang.String getRationalOrDoubleString(int tagType)
-
getFStopDescription
protected static java.lang.String getFStopDescription(double fStop)
-
getFocalLengthDescription
protected static java.lang.String getFocalLengthDescription(double mm)
-
getLensSpecificationDescription
protected java.lang.String getLensSpecificationDescription(int tag)
-
getOrientationDescription
protected java.lang.String getOrientationDescription(int tag)
-
getShutterSpeedDescription
protected java.lang.String getShutterSpeedDescription(int tag)
-
getEncodedTextDescription
protected java.lang.String getEncodedTextDescription(int tagType)
-
-