magoffin.matt.meta.image
Class PNGMetadataResource

java.lang.Object
  extended by magoffin.matt.meta.support.AbstractMetadataResource
      extended by magoffin.matt.meta.support.AbstractEnumMetadataResource<ImageMetadataType>
          extended by magoffin.matt.meta.image.PNGMetadataResource
All Implemented Interfaces:
MetadataResource

public class PNGMetadataResource
extends AbstractEnumMetadataResource<ImageMetadataType>
implements MetadataResource

MetadataResource for PNG images.

The following text chunk keywords are recognized (in each case only the first occurance of the chunk with the specified keyword is used):

Title
The ImageMetadataType.TITLE.
Description
The ImageMetadataType.COMMENT.
Creation Time
Parsed as ImageMetadataType.DATE_TAKEN using the getDateFormat() date format, which defaults to DEFAULT_PNG_DATE_FORMAT.

Version:
$Revision: 3 $ $Date: 2008-12-27 08:09:28 +1300 (Sat, 27 Dec 2008) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
static java.lang.String DEFAULT_PNG_DATE_FORMAT
          The default date format for PNG dates.
static java.lang.String PNG_MIME
          The PNG MIME type.
 
Fields inherited from class magoffin.matt.meta.support.AbstractMetadataResource
log
 
Constructor Summary
PNGMetadataResource(java.io.InputStream in)
          Constructor.
 
Method Summary
 java.lang.String getDateFormat()
           
 javax.xml.xpath.XPathFactory getXpathFactory()
           
 void setDateFormat(java.lang.String dateFormat)
           
 void setXpathFactory(javax.xml.xpath.XPathFactory xpathFactory)
           
 
Methods inherited from class magoffin.matt.meta.support.AbstractEnumMetadataResource
addError, addValue, getValue, getValues, setValue, setValues
 
Methods inherited from class magoffin.matt.meta.support.AbstractMetadataResource
addError, addValue, clearValues, getParsedKeys, getParseErrors, getValue, getValueList, getValues, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface magoffin.matt.meta.MetadataResource
getParsedKeys, getParseErrors, getValue, getValues
 

Field Detail

PNG_MIME

public static final java.lang.String PNG_MIME
The PNG MIME type.

See Also:
Constant Field Values

DEFAULT_PNG_DATE_FORMAT

public static final java.lang.String DEFAULT_PNG_DATE_FORMAT
The default date format for PNG dates.

See Also:
Constant Field Values
Constructor Detail

PNGMetadataResource

public PNGMetadataResource(java.io.InputStream in)
Constructor.

Parameters:
in - the input stream to the PNG data
Method Detail

getXpathFactory

public javax.xml.xpath.XPathFactory getXpathFactory()
Returns:
the xpathFactory

setXpathFactory

public void setXpathFactory(javax.xml.xpath.XPathFactory xpathFactory)
Parameters:
xpathFactory - the xpathFactory to set

getDateFormat

public java.lang.String getDateFormat()
Returns:
the dateFormat

setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Parameters:
dateFormat - the dateFormat to set