Package it.tidalwave.image.metadata
Class Directory
- java.lang.Object
-
- it.tidalwave.image.metadata.JavaBeanSupport
-
- it.tidalwave.image.metadata.Directory
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
it.tidalwave.image.metadata.EXIFDirectoryGenerated
,it.tidalwave.image.metadata.IPTCDirectoryGenerated
,MakerNote
,XMP
public class Directory extends JavaBeanSupport implements java.io.Serializable
This class provides basic support for all of kind of metadata such EXIF, IPTC or maker notes.- Author:
- Fabrizio Giudici
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class it.tidalwave.image.metadata.JavaBeanSupport
propertyChangeSupport, vetoableChangeSupport
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsTag(int tag)
boolean
equals(java.lang.Object object)
protected static java.lang.String
formatDateTime(java.time.Instant date)
java.time.Instant
getLatestModificationTime()
java.lang.Object
getObject(int tag)
Returns an original tag value (i.e.<T> java.util.Optional<T>
getObject(int tag, java.lang.Class<T> asType)
Returns a tag value converted to the specified type.Directory
getSubDirectory(java.lang.String name)
java.util.Set<java.lang.String>
getSubDirectoryNames()
int[]
getTagCodes()
java.lang.String
getTagName(int tag)
int
hashCode()
boolean
isAvailable()
protected boolean
isSubClass(java.lang.Class aClass, java.lang.String ancestorClassName)
void
loadFromAdapter(DirectoryAdapter adapter)
protected static java.time.Instant
parseDateTime(java.lang.String string)
void
removeTag(int tag)
void
setObject(int tag, java.lang.Object value)
java.lang.String
toString()
java.lang.String
toString(byte[] array)
java.lang.String
toString(Rational[] array)
protected void
touch()
-
Methods inherited from class it.tidalwave.image.metadata.JavaBeanSupport
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Method Detail
-
loadFromAdapter
public void loadFromAdapter(DirectoryAdapter adapter)
-
getTagCodes
public int[] getTagCodes()
-
getSubDirectoryNames
public java.util.Set<java.lang.String> getSubDirectoryNames()
-
getSubDirectory
public Directory getSubDirectory(java.lang.String name)
-
getObject
public java.lang.Object getObject(int tag)
Returns an original tag value (i.e. exactly as it is stored into the file).- Parameters:
tag
- the tag to retrieve- Returns:
- the value
-
getObject
@CheckForNull public <T> java.util.Optional<T> getObject(int tag, @Nonnull java.lang.Class<T> asType)
Returns a tag value converted to the specified type.- Parameters:
tag
- the tag to retrieveasType
- the type to convert the value into- Returns:
- the value
-
setObject
public void setObject(int tag, java.lang.Object value)
-
containsTag
public boolean containsTag(int tag)
- Parameters:
tag
-- Returns:
-
removeTag
public void removeTag(int tag)
- Parameters:
tag
-
-
getTagName
@Nonnull public java.lang.String getTagName(int tag)
- Parameters:
tag
-- Returns:
-
getLatestModificationTime
public java.time.Instant getLatestModificationTime()
-
isAvailable
public boolean isAvailable()
-
touch
protected void touch()
-
toString
@Nonnull public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(byte[] array)
- Parameters:
array
-- Returns:
-
equals
public final boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString(Rational[] array)
- Parameters:
array
-- Returns:
-
isSubClass
protected boolean isSubClass(java.lang.Class aClass, java.lang.String ancestorClassName)
- Returns:
-
formatDateTime
protected static java.lang.String formatDateTime(java.time.Instant date)
-
parseDateTime
protected static java.time.Instant parseDateTime(java.lang.String string)
-
-