|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tika.metadata.Metadata
org.apache.tika.xmp.XMPMetadata
public class XMPMetadata
Provides a conversion of the Metadata map from Tika to the XMP data model by also providing the Metadata API for clients to ease transition. But clients can also work directly on the XMP data model, by getting the XMPMeta reference from this class. Usually the instance would be initialized by providing the Metadata object that had been returned from Tika-core which populates the XMP data model with all properties that can be converted. This class is not serializable!
| Field Summary |
|---|
| Fields inherited from class org.apache.tika.metadata.Metadata |
|---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRIPTION, FORMAT, IDENTIFIER, LANGUAGE, MODIFIED, NAMESPACE_PREFIX_DELIMITER, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
| Fields inherited from interface org.apache.tika.metadata.CreativeCommons |
|---|
LICENSE_LOCATION, LICENSE_URL, WORK_TYPE |
| Fields inherited from interface org.apache.tika.metadata.Geographic |
|---|
ALTITUDE, LATITUDE, LONGITUDE |
| Fields inherited from interface org.apache.tika.metadata.HttpHeaders |
|---|
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, LAST_MODIFIED, LOCATION |
| Fields inherited from interface org.apache.tika.metadata.Message |
|---|
MESSAGE_BCC, MESSAGE_CC, MESSAGE_FROM, MESSAGE_RECIPIENT_ADDRESS, MESSAGE_TO |
| Fields inherited from interface org.apache.tika.metadata.MSOffice |
|---|
APPLICATION_NAME, APPLICATION_VERSION, AUTHOR, CATEGORY, CHARACTER_COUNT, CHARACTER_COUNT_WITH_SPACES, COMMENTS, COMPANY, CONTENT_STATUS, CREATION_DATE, EDIT_TIME, IMAGE_COUNT, KEYWORDS, LAST_AUTHOR, LAST_PRINTED, LAST_SAVED, LINE_COUNT, MANAGER, NOTES, OBJECT_COUNT, PAGE_COUNT, PARAGRAPH_COUNT, PRESENTATION_FORMAT, REVISION_NUMBER, SECURITY, SLIDE_COUNT, TABLE_COUNT, TEMPLATE, TOTAL_TIME, USER_DEFINED_METADATA_NAME_PREFIX, VERSION, WORD_COUNT |
| Fields inherited from interface org.apache.tika.metadata.ClimateForcast |
|---|
ACKNOWLEDGEMENT, COMMAND_LINE, COMMENT, CONTACT, CONVENTIONS, EXPERIMENT_ID, HISTORY, INSTITUTION, MODEL_NAME_ENGLISH, PROGRAM_ID, PROJECT_ID, REALIZATION, REFERENCES, TABLE_ID |
| Fields inherited from interface org.apache.tika.metadata.TIFF |
|---|
BITS_PER_SAMPLE, EQUIPMENT_MAKE, EQUIPMENT_MODEL, EXPOSURE_TIME, F_NUMBER, FLASH_FIRED, FOCAL_LENGTH, IMAGE_LENGTH, IMAGE_WIDTH, ISO_SPEED_RATINGS, ORIENTATION, ORIGINAL_DATE, RESOLUTION_HORIZONTAL, RESOLUTION_UNIT, RESOLUTION_VERTICAL, SAMPLES_PER_PIXEL, SOFTWARE |
| Fields inherited from interface org.apache.tika.metadata.TikaMetadataKeys |
|---|
PROTECTED, RESOURCE_NAME_KEY |
| Fields inherited from interface org.apache.tika.metadata.TikaMimeKeys |
|---|
MIME_TYPE_MAGIC, TIKA_MIME_FILE |
| Constructor Summary | |
|---|---|
XMPMetadata()
Initializes with an empty XMP packet |
|
XMPMetadata(Metadata meta)
|
|
XMPMetadata(Metadata meta,
String mimetype)
Initializes the data by converting the Metadata information to XMP. |
|
| Method Summary | |
|---|---|
void |
add(String name,
String value)
As this API could only possibly work for simple properties in XMP, it just calls the set method, which replaces any existing value |
static void |
deleteNamespace(String namespaceURI)
Deletes a namespace from the registry. |
boolean |
equals(Object o)
This method is not implemented, yet. |
String |
get(Property property)
Returns the value (if any) of the identified metadata property. |
String |
get(String name)
Returns the value of a simple property or the first one of an array. |
Date |
getDate(Property property)
Returns the value of the identified Date based metadata property. |
Integer |
getInt(Property property)
Returns the value of the identified Integer based metadata property. |
static String |
getNamespacePrefix(String namespaceURI)
Obtain the prefix for a registered namespace URI. |
static Map<String,String> |
getNamespaces()
|
static String |
getNamespaceURI(String namespacePrefix)
Obtain the URI for a registered namespace prefix. |
static Map<String,String> |
getPrefixes()
|
String[] |
getValues(Property property)
Get the values associated to a metadata name. |
String[] |
getValues(String name)
Returns the value of a simple property or all if the property is an array and the elements are of simple type. |
com.adobe.xmp.XMPMeta |
getXMPData()
Provides direct access to the XMP data model, in case a client prefers to work directly on it instead of using the Metadata API |
boolean |
isMultiValued(Property property)
Returns true if named value is multivalued. |
boolean |
isMultiValued(String name)
Checks if the named property is an array. |
String[] |
names()
For XMP it is not clear what that API should return, therefor not implemented |
void |
process(Metadata meta)
|
void |
process(Metadata meta,
String mimetype)
Converts the Metadata information to XMP. |
static String |
registerNamespace(String namespaceURI,
String suggestedPrefix)
Register a namespace URI with a suggested prefix. |
void |
remove(Property property)
|
void |
remove(String name)
Removes the given property from the XMP data. |
void |
set(Property property,
Date date)
Sets the date value of the identified metadata property. |
void |
set(Property property,
double value)
Sets the real or rational value of the identified metadata property. |
void |
set(Property property,
int value)
Sets the integer value of the identified metadata property. |
void |
set(Property property,
String value)
Sets the value of the identified metadata property. |
void |
set(Property property,
String[] values)
Sets array properties. |
void |
set(String name,
String value)
Sets the given property. |
void |
setAll(Properties properties)
It will set all simple and array properties that have QName keys in registered namespaces. |
int |
size()
Returns the number of top-level namespaces |
String |
toString()
Serializes the XMP data in compact form without packet wrapper |
| Methods inherited from class org.apache.tika.metadata.Metadata |
|---|
add |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XMPMetadata()
public XMPMetadata(Metadata meta)
throws TikaException
TikaExceptionBut the mimetype is retrieved from the metadata map.
public XMPMetadata(Metadata meta,
String mimetype)
throws TikaException
meta - the Metadata information from Tika-coremimetype - mimetype information
In - case an error occured during conversion
TikaException| Method Detail |
|---|
public void process(Metadata meta)
throws TikaException
TikaExceptionBut the mimetype is retrieved from the metadata map.
public void process(Metadata meta,
String mimetype)
throws TikaException
meta - the Metadata information from Tika-coremimetype - mimetype information
In - case an error occured during conversion
TikaExceptionpublic com.adobe.xmp.XMPMeta getXMPData()
public static String registerNamespace(String namespaceURI,
String suggestedPrefix)
throws com.adobe.xmp.XMPException
namespaceURI - The URI for the namespace. Must be a valid XML URI.suggestedPrefix - The suggested prefix to be used if the URI is not yet registered. Must be a valid
XML name.
com.adobe.xmp.XMPException - If the parameters are not accordingly setpublic static String getNamespacePrefix(String namespaceURI)
namespaceURI - The URI for the namespace. Must not be null or the empty string.
public static String getNamespaceURI(String namespacePrefix)
namespacePrefix - The prefix for the namespace. Must not be null or the empty string.
public static Map<String,String> getNamespaces()
public static Map<String,String> getPrefixes()
public static void deleteNamespace(String namespaceURI)
Does nothing if the URI is not registered, or if the namespaceURI parameter is null or the empty string.
Note: Not yet implemented.
namespaceURI - The URI for the namespace.public boolean isMultiValued(Property property)
Metadata
isMultiValued in class Metadataproperty - metadata property
isMultiValued(java.lang.String)public boolean isMultiValued(String name)
isMultiValued in class Metadataname - name of metadata
Metadata.isMultiValued(java.lang.String)public String[] names()
names in class Metadatapublic String get(String name)
get in class Metadataname - of the metadata.
Metadata.get(java.lang.String)public String get(Property property)
Metadata
get in class Metadataproperty - property definition
null if the property is not setget(java.lang.String)public Integer getInt(Property property)
Metadata
getInt in class Metadataproperty - simple integer property definition
null if the property is not set, or not a valid Integerget(java.lang.String)public Date getDate(Property property)
Metadata
getDate in class Metadataproperty - simple date property definition
null if the property is not set, or not a valid Dateget(java.lang.String)public String[] getValues(Property property)
Metadata
getValues in class Metadataproperty - of the metadata.
getValues(java.lang.String)public String[] getValues(String name)
getValues in class Metadataname - of the metadata.
Metadata.getValues(java.lang.String)
public void add(String name,
String value)
add in class Metadataname - the metadata name.value - the metadata value.Metadata.add(java.lang.String, java.lang.String)
public void set(String name,
String value)
set in class Metadataname - the metadata name.value - the metadata value.Metadata.set(java.lang.String, java.lang.String)
public void set(Property property,
String value)
Metadata
set in class Metadataproperty - property definitionvalue - property valueset(java.lang.String, java.lang.String)
public void set(Property property,
int value)
Metadata
set in class Metadataproperty - simple integer property definitionvalue - property valueset(java.lang.String, java.lang.String)
public void set(Property property,
double value)
Metadata
set in class Metadataproperty - simple real or simple rational property definitionvalue - property valueset(java.lang.String, java.lang.String)
public void set(Property property,
Date date)
Metadata
set in class Metadataproperty - simple integer property definitiondate - property valueset(java.lang.String, java.lang.String)
public void set(Property property,
String[] values)
set in class Metadataproperty - property definitionvalues - property valuesMetadata.set(org.apache.tika.metadata.Property,
java.lang.String[])public void setAll(Properties properties)
setAll in class Metadataproperties - properties to copy fromMetadata.setAll(java.util.Properties)public void remove(Property property)
remove(java.lang.String)public void remove(String name)
remove in class Metadataname - metadata name to removeMetadata.remove(java.lang.String)public int size()
size in class Metadatapublic boolean equals(Object o)
equals in class Metadatapublic String toString()
toString in class MetadataMetadata.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||