Package org.apache.tika.metadata
Class Property
- java.lang.Object
-
- org.apache.tika.metadata.Property
-
- All Implemented Interfaces:
java.lang.Comparable<Property>
public final class Property extends java.lang.Object implements java.lang.Comparable<Property>
XMP property definition. Each instance of this class defines a single metadata property like "dc:format". In addition to the property name, thevalue typeand category (internal or external) of the property are included in the property definition. The available choice values are also stored for open and closed choice value types.- Since:
- Apache Tika 0.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProperty.PropertyTypestatic classProperty.ValueType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Property o)static Propertycomposite(Property primaryProperty, Property[] secondaryExtractProperties)Constructs a new composite property from the given primary and array of secondary properties.booleanequals(java.lang.Object o)static PropertyexternalBoolean(java.lang.String name)static PropertyexternalClosedChoise(java.lang.String name, java.lang.String... choices)static PropertyexternalDate(java.lang.String name)static PropertyexternalInteger(java.lang.String name)static PropertyexternalOpenChoise(java.lang.String name, java.lang.String... choices)static PropertyexternalReal(java.lang.String name)static PropertyexternalText(java.lang.String name)static PropertyexternalTextBag(java.lang.String name)static Propertyget(java.lang.String key)Retrieve the property object that corresponds to the given keyjava.util.Set<java.lang.String>getChoices()Returns the (immutable) set of choices for the values of this property.java.lang.StringgetName()PropertygetPrimaryProperty()Gets the primary property for a composite propertystatic java.util.SortedSet<Property>getProperties(java.lang.String prefix)Property.PropertyTypegetPropertyType()static Property.PropertyTypegetPropertyType(java.lang.String key)Get the type of a propertyProperty[]getSecondaryExtractProperties()Gets the secondary properties for a composite propertyProperty.ValueTypegetValueType()inthashCode()static PropertyinternalBoolean(java.lang.String name)static PropertyinternalClosedChoise(java.lang.String name, java.lang.String... choices)static PropertyinternalDate(java.lang.String name)static PropertyinternalInteger(java.lang.String name)static PropertyinternalIntegerSequence(java.lang.String name)static PropertyinternalOpenChoise(java.lang.String name, java.lang.String... choices)static PropertyinternalRational(java.lang.String name)static PropertyinternalReal(java.lang.String name)static PropertyinternalText(java.lang.String name)static PropertyinternalTextBag(java.lang.String name)static PropertyinternalURI(java.lang.String name)booleanisExternal()booleanisInternal()booleanisMultiValuePermitted()Is the PropertyType one which accepts multiple values?
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
isInternal
public boolean isInternal()
-
isExternal
public boolean isExternal()
-
isMultiValuePermitted
public boolean isMultiValuePermitted()
Is the PropertyType one which accepts multiple values?
-
getPropertyType
public static Property.PropertyType getPropertyType(java.lang.String key)
Get the type of a property- Parameters:
key- name of the property- Returns:
- the type of the property
-
get
public static Property get(java.lang.String key)
Retrieve the property object that corresponds to the given key- Parameters:
key- the property key or name- Returns:
- the Property object
-
getPropertyType
public Property.PropertyType getPropertyType()
-
getValueType
public Property.ValueType getValueType()
-
getChoices
public java.util.Set<java.lang.String> getChoices()
Returns the (immutable) set of choices for the values of this property. Only defined foropenandclosed choicevalue types.- Returns:
- available choices, or
null
-
getPrimaryProperty
public Property getPrimaryProperty()
Gets the primary property for a composite property- Returns:
- the primary property
-
getSecondaryExtractProperties
public Property[] getSecondaryExtractProperties()
Gets the secondary properties for a composite property- Returns:
- the secondary properties
-
getProperties
public static java.util.SortedSet<Property> getProperties(java.lang.String prefix)
-
internalBoolean
public static Property internalBoolean(java.lang.String name)
-
internalClosedChoise
public static Property internalClosedChoise(java.lang.String name, java.lang.String... choices)
-
internalDate
public static Property internalDate(java.lang.String name)
-
internalInteger
public static Property internalInteger(java.lang.String name)
-
internalIntegerSequence
public static Property internalIntegerSequence(java.lang.String name)
-
internalRational
public static Property internalRational(java.lang.String name)
-
internalOpenChoise
public static Property internalOpenChoise(java.lang.String name, java.lang.String... choices)
-
internalReal
public static Property internalReal(java.lang.String name)
-
internalText
public static Property internalText(java.lang.String name)
-
internalTextBag
public static Property internalTextBag(java.lang.String name)
-
internalURI
public static Property internalURI(java.lang.String name)
-
externalClosedChoise
public static Property externalClosedChoise(java.lang.String name, java.lang.String... choices)
-
externalOpenChoise
public static Property externalOpenChoise(java.lang.String name, java.lang.String... choices)
-
externalDate
public static Property externalDate(java.lang.String name)
-
externalReal
public static Property externalReal(java.lang.String name)
-
externalInteger
public static Property externalInteger(java.lang.String name)
-
externalBoolean
public static Property externalBoolean(java.lang.String name)
-
externalText
public static Property externalText(java.lang.String name)
-
externalTextBag
public static Property externalTextBag(java.lang.String name)
-
composite
public static Property composite(Property primaryProperty, Property[] secondaryExtractProperties)
Constructs a new composite property from the given primary and array of secondary properties.Note that name of the composite property is taken from its primary property, and primary and secondary properties must not be composite properties themselves.
- Parameters:
primaryProperty-secondaryExtractProperties-- Returns:
- the composite property
-
compareTo
public int compareTo(Property o)
- Specified by:
compareToin interfacejava.lang.Comparable<Property>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-