org.apache.chemistry.opencmis.client.mapper
Class PropertyMapperExif

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.mapper.AbstractPropertyMapper
      extended by org.apache.chemistry.opencmis.client.mapper.PropertyMapperExif
All Implemented Interfaces:
PropertyMapper

public class PropertyMapperExif
extends AbstractPropertyMapper


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> propMap
           
 
Fields inherited from class org.apache.chemistry.opencmis.client.mapper.AbstractPropertyMapper
cmisTypeId, contentTypes, dateFormat, propPrefix
 
Constructor Summary
PropertyMapperExif()
           
 
Method Summary
 java.lang.Object convertValue(com.drew.metadata.Directory dir, com.drew.metadata.Tag tag, PropertyType propType)
           
 java.lang.Object convertValue(java.lang.String id, PropertyDefinition<?> propDef, java.lang.String strValue)
          Convert a value parsed from the file to the type the corresponding property expects
 java.util.Map<java.lang.String,java.lang.Object> getMappedProperties()
           
 java.lang.String getMappedPropertyId(java.lang.String key)
          return the CMIS property id for a found tag in a file
 java.lang.String getMappedTypeId(java.lang.String mimeType)
           
 boolean initialize(java.lang.String cfgPrefix, java.lang.String typeKey, java.util.Properties properties)
          initialize a property mapper
 void mapTagAndConvert(com.drew.metadata.Directory dir, com.drew.metadata.Tag tag, TypeDefinition td)
          store the property id mapped to this tag in a JPEG file in a local map
 void reset()
          Reset all internal data to get ready for a new parsing process
 
Methods inherited from class org.apache.chemistry.opencmis.client.mapper.AbstractPropertyMapper
getContentTypes, getMappedTypeId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propMap

protected java.util.Map<java.lang.String,java.lang.Object> propMap
Constructor Detail

PropertyMapperExif

public PropertyMapperExif()
Method Detail

initialize

public boolean initialize(java.lang.String cfgPrefix,
                          java.lang.String typeKey,
                          java.util.Properties properties)
Description copied from interface: PropertyMapper
initialize a property mapper

Specified by:
initialize in interface PropertyMapper
Overrides:
initialize in class AbstractPropertyMapper
Parameters:
cfgPrefix - prefix for all configuration entries in properties file
typeKey - type key in configuration used to identify this type
properties - all properties read from resource mapping.properties
Returns:
true, if processing should continue, false if not

reset

public void reset()
Description copied from interface: PropertyMapper
Reset all internal data to get ready for a new parsing process


getMappedProperties

public java.util.Map<java.lang.String,java.lang.Object> getMappedProperties()

getMappedTypeId

public java.lang.String getMappedTypeId(java.lang.String mimeType)

getMappedPropertyId

public java.lang.String getMappedPropertyId(java.lang.String key)
Description copied from interface: PropertyMapper
return the CMIS property id for a found tag in a file

Parameters:
key - tag (usually parsed from Tika) found in file
Returns:
CMIS property this tag gets mapped to, null if not mapped

convertValue

public java.lang.Object convertValue(java.lang.String id,
                                     PropertyDefinition<?> propDef,
                                     java.lang.String strValue)
Description copied from interface: PropertyMapper
Convert a value parsed from the file to the type the corresponding property expects

Parameters:
id - CMIS property id
strValue - value read from file (Tika always gives a string)
Returns:
converted value conforming to the mapped property

mapTagAndConvert

public void mapTagAndConvert(com.drew.metadata.Directory dir,
                             com.drew.metadata.Tag tag,
                             TypeDefinition td)
store the property id mapped to this tag in a JPEG file in a local map

Parameters:
dir - directory of tag
tag - tag

convertValue

public java.lang.Object convertValue(com.drew.metadata.Directory dir,
                                     com.drew.metadata.Tag tag,
                                     PropertyType propType)


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.