Package org.apache.tika.xmp.convert
Class AbstractConverter
- java.lang.Object
- 
- org.apache.tika.xmp.convert.AbstractConverter
 
- 
- All Implemented Interfaces:
- ITikaToXMPConverter
 - Direct Known Subclasses:
- GenericConverter,- MSOfficeBinaryConverter,- MSOfficeXMLConverter,- OpenDocumentConverter,- RTFConverter
 
 public abstract class AbstractConverter extends Object implements ITikaToXMPConverter Base class for Tika Metadata to XMP converter which provides some needed common functionality.
- 
- 
Field SummaryFields Modifier and Type Field Description protected com.adobe.internal.xmp.XMPMetameta
 - 
Constructor SummaryConstructors Constructor Description AbstractConverter()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcreateArrayProperty(String tikaKey, String ns, String propertyName, int arrayType)Creates an array property from a list of values.protected voidcreateArrayProperty(Property metadataProperty, String nsDc, String arrayProperty, int arrayType)protected voidcreateCommaSeparatedArray(String tikaKey, String ns, String propertyName, int arrayType)Creates an array property from a comma separated list.protected voidcreateCommaSeparatedArray(Property metadataProperty, String nsDc, String arrayProperty, int arrayType)protected voidcreateLangAltProperty(String tikaKey, String ns, String propertyName)Creates a language alternative property in the x-default languageprotected voidcreateLangAltProperty(Property metadataProperty, String ns, String propertyName)protected voidcreateProperty(String tikaKey, String ns, String propertyName)Creates a simple property.protected voidcreateProperty(Property metadataProperty, String ns, String propertyName)protected abstract Set<Namespace>getAdditionalNamespaces()Every Converter has to provide information about namespaces that are used additionally to the core set of XMP namespaces.com.adobe.internal.xmp.XMPMetagetXMPMeta()abstract com.adobe.internal.xmp.XMPMetaprocess(Metadata metadata)Converts a TikaMetadata-object into anXMPMetacontaining the useful properties.protected voidregisterNamespaces(Set<Namespace> namespaces)Registers a numberNamespaceinformation with XMPCore.voidsetMetadata(Metadata metadata)
 
- 
- 
- 
Constructor Detail- 
AbstractConverterpublic AbstractConverter() throws TikaException- Throws:
- TikaException
 
 
- 
 - 
Method Detail- 
processpublic abstract com.adobe.internal.xmp.XMPMeta process(Metadata metadata) throws com.adobe.internal.xmp.XMPException Description copied from interface:ITikaToXMPConverterConverts a TikaMetadata-object into anXMPMetacontaining the useful properties.- Specified by:
- processin interface- ITikaToXMPConverter
- Parameters:
- metadata- a Tika Metadata object
- Returns:
- Returns an XMPMeta object.
- Throws:
- com.adobe.internal.xmp.XMPException- If an error occurs during the creation of the XMP object.
 
 - 
getAdditionalNamespacesprotected abstract Set<Namespace> getAdditionalNamespaces() Every Converter has to provide information about namespaces that are used additionally to the core set of XMP namespaces.- Returns:
- the additional namespace information
 
 - 
setMetadatapublic void setMetadata(Metadata metadata) 
 - 
getXMPMetapublic com.adobe.internal.xmp.XMPMeta getXMPMeta() 
 - 
registerNamespacesprotected void registerNamespaces(Set<Namespace> namespaces) throws TikaException Registers a numberNamespaceinformation with XMPCore. Any already registered namespace is not registered again.- Parameters:
- namespaces- the list of namespaces to be registered
- Throws:
- TikaException- in case a namespace oculd not be registered
 
 - 
createPropertyprotected void createProperty(Property metadataProperty, String ns, String propertyName) throws com.adobe.internal.xmp.XMPException - Throws:
- com.adobe.internal.xmp.XMPException
- See Also:
- createProperty(String, String, String)
 
 - 
createPropertyprotected void createProperty(String tikaKey, String ns, String propertyName) throws com.adobe.internal.xmp.XMPException Creates a simple property.- Parameters:
- tikaKey- Key in the Tika metadata map
- ns- namespace the property should be created in
- propertyName- name of the property
- Throws:
- com.adobe.internal.xmp.XMPException- if the property could not be created
 
 - 
createLangAltPropertyprotected void createLangAltProperty(Property metadataProperty, String ns, String propertyName) throws com.adobe.internal.xmp.XMPException - Throws:
- com.adobe.internal.xmp.XMPException
- See Also:
- createLangAltProperty(String, String, String)
 
 - 
createLangAltPropertyprotected void createLangAltProperty(String tikaKey, String ns, String propertyName) throws com.adobe.internal.xmp.XMPException Creates a language alternative property in the x-default language- Parameters:
- tikaKey- Key in the Tika metadata map
- ns- namespace the property should be created in
- propertyName- name of the property
- Throws:
- com.adobe.internal.xmp.XMPException- if the property could not be created
 
 - 
createArrayPropertyprotected void createArrayProperty(Property metadataProperty, String nsDc, String arrayProperty, int arrayType) throws com.adobe.internal.xmp.XMPException - Throws:
- com.adobe.internal.xmp.XMPException
 
 - 
createArrayPropertyprotected void createArrayProperty(String tikaKey, String ns, String propertyName, int arrayType) throws com.adobe.internal.xmp.XMPException Creates an array property from a list of values.- Parameters:
- tikaKey- Key in the Tika metadata map
- ns- namespace the property should be created in
- propertyName- name of the property
- arrayType- depicts which kind of array shall be created
- Throws:
- com.adobe.internal.xmp.XMPException- if the property could not be created
 
 - 
createCommaSeparatedArrayprotected void createCommaSeparatedArray(Property metadataProperty, String nsDc, String arrayProperty, int arrayType) throws com.adobe.internal.xmp.XMPException - Throws:
- com.adobe.internal.xmp.XMPException
 
 - 
createCommaSeparatedArrayprotected void createCommaSeparatedArray(String tikaKey, String ns, String propertyName, int arrayType) throws com.adobe.internal.xmp.XMPException Creates an array property from a comma separated list.- Parameters:
- tikaKey- Key in the Tika metadata map
- ns- namespace the property should be created in
- propertyName- name of the property
- arrayType- depicts which kind of array shall be created
- Throws:
- com.adobe.internal.xmp.XMPException- if the property could not be created
 
 
- 
 
-