org.apache.chemistry.opencmis.client.parser
Interface MetadataParser

All Known Implementing Classes:
AbstractMetadataParser, MetadataParserExif, MetadataParserTika

public interface MetadataParser

This interface is used to extract metadata from content. An instance is responsible to parse the content and extract the metadata. The metadata must be stored in a CMIS property bag. Implementations of this class are created by the Configurator depending on the Content-Type to parse and the corresponding parser configuration

Author:
Jens

Method Summary
 void extractMetadata(File f, TypeDefinition td)
          Parse a file and extract all metadata and store them in a CMIS property bag
 Map<String,Object> getCmisProperties()
          Return all found metadata, called after parsing is completed.
 String[] getContentTypes()
          get all content types handled by this parser
 String getMappedTypeId()
          get the CMIS type id used by this type
 PropertyMapper getMapper()
          get the associated property mapper for this CMIS type
 void initialize(PropertyMapper mapper, String contentType)
          Initialize a parser with a given property mapper and a content type
 void reset()
          get ready for parsing a new file
 

Method Detail

initialize

void initialize(PropertyMapper mapper,
                String contentType)
Initialize a parser with a given property mapper and a content type

Parameters:
mapper - PropertyMapper used to map tags to properties and convert values
contentType - content type of file to extract

reset

void reset()
get ready for parsing a new file


extractMetadata

void extractMetadata(File f,
                     TypeDefinition td)
                     throws MapperException
Parse a file and extract all metadata and store them in a CMIS property bag

Parameters:
f - file to parse
Throws:
MapperException

getCmisProperties

Map<String,Object> getCmisProperties()
Return all found metadata, called after parsing is completed.

Returns:
extracted CMIS properties

getContentTypes

String[] getContentTypes()
get all content types handled by this parser

Returns:
array with content types

getMappedTypeId

String getMappedTypeId()
get the CMIS type id used by this type

Returns:
CMIS type id

getMapper

PropertyMapper getMapper()
get the associated property mapper for this CMIS type

Returns:
property mapper


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