org.apache.tika.metadata
Class Metadata

java.lang.Object
  extended by org.apache.tika.metadata.Metadata
All Implemented Interfaces:
Serializable, ClimateForcast, CreativeCommons, DublinCore, Geographic, HttpHeaders, IPTC, Message, MSOffice, TIFF, TikaMetadataKeys, TikaMimeKeys

public class Metadata
extends Object
implements CreativeCommons, DublinCore, Geographic, HttpHeaders, IPTC, Message, MSOffice, ClimateForcast, TIFF, TikaMetadataKeys, TikaMimeKeys, Serializable

A multi-valued metadata container.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.tika.metadata.CreativeCommons
LICENSE_LOCATION, LICENSE_URL, WORK_TYPE
 
Fields inherited from interface org.apache.tika.metadata.DublinCore
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRIPTION, FORMAT, IDENTIFIER, LANGUAGE, MODIFIED, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, 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.IPTC
ADDITIONAL_MODEL_INFO, ARTWORK_OR_OBJECT, ARTWORK_OR_OBJECT_DETAIL_COPYRIGHT_NOTICE, ARTWORK_OR_OBJECT_DETAIL_CREATOR, ARTWORK_OR_OBJECT_DETAIL_DATE_CREATED, ARTWORK_OR_OBJECT_DETAIL_SOURCE, ARTWORK_OR_OBJECT_DETAIL_SOURCE_INVENTORY_NUMBER, ARTWORK_OR_OBJECT_DETAIL_TITLE, CITY, CONTACT_INFO_ADDRESS, CONTACT_INFO_CITY, CONTACT_INFO_COUNTRY, CONTACT_INFO_EMAIL, CONTACT_INFO_PHONE, CONTACT_INFO_POSTAL_CODE, CONTACT_INFO_STATE_PROVINCE, CONTACT_INFO_WEB_URL, CONTROLLED_VOCABULARY_TERM, COPYRIGHT_NOTICE, COPYRIGHT_OWNER, COPYRIGHT_OWNER_ID, COPYRIGHT_OWNER_NAME, COUNTRY, COUNTRY_CODE, CREATOR_DCPROPERTY, CREATORS_CONTACT_INFO, CREATORS_JOB_TITLE, CREDIT_LINE, DATE_CREATED, DESCRIPTION_DCPROPERTY, DESCRIPTION_WRITER, DIGITAL_IMAGE_GUID, DIGITAL_SOURCE_FILE_TYPE, DIGITAL_SOURCE_TYPE, EVENT, HEADLINE, IMAGE_CREATOR, IMAGE_CREATOR_ID, IMAGE_CREATOR_NAME, IMAGE_REGISTRY_ENTRY, IMAGE_SUPPLIER, IMAGE_SUPPLIER_ID, IMAGE_SUPPLIER_IMAGE_ID, IMAGE_SUPPLIER_NAME, INSTRUCTIONS, INTELLECTUAL_GENRE, IPTC_LAST_EDITED, JOB_ID, KEYWORDS_DCPROPERTY, LICENSOR, LICENSOR_CITY, LICENSOR_COUNTRY, LICENSOR_EMAIL, LICENSOR_EXTENDED_ADDRESS, LICENSOR_ID, LICENSOR_NAME, LICENSOR_POSTAL_CODE, LICENSOR_REGION, LICENSOR_STREET_ADDRESS, LICENSOR_TELEPHONE_1, LICENSOR_TELEPHONE_2, LICENSOR_URL, LOCATION_CREATED, LOCATION_CREATED_CITY, LOCATION_CREATED_COUNTRY_CODE, LOCATION_CREATED_COUNTRY_NAME, LOCATION_CREATED_PROVINCE_OR_STATE, LOCATION_CREATED_SUBLOCATION, LOCATION_CREATED_WORLD_REGION, LOCATION_SHOWN, LOCATION_SHOWN_CITY, LOCATION_SHOWN_COUNTRY_CODE, LOCATION_SHOWN_COUNTRY_NAME, LOCATION_SHOWN_PROVINCE_OR_STATE, LOCATION_SHOWN_SUBLOCATION, LOCATION_SHOWN_WORLD_REGION, MAX_AVAIL_HEIGHT, MAX_AVAIL_WIDTH, MINOR_MODEL_AGE_DISCLOSURE, MODEL_AGE, MODEL_RELEASE_ID, MODEL_RELEASE_STATUS, NAMESPACE_URI_DC, NAMESPACE_URI_IPTC_CORE, NAMESPACE_URI_IPTC_EXT, NAMESPACE_URI_PHOTOSHOP, NAMESPACE_URI_PLUS, NAMESPACE_URI_XMP_RIGHTS, ORGANISATION_CODE, ORGANISATION_NAME, PERSON, PHOTOSHOP_CATEGORY, PHOTOSHOP_SUPPLEMENTAL_CATEGORIES, PHOTOSHOP_URGENCY, PLUS_VERSION, PREFIX_DC, PREFIX_DELIMITER, PREFIX_IPTC_CORE, PREFIX_IPTC_EXT, PREFIX_PHOTOSHOP, PREFIX_PLUS, PREFIX_XMP_RIGHTS, PROPERTY_GROUP_IPTC_CORE, PROPERTY_GROUP_IPTC_EXT, PROPERTY_RELEASE_ID, PROPERTY_RELEASE_STATUS, PROVINCE_OR_STATE, REGISTRY_ENTRY_CREATED_ITEM_ID, REGISTRY_ENTRY_CREATED_ORGANISATION_ID, RIGHTS_USAGE_TERMS, SCENE_CODE, SOURCE, SUBJECT_CODE, SUBLOCATION, TITLE_DCPROPERTY
 
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, SOURCE, 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
Metadata()
          Constructs a new, empty metadata.
 
Method Summary
 void add(String name, String value)
          Add a metadata name/value mapping.
 boolean equals(Object o)
           
 String get(Property property)
          Returns the value (if any) of the identified metadata property.
 String get(String name)
          Get the value associated to a metadata name.
 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.
 String[] getValues(String name)
          Get the values associated to a metadata name.
 boolean isMultiValued(String name)
          Returns true if named value is multivalued.
 String[] names()
          Returns an array of the names contained in the metadata.
 void remove(String name)
          Remove a metadata and all its associated values.
 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(String name, String value)
          Set metadata name/value.
 void setAll(Properties properties)
          Copy All key-value pairs from properties.
 int size()
          Returns the number of metadata names in this metadata.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Metadata

public Metadata()
Constructs a new, empty metadata.

Method Detail

isMultiValued

public boolean isMultiValued(String name)
Returns true if named value is multivalued.

Parameters:
name - name of metadata
Returns:
true is named value is multivalued, false if single value or null

names

public String[] names()
Returns an array of the names contained in the metadata.

Returns:
Metadata names

get

public String get(String name)
Get the value associated to a metadata name. If many values are assiociated to the specified name, then the first one is returned.

Parameters:
name - of the metadata.
Returns:
the value associated to the specified metadata name.

get

public String get(Property property)
Returns the value (if any) of the identified metadata property.

Parameters:
property - property definition
Returns:
property value, or null if the property is not set
Since:
Apache Tika 0.7

getInt

public Integer getInt(Property property)
Returns the value of the identified Integer based metadata property.

Parameters:
property - simple integer property definition
Returns:
property value as a Integer, or null if the property is not set, or not a valid Integer
Since:
Apache Tika 0.8

getDate

public Date getDate(Property property)
Returns the value of the identified Date based metadata property.

Parameters:
property - simple date property definition
Returns:
property value as a Date, or null if the property is not set, or not a valid Date
Since:
Apache Tika 0.8

getValues

public String[] getValues(String name)
Get the values associated to a metadata name.

Parameters:
name - of the metadata.
Returns:
the values associated to a metadata name.

add

public void add(String name,
                String value)
Add a metadata name/value mapping. Add the specified value to the list of values associated to the specified metadata name.

Parameters:
name - the metadata name.
value - the metadata value.

setAll

public void setAll(Properties properties)
Copy All key-value pairs from properties.

Parameters:
properties - properties to copy from

set

public void set(String name,
                String value)
Set metadata name/value. Associate the specified value to the specified metadata name. If some previous values were associated to this name, they are removed.

Parameters:
name - the metadata name.
value - the metadata value.

set

public void set(Property property,
                String value)
Sets the value of the identified metadata property.

Parameters:
property - property definition
value - property value
Since:
Apache Tika 0.7

set

public void set(Property property,
                int value)
Sets the integer value of the identified metadata property.

Parameters:
property - simple integer property definition
value - property value
Since:
Apache Tika 0.8

set

public void set(Property property,
                double value)
Sets the real or rational value of the identified metadata property.

Parameters:
property - simple real or simple rational property definition
value - property value
Since:
Apache Tika 0.8

set

public void set(Property property,
                Date date)
Sets the date value of the identified metadata property.

Parameters:
property - simple integer property definition
date - property value
Since:
Apache Tika 0.8

remove

public void remove(String name)
Remove a metadata and all its associated values.

Parameters:
name - metadata name to remove

size

public int size()
Returns the number of metadata names in this metadata.

Returns:
number of metadata names

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


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