public class XMPSchema extends AbstractStructuredType
STRUCTURE_ARRAY_NAME
Constructor and Description |
---|
XMPSchema(XMPMetadata metadata)
Create a new blank schema that can be populated.
|
XMPSchema(XMPMetadata metadata,
java.lang.String prefix)
Create a new blank schema that can be populated.
|
XMPSchema(XMPMetadata metadata,
java.lang.String namespaceURI,
java.lang.String prefix)
Create a new blank schema that can be populated.
|
XMPSchema(XMPMetadata metadata,
java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String name)
Create a new blank schema that can be populated.
|
Modifier and Type | Method and Description |
---|---|
void |
addBagValue(java.lang.String qualifiedSeqName,
AbstractField seqValue)
Add a new value to a bag property.
|
void |
addBagValueAsSimple(java.lang.String simpleName,
java.lang.String bagValue)
add a bag value property on the schema, using the current prefix.
|
void |
addQualifiedBagValue(java.lang.String simpleName,
java.lang.String bagValue)
Add an entry to a bag property.
|
void |
addSequenceDateValueAsSimple(java.lang.String simpleName,
java.util.Calendar date)
Add a date sequence value to the list using the current prefix
|
void |
addUnqualifiedSequenceDateValue(java.lang.String seqName,
java.util.Calendar date)
Add a date sequence value to the list.
|
void |
addUnqualifiedSequenceValue(java.lang.String seqName,
AbstractField seqValue)
Add a new value to a sequence property.
|
void |
addUnqualifiedSequenceValue(java.lang.String simpleSeqName,
java.lang.String seqValue)
Add a new value to a sequence property.
|
Attribute |
getAboutAttribute()
Get the RDF about attribute
|
java.lang.String |
getAboutValue()
Get the RDF about value.
|
AbstractField |
getAbstractProperty(java.lang.String qualifiedName)
Retrieve a generic simple type property
|
BooleanType |
getBooleanProperty(java.lang.String qualifiedName)
Get a BooleanType property with its name
|
java.lang.Boolean |
getBooleanPropertyValue(java.lang.String qualifiedName)
Get the value of the property as a Boolean.
|
java.lang.Boolean |
getBooleanPropertyValueAsSimple(java.lang.String simpleName)
Get a simple boolean property value on the schema, using the current prefix.
|
DateType |
getDateProperty(java.lang.String qualifiedName)
Get the Date property with its name
|
java.util.Calendar |
getDatePropertyValue(java.lang.String qualifiedName)
Get the value of the property as a date.
|
java.util.Calendar |
getDatePropertyValueAsSimple(java.lang.String simpleName)
Get a simple date property value on the schema, using the current prefix.
|
IntegerType |
getIntegerProperty(java.lang.String qualifiedName)
Get the Integer property with its name
|
java.lang.Integer |
getIntegerPropertyValue(java.lang.String qualifiedName)
Get the value of the property as an integer.
|
java.lang.Integer |
getIntegerPropertyValueAsSimple(java.lang.String simpleName)
Get a simple integer property value on the schema, using the current prefix.
|
java.util.List<AbstractField> |
getUnqualifiedArrayList(java.lang.String name)
Get an AbstractField list corresponding to the content of an array
property.
|
java.util.List<java.lang.String> |
getUnqualifiedBagValueList(java.lang.String bagName)
Get all the values of the bag property.
|
java.util.List<java.lang.String> |
getUnqualifiedLanguagePropertyLanguagesValue(java.lang.String name)
Get a list of all languages that are currently defined for a specific
property.
|
java.lang.String |
getUnqualifiedLanguagePropertyValue(java.lang.String name,
java.lang.String expectedLanguage)
Get the value of a multi-lingual property.
|
java.util.List<java.util.Calendar> |
getUnqualifiedSequenceDateValueList(java.lang.String seqName)
Get all the date values in a sequence property.
|
java.util.List<java.lang.String> |
getUnqualifiedSequenceValueList(java.lang.String seqName)
Get all the values in a sequence property.
|
TextType |
getUnqualifiedTextProperty(java.lang.String name)
Get a TextProperty Type from its name
|
java.lang.String |
getUnqualifiedTextPropertyValue(java.lang.String name)
Get the value of a simple text property.
|
protected AbstractSimpleProperty |
instanciateSimple(java.lang.String propertyName,
java.lang.Object value) |
private void |
internalAddBagValue(java.lang.String qualifiedBagName,
java.lang.String bagValue) |
void |
merge(XMPSchema xmpSchema)
A basic schema merge, it merges bags and sequences and replace everything else.
|
private boolean |
mergeComplexProperty(java.util.Iterator<AbstractField> itNewValues,
ArrayProperty arrayProperty) |
void |
removeUnqualifiedArrayValue(java.lang.String arrayName,
AbstractField fieldValue)
Generic method to remove a field from an array with an Elementable Object
|
private void |
removeUnqualifiedArrayValue(java.lang.String arrayName,
java.lang.String fieldValue)
Generic array property removing
|
void |
removeUnqualifiedBagValue(java.lang.String bagName,
java.lang.String bagValue)
Remove all matching entries with the given value from the bag.
|
void |
removeUnqualifiedSequenceDateValue(java.lang.String seqName,
java.util.Calendar date)
Remove a date sequence value from the list.
|
void |
removeUnqualifiedSequenceValue(java.lang.String qualifiedSeqName,
AbstractField seqValue)
Remove a value from a sequence property.
|
void |
removeUnqualifiedSequenceValue(java.lang.String qualifiedSeqName,
java.lang.String seqValue)
Remove all matching values from a sequence property.
|
void |
reorganizeAltOrder(ComplexPropertyContainer alt)
Method used to place the 'x-default' value in first in Language alternatives as said in xmp spec
|
void |
setAbout(Attribute about)
Set the RDF 'about' attribute
|
void |
setAboutAsSimple(java.lang.String about)
Set the RDF 'about' attribute.
|
void |
setBooleanProperty(BooleanType bool)
Set a BooleanType property
|
void |
setBooleanPropertyValue(java.lang.String qualifiedName,
java.lang.Boolean bool)
Set the value of the property as a boolean.
|
void |
setBooleanPropertyValueAsSimple(java.lang.String simpleName,
java.lang.Boolean bool)
Set a simple Boolean property on the schema, using the current prefix.
|
void |
setDateProperty(DateType date)
Set a new DateProperty
|
void |
setDatePropertyValue(java.lang.String qualifiedName,
java.util.Calendar date)
Set the value of the property as a date.
|
void |
setDatePropertyValueAsSimple(java.lang.String simpleName,
java.util.Calendar date)
Set a simple Date property on the schema, using the current prefix.
|
void |
setIntegerProperty(IntegerType prop)
Add an integerProperty
|
void |
setIntegerPropertyValue(java.lang.String qualifiedName,
java.lang.Integer intValue)
Set the value of the property as an integer.
|
void |
setIntegerPropertyValueAsSimple(java.lang.String simpleName,
java.lang.Integer intValue)
Set a simple Integer property on the schema, using the current prefix.
|
private void |
setSpecifiedSimpleTypeProperty(AbstractSimpleProperty prop)
Add a SimpleProperty to this schema
|
private void |
setSpecifiedSimpleTypeProperty(Types type,
java.lang.String qualifiedName,
java.lang.Object propertyValue) |
void |
setTextProperty(TextType prop)
Set TextType property
|
void |
setTextPropertyValue(java.lang.String qualifiedName,
java.lang.String propertyValue)
Set a simple text property on the schema.
|
void |
setTextPropertyValueAsSimple(java.lang.String simpleName,
java.lang.String propertyValue)
Set a simple text property on the schema, using the current prefix.
|
void |
setUnqualifiedLanguagePropertyValue(java.lang.String name,
java.lang.String language,
java.lang.String value)
Set the value of a multi-lingual property.
|
addSimpleProperty, createArrayProperty, createTextType, getDatePropertyAsCalendar, getNamespace, getPreferedPrefix, getPrefix, getPropertyValueAsString, setNamespace, setPrefix
addNamespace, addProperty, getAllNamespacesWithPrefix, getAllProperties, getArrayProperty, getContainer, getFirstEquivalentProperty, getNamespacePrefix, getProperty, removeProperty
containsAttribute, getAllAttributes, getAttribute, getMetadata, getPropertyName, removeAttribute, setAttribute, setPropertyName
public XMPSchema(XMPMetadata metadata, java.lang.String namespaceURI, java.lang.String prefix, java.lang.String name)
metadata
- The parent XMP metadata that this schema will be part of.namespaceURI
- The URI of the namespace, e.g. "http://ns.adobe.com/pdf/1.3/"prefix
- The field prefix of the namespace.name
- The property name.public XMPSchema(XMPMetadata metadata)
metadata
- The parent XMP metadata that this schema will be part of.public XMPSchema(XMPMetadata metadata, java.lang.String prefix)
metadata
- The parent XMP metadata that this schema will be part of.prefix
- The field prefix of the namespace.public XMPSchema(XMPMetadata metadata, java.lang.String namespaceURI, java.lang.String prefix)
metadata
- The parent XMP metadata that this schema will be part of.namespaceURI
- The URI of the namespace, e.g. "http://ns.adobe.com/pdf/1.3/"prefix
- The field prefix of the namespace.public AbstractField getAbstractProperty(java.lang.String qualifiedName)
qualifiedName
- Full qualified name of property wantedpublic Attribute getAboutAttribute()
public java.lang.String getAboutValue()
public void setAbout(Attribute about) throws BadFieldValueException
about
- the well-formed attributeBadFieldValueException
- Bad Attribute name (not corresponding to about attribute)public void setAboutAsSimple(java.lang.String about)
about
- The new RFD about value.private void setSpecifiedSimpleTypeProperty(Types type, java.lang.String qualifiedName, java.lang.Object propertyValue)
private void setSpecifiedSimpleTypeProperty(AbstractSimpleProperty prop)
prop
- The Property to addpublic void setTextProperty(TextType prop)
prop
- The text property to addpublic void setTextPropertyValue(java.lang.String qualifiedName, java.lang.String propertyValue)
qualifiedName
- The name of the property, it must contain the namespace prefix, ie "pdf:Keywords"propertyValue
- The value for the property, can be any string. Passing null will remove the property.public void setTextPropertyValueAsSimple(java.lang.String simpleName, java.lang.String propertyValue)
simpleName
- the name of the property without prefixpropertyValue
- The value for the property, can be any string. Passing null will remove the property.public TextType getUnqualifiedTextProperty(java.lang.String name)
name
- The property name.public java.lang.String getUnqualifiedTextPropertyValue(java.lang.String name)
name
- The property name.public DateType getDateProperty(java.lang.String qualifiedName)
qualifiedName
- The name of the property to get, it must include the namespace prefix, e.g. "pdf:Keywords".public java.util.Calendar getDatePropertyValueAsSimple(java.lang.String simpleName)
simpleName
- the local name of the property to getpublic java.util.Calendar getDatePropertyValue(java.lang.String qualifiedName)
qualifiedName
- The fully qualified property name for the date.public void setDateProperty(DateType date)
date
- The DateType Propertypublic void setDatePropertyValueAsSimple(java.lang.String simpleName, java.util.Calendar date)
simpleName
- the name of the property without prefixdate
- The calendar value for the property, can be any string. Passing null will remove the property.public void setDatePropertyValue(java.lang.String qualifiedName, java.util.Calendar date)
qualifiedName
- The fully qualified property name for the date.date
- The date to set, or null to clear.public BooleanType getBooleanProperty(java.lang.String qualifiedName)
qualifiedName
- the full qualified name of property wantedpublic java.lang.Boolean getBooleanPropertyValueAsSimple(java.lang.String simpleName)
simpleName
- the local name of property wantedpublic java.lang.Boolean getBooleanPropertyValue(java.lang.String qualifiedName)
qualifiedName
- The fully qualified property name for the Boolean.public void setBooleanProperty(BooleanType bool)
bool
- the booleanType propertypublic void setBooleanPropertyValueAsSimple(java.lang.String simpleName, java.lang.Boolean bool)
simpleName
- the name of the property without prefixbool
- The value for the property, can be any string. Passing null will remove the property.public void setBooleanPropertyValue(java.lang.String qualifiedName, java.lang.Boolean bool)
qualifiedName
- The fully qualified property name for the boolean.bool
- The boolean to set, or null to clear.public IntegerType getIntegerProperty(java.lang.String qualifiedName)
qualifiedName
- the full qualified name of property wantedpublic java.lang.Integer getIntegerPropertyValueAsSimple(java.lang.String simpleName)
simpleName
- the local name of property wantedpublic java.lang.Integer getIntegerPropertyValue(java.lang.String qualifiedName)
qualifiedName
- The fully qualified property name for the integer.public void setIntegerProperty(IntegerType prop)
prop
- The Integer Type propertypublic void setIntegerPropertyValueAsSimple(java.lang.String simpleName, java.lang.Integer intValue)
simpleName
- the name of the property without prefixintValue
- The value for the property, can be any string. Passing null will remove the property.public void setIntegerPropertyValue(java.lang.String qualifiedName, java.lang.Integer intValue)
qualifiedName
- The fully qualified property name for the integer.intValue
- The int to set, or null to clear.private void removeUnqualifiedArrayValue(java.lang.String arrayName, java.lang.String fieldValue)
fieldValue
- the field valuepublic void removeUnqualifiedBagValue(java.lang.String bagName, java.lang.String bagValue)
bagName
- The bag name.bagValue
- The value to remove from the bagList.public void addBagValueAsSimple(java.lang.String simpleName, java.lang.String bagValue)
simpleName
- the local name of propertybagValue
- the string value to addprivate void internalAddBagValue(java.lang.String qualifiedBagName, java.lang.String bagValue)
public void addQualifiedBagValue(java.lang.String simpleName, java.lang.String bagValue)
simpleName
- The name of the bag without the namespace prefixbagValue
- The value to add to the bagList.public java.util.List<java.lang.String> getUnqualifiedBagValueList(java.lang.String bagName)
bagName
- The bag name.public void removeUnqualifiedSequenceValue(java.lang.String qualifiedSeqName, java.lang.String seqValue)
qualifiedSeqName
- The name of the sequence property. It must include the namespace prefix, e.g. "pdf:Keywords".seqValue
- The value to remove from the list.public void removeUnqualifiedArrayValue(java.lang.String arrayName, AbstractField fieldValue)
arrayName
- the name of the property concernedfieldValue
- the elementable field valuepublic void removeUnqualifiedSequenceValue(java.lang.String qualifiedSeqName, AbstractField seqValue)
qualifiedSeqName
- The name of the sequence property. It must include the namespace prefix, e.g. "pdf:Keywords".seqValue
- The value to remove from the list.public void addUnqualifiedSequenceValue(java.lang.String simpleSeqName, java.lang.String seqValue)
simpleSeqName
- The name of the sequence property without the namespace prefixseqValue
- The value to add to the sequence.public void addBagValue(java.lang.String qualifiedSeqName, AbstractField seqValue)
qualifiedSeqName
- The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"seqValue
- The value to add to the bag.public void addUnqualifiedSequenceValue(java.lang.String seqName, AbstractField seqValue)
seqName
- The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"seqValue
- The value to add to the sequence.public java.util.List<java.lang.String> getUnqualifiedSequenceValueList(java.lang.String seqName)
seqName
- The name of the sequence property without namespace prefix.public void removeUnqualifiedSequenceDateValue(java.lang.String seqName, java.util.Calendar date)
seqName
- The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"date
- The date to remove from the sequence property.public void addSequenceDateValueAsSimple(java.lang.String simpleName, java.util.Calendar date)
simpleName
- the local name of the propertydate
- the value to addpublic void addUnqualifiedSequenceDateValue(java.lang.String seqName, java.util.Calendar date)
seqName
- The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords"date
- The date to add to the sequence property.public java.util.List<java.util.Calendar> getUnqualifiedSequenceDateValueList(java.lang.String seqName)
seqName
- The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords".public void reorganizeAltOrder(ComplexPropertyContainer alt)
alt
- The property to reorganizepublic void setUnqualifiedLanguagePropertyValue(java.lang.String name, java.lang.String language, java.lang.String value)
name
- The name of the property, it must include the namespace prefix, e.g. "pdf:Keywords"language
- The language code of the value. If null then "x-default" is assumed.value
- The value of the property in the specified language.public java.lang.String getUnqualifiedLanguagePropertyValue(java.lang.String name, java.lang.String expectedLanguage)
name
- The name of the property, without the namespace prefix.expectedLanguage
- The language code of the value. If null then "x-default" is assumed.public java.util.List<java.lang.String> getUnqualifiedLanguagePropertyLanguagesValue(java.lang.String name)
name
- The name of the property, it must include the namespace
prefix, e.g. "pdf:Keywords".public void merge(XMPSchema xmpSchema) throws java.io.IOException
xmpSchema
- The schema to merge.java.io.IOException
- If there is an error during the merge.private boolean mergeComplexProperty(java.util.Iterator<AbstractField> itNewValues, ArrayProperty arrayProperty)
public java.util.List<AbstractField> getUnqualifiedArrayList(java.lang.String name) throws BadFieldValueException
name
- The property name without namespace.BadFieldValueException
- If the property with the requested name isn't an array.protected AbstractSimpleProperty instanciateSimple(java.lang.String propertyName, java.lang.Object value)