Package org.apache.tika.metadata
Class Metadata
java.lang.Object
org.apache.tika.metadata.Metadata
- All Implemented Interfaces:
Serializable,ClimateForcast,CreativeCommons,Geographic,HttpHeaders,Message,MSOffice,TIFF,TikaMetadataKeys,TikaMimeKeys
public class Metadata
extends Object
implements CreativeCommons, Geographic, HttpHeaders, Message, MSOffice, ClimateForcast, TIFF, TikaMetadataKeys, TikaMimeKeys, Serializable
A multi-valued metadata container.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.use TikaCoreProperties#CONTRIBUTORstatic final StringDeprecated.use TikaCoreProperties#COVERAGEstatic final StringDeprecated.use TikaCoreProperties#CREATORstatic final PropertyDeprecated.use TikaCoreProperties#CREATEDstatic final StringDeprecated.use TikaCoreProperties#DESCRIPTIONstatic final StringDeprecated.use TikaCoreProperties#FORMATstatic final StringDeprecated.use TikaCoreProperties#IDENTIFIERstatic final StringDeprecated.use TikaCoreProperties#LANGUAGEstatic final StringDeprecated.use TikaCoreProperties#MODIFIEDstatic final StringThe common delimiter used between the namespace abbreviation and the property namestatic final StringDeprecated.use TikaCoreProperties#PUBLISHERstatic final StringDeprecated.use TikaCoreProperties#RELATIONstatic final StringDeprecated.use TikaCoreProperties#RIGHTSstatic final StringDeprecated.use TikaCoreProperties#SOURCEstatic final StringDeprecated.use TikaCoreProperties#KEYWORDSstatic final StringDeprecated.use TikaCoreProperties#TITLEstatic final StringDeprecated.use TikaCoreProperties#TYPEFields 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_IDFields inherited from interface org.apache.tika.metadata.CreativeCommons
LICENSE_LOCATION, LICENSE_URL, WORK_TYPEFields inherited from interface org.apache.tika.metadata.Geographic
ALTITUDE, LATITUDE, LONGITUDEFields inherited from interface org.apache.tika.metadata.HttpHeaders
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, LAST_MODIFIED, LOCATIONFields inherited from interface org.apache.tika.metadata.Message
MESSAGE_BCC, MESSAGE_BCC_DISPLAY_NAME, MESSAGE_BCC_EMAIL, MESSAGE_BCC_NAME, MESSAGE_CC, MESSAGE_CC_DISPLAY_NAME, MESSAGE_CC_EMAIL, MESSAGE_CC_NAME, MESSAGE_FROM, MESSAGE_FROM_EMAIL, MESSAGE_FROM_NAME, MESSAGE_PREFIX, MESSAGE_RAW_HEADER_PREFIX, MESSAGE_RECIPIENT_ADDRESS, MESSAGE_TO, MESSAGE_TO_DISPLAY_NAME, MESSAGE_TO_EMAIL, MESSAGE_TO_NAME, MULTIPART_BOUNDARY, MULTIPART_SUBTYPEFields 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_COUNTFields inherited from interface org.apache.tika.metadata.TIFF
BITS_PER_SAMPLE, EQUIPMENT_MAKE, EQUIPMENT_MODEL, EXIF_PAGE_COUNT, 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, SOFTWAREFields inherited from interface org.apache.tika.metadata.TikaMetadataKeys
EMBEDDED_RELATIONSHIP_ID, EMBEDDED_RESOURCE_TYPE, EMBEDDED_STORAGE_CLASS_ID, PROTECTED, RESOURCE_NAME_KEYFields inherited from interface org.apache.tika.metadata.TikaMimeKeys
MIME_TYPE_MAGIC, TIKA_MIME_FILE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a metadata name/value mapping.voidAdds the integer value of the identified metadata property.voidAdd a metadata property/value mapping.booleanGet the value associated to a metadata name.Returns the value (if any) of the identified metadata property.Returns the value of the identified Date based metadata property.Returns the value of the identified Integer based metadata property.int[]getIntValues(Property property) Gets the array of ints of the identified "seq" integer metadata property.String[]Get the values associated to a metadata name.String[]Get the values associated to a metadata name.inthashCode()booleanisMultiValued(String name) Returns true if named value is multivalued.booleanisMultiValued(Property property) Returns true if named value is multivalued.String[]names()Returns an array of the names contained in the metadata.voidRemove a metadata and all its associated values.voidSet metadata name/value.voidSets the real or rational value of the identified metadata property.voidSets the integer value of the identified metadata property.voidSets the value of the identified metadata property.voidSets the values of the identified metadata property.voidSets the date value of the identified metadata property.voidSets the date value of the identified metadata property.voidsetAll(Properties properties) Copy All key-value pairs from properties.intsize()Returns the number of metadata names in this metadata.toString()
-
Field Details
-
NAMESPACE_PREFIX_DELIMITER
The common delimiter used between the namespace abbreviation and the property name- See Also:
-
FORMAT
Deprecated.use TikaCoreProperties#FORMAT- See Also:
-
IDENTIFIER
Deprecated.use TikaCoreProperties#IDENTIFIER- See Also:
-
MODIFIED
Deprecated.use TikaCoreProperties#MODIFIED- See Also:
-
CONTRIBUTOR
Deprecated.use TikaCoreProperties#CONTRIBUTOR- See Also:
-
COVERAGE
Deprecated.use TikaCoreProperties#COVERAGE- See Also:
-
CREATOR
Deprecated.use TikaCoreProperties#CREATOR- See Also:
-
DATE
Deprecated.use TikaCoreProperties#CREATED -
DESCRIPTION
Deprecated.use TikaCoreProperties#DESCRIPTION- See Also:
-
LANGUAGE
Deprecated.use TikaCoreProperties#LANGUAGE- See Also:
-
PUBLISHER
Deprecated.use TikaCoreProperties#PUBLISHER- See Also:
-
RELATION
Deprecated.use TikaCoreProperties#RELATION- See Also:
-
RIGHTS
Deprecated.use TikaCoreProperties#RIGHTS- See Also:
-
SOURCE
Deprecated.use TikaCoreProperties#SOURCE- See Also:
-
SUBJECT
Deprecated.use TikaCoreProperties#KEYWORDS- See Also:
-
TITLE
Deprecated.use TikaCoreProperties#TITLE- See Also:
-
TYPE
Deprecated.use TikaCoreProperties#TYPE- See Also:
-
-
Constructor Details
-
Metadata
public Metadata()Constructs a new, empty metadata.
-
-
Method Details
-
isMultiValued
Returns true if named value is multivalued.- Parameters:
property- metadata property- Returns:
- true is named value is multivalued, false if single value or null
-
isMultiValued
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
Returns an array of the names contained in the metadata.- Returns:
- Metadata names
-
get
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
Returns the value (if any) of the identified metadata property.- Parameters:
property- property definition- Returns:
- property value, or
nullif the property is not set - Since:
- Apache Tika 0.7
-
getInt
Returns the value of the identified Integer based metadata property.- Parameters:
property- simple integer property definition- Returns:
- property value as a Integer, or
nullif the property is not set, or not a valid Integer - Since:
- Apache Tika 0.8
-
getDate
Returns the value of the identified Date based metadata property.- Parameters:
property- simple date property definition- Returns:
- property value as a Date, or
nullif the property is not set, or not a valid Date - Since:
- Apache Tika 0.8
-
getValues
Get the values associated to a metadata name.- Parameters:
property- of the metadata.- Returns:
- the values associated to a metadata name.
-
getValues
Get the values associated to a metadata name.- Parameters:
name- of the metadata.- Returns:
- the values associated to a metadata name.
-
add
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.
-
add
Add a metadata property/value mapping. Add the specified value to the list of values associated to the specified metadata property.- Parameters:
property- the metadata property.value- the metadata value.
-
setAll
Copy All key-value pairs from properties.- Parameters:
properties- properties to copy from
-
set
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. If the given value isnull, then the metadata entry is removed.- Parameters:
name- the metadata name.value- the metadata value, ornull
-
set
Sets the value of the identified metadata property.- Parameters:
property- property definitionvalue- property value- Since:
- Apache Tika 0.7
-
set
Sets the values of the identified metadata property.- Parameters:
property- property definitionvalues- property values- Since:
- Apache Tika 1.2
-
set
Sets the integer value of the identified metadata property.- Parameters:
property- simple integer property definitionvalue- property value- Since:
- Apache Tika 0.8
-
add
Adds the integer value of the identified metadata property.- Parameters:
property- seq integer property definitionvalue- property value- Since:
- Apache Tika 1.21
-
getIntValues
Gets the array of ints of the identified "seq" integer metadata property.- Parameters:
property- seq integer property definition- Returns:
- array of ints
- Since:
- Apache Tika 1.21
-
set
Sets the real or rational value of the identified metadata property.- Parameters:
property- simple real or simple rational property definitionvalue- property value- Since:
- Apache Tika 0.8
-
set
Sets the date value of the identified metadata property.- Parameters:
property- simple integer property definitiondate- property value- Since:
- Apache Tika 0.8
-
set
Sets the date value of the identified metadata property.- Parameters:
property- simple integer property definitiondate- property value- Since:
- Apache Tika 0.8
-
remove
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
-
hashCode
public int hashCode() -
equals
-
toString
-