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  Map<String,Object> propMap
           
 
Fields inherited from class org.apache.chemistry.opencmis.client.mapper.AbstractPropertyMapper
cmisTypeId, contentTypes, dateFormat, propPrefix
 
Constructor Summary
PropertyMapperExif()
           
 
Method Summary
 Object convertValue(com.drew.metadata.Directory dir, com.drew.metadata.Tag tag, PropertyType propType)
           
 Object convertValue(String id, PropertyDefinition<?> propDef, String strValue)
          Convert a value parsed from the file to the type the corresponding property expects
 Map<String,Object> getMappedProperties()
           
 String getMappedPropertyId(String key)
          return the CMIS property id for a found tag in a file
 String getMappedTypeId(String mimeType)
           
 boolean initialize(String cfgPrefix, String typeKey, 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 Map<String,Object> propMap
Constructor Detail

PropertyMapperExif

public PropertyMapperExif()
Method Detail

initialize

public boolean initialize(String cfgPrefix,
                          String typeKey,
                          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 Map<String,Object> getMappedProperties()

getMappedTypeId

public String getMappedTypeId(String mimeType)

getMappedPropertyId

public String getMappedPropertyId(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 Object convertValue(String id,
                           PropertyDefinition<?> propDef,
                           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 Object convertValue(com.drew.metadata.Directory dir,
                           com.drew.metadata.Tag tag,
                           PropertyType propType)


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