|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jempbox.xmp.XMPSchema
public class XMPSchema
This class represents a metadata schema that can be stored in an XMP document. It handles all generic properties that are available. See subclasses for access to specific properties.
Field Summary | |
---|---|
static java.lang.String |
NS_NAMESPACE
The standard xmlns namespace. |
protected java.lang.String |
prefix
The XML schema prefix. |
protected org.w3c.dom.Element |
schema
The DOM representation of this object. |
Constructor Summary | |
---|---|
XMPSchema(org.w3c.dom.Element element,
java.lang.String aPrefix)
Create schema from an existing XML element. |
|
XMPSchema(XMPMetadata parent,
java.lang.String namespaceName,
java.lang.String namespaceURI)
Create a new blank schema that can be populated. |
Method Summary | |
---|---|
void |
addBagValue(java.lang.String bagName,
java.lang.String bagValue)
Add an entry to a bag property. |
void |
addSequenceDateValue(java.lang.String seqName,
java.util.Calendar date)
Add a date sequence value to the list. |
void |
addSequenceValue(java.lang.String seqName,
Elementable seqValue)
Add a new value to a sequence property. |
void |
addSequenceValue(java.lang.String seqName,
java.lang.String seqValue)
Add a new value to a sequence property. |
java.lang.String |
getAbout()
Get the RDF about attribute. |
java.util.List<java.lang.String> |
getBagList(java.lang.String bagName)
Get all the values of the bag property. |
java.lang.Boolean |
getBooleanProperty(java.lang.String propertyName)
Get the value of the property as a boolean. |
java.util.Calendar |
getDateProperty(java.lang.String propertyName)
Get the value of the property as a date. |
org.w3c.dom.Element |
getElement()
Get the XML element that is represented by this schema. |
java.util.List<ResourceEvent> |
getEventSequenceList(java.lang.String seqName)
Get a list of ResourceEvent objects. |
java.lang.Integer |
getIntegerProperty(java.lang.String propertyName)
Get the value of the property as an integer. |
java.lang.String |
getLanguageProperty(java.lang.String propertyName,
java.lang.String language)
Get the value of a multi-lingual property. |
java.util.List<java.lang.String> |
getLanguagePropertyLanguages(java.lang.String propertyName)
Get a list of all languages that are currently defined for a specific property. |
java.util.List<java.util.Calendar> |
getSequenceDateList(java.lang.String seqName)
Get all the date values in a sequence property. |
java.util.List<java.lang.String> |
getSequenceList(java.lang.String seqName)
Get all the values in a sequence property. |
java.lang.String |
getTextProperty(java.lang.String propertyName)
Get the value of a simple text property. |
Thumbnail |
getThumbnailProperty(java.lang.String propertyName,
java.lang.String language)
Get the value of a multi-lingual property. |
void |
merge(XMPSchema xmpSchema)
A basic schema merge, it merges bags and sequences and replace everything else. |
void |
removeBagValue(java.lang.String bagName,
java.lang.String bagValue)
Remove all matching entries with the given value from the bag. |
void |
removeSequenceDateValue(java.lang.String seqName,
java.util.Calendar date)
Remove a date sequence value from the list. |
void |
removeSequenceValue(java.lang.String seqName,
Elementable seqValue)
Remove a value from a sequence property. |
void |
removeSequenceValue(java.lang.String seqName,
java.lang.String seqValue)
Remove all matching values from a sequence property. |
void |
setAbout(java.lang.String about)
Set the RDF 'about' attribute. |
void |
setBooleanProperty(java.lang.String propertyName,
java.lang.Boolean bool)
Set the value of the property as a boolean. |
void |
setDateProperty(java.lang.String propertyName,
java.util.Calendar date)
Set the value of the property as a date. |
void |
setIntegerProperty(java.lang.String propertyName,
java.lang.Integer intValue)
Set the value of the property as an integer. |
void |
setLanguageProperty(java.lang.String propertyName,
java.lang.String language,
java.lang.String value)
Set the value of a multi-lingual property. |
void |
setTextProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Set a simple text property on the schema. |
void |
setThumbnailProperty(java.lang.String propertyName,
java.lang.String language,
Thumbnail value)
Set the value of a multi-lingual property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NS_NAMESPACE
protected java.lang.String prefix
protected org.w3c.dom.Element schema
Constructor Detail |
---|
public XMPSchema(XMPMetadata parent, java.lang.String namespaceName, java.lang.String namespaceURI)
parent
- The parent XMP document that this schema will be part of.namespaceName
- The name of the namespace, ie pdf,dc,...namespaceURI
- The URI of the namespace, ie "http://ns.adobe.com/pdf/1.3/"public XMPSchema(org.w3c.dom.Element element, java.lang.String aPrefix)
element
- The existing XML element.aPrefix
- The XML prefix.Method Detail |
---|
public org.w3c.dom.Element getElement()
public java.lang.String getAbout()
public void setAbout(java.lang.String about)
about
- The new RFD about value.public void setTextProperty(java.lang.String propertyName, java.lang.String propertyValue)
propertyName
- 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 java.lang.String getTextProperty(java.lang.String propertyName)
propertyName
- The name of the property to get, it must include the namespace
prefix. ie "pdf:Keywords".
public java.util.Calendar getDateProperty(java.lang.String propertyName) throws java.io.IOException
propertyName
- The fully qualified property name for the date.
java.io.IOException
- If there is an error converting the value to a date.public void setDateProperty(java.lang.String propertyName, java.util.Calendar date)
propertyName
- The fully qualified property name for the date.date
- The date to set, or null to clear.public java.lang.Boolean getBooleanProperty(java.lang.String propertyName)
propertyName
- The fully qualified property name for the boolean.
public void setBooleanProperty(java.lang.String propertyName, java.lang.Boolean bool)
propertyName
- The fully qualified property name for the boolean.bool
- The boolean to set, or null to clear.public java.lang.Integer getIntegerProperty(java.lang.String propertyName)
propertyName
- The fully qualified property name for the integer.
public void setIntegerProperty(java.lang.String propertyName, java.lang.Integer intValue)
propertyName
- The fully qualified property name for the integer.intValue
- The int to set, or null to clear.public void removeBagValue(java.lang.String bagName, java.lang.String bagValue)
bagName
- The name of the bag, it must include the namespace prefix. ie
"pdf:Keywords".bagValue
- The value to remove from the bagList.public void addBagValue(java.lang.String bagName, java.lang.String bagValue)
bagName
- The name of the bag, it must include the namespace prefix. ie
"pdf:Keywords".bagValue
- The value to add to the bagList.public java.util.List<java.lang.String> getBagList(java.lang.String bagName)
bagName
- The name of the bag property to get, it must include the
namespace prefix. ie "pdf:Keywords"
public void removeSequenceValue(java.lang.String seqName, java.lang.String seqValue)
seqName
- The name of the sequence property. It must include the
namespace prefix. ie "pdf:Keywords".seqValue
- The value to remove from the list.public void removeSequenceValue(java.lang.String seqName, Elementable seqValue)
seqName
- The name of the sequence property. It must include the
namespace prefix. ie "pdf:Keywords".seqValue
- The value to remove from the list.public void addSequenceValue(java.lang.String seqName, java.lang.String seqValue)
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords"seqValue
- The value to add to the sequence.public void addSequenceValue(java.lang.String seqName, Elementable seqValue)
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords"seqValue
- The value to add to the sequence.public java.util.List<java.lang.String> getSequenceList(java.lang.String seqName)
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords".
public java.util.List<ResourceEvent> getEventSequenceList(java.lang.String seqName)
seqName
- The name of the sequence to retrieve.
public void removeSequenceDateValue(java.lang.String seqName, java.util.Calendar date)
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords"date
- The date to remove from the sequence property.public void addSequenceDateValue(java.lang.String seqName, java.util.Calendar date)
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords"date
- The date to add to the sequence property.public java.util.List<java.util.Calendar> getSequenceDateList(java.lang.String seqName) throws java.io.IOException
seqName
- The name of the sequence property, it must include the
namespace prefix. ie "pdf:Keywords".
java.io.IOException
- If there is an error converting the value to a date.public void setLanguageProperty(java.lang.String propertyName, java.lang.String language, java.lang.String value)
propertyName
- The name of the property, it must include the namespace
prefix. ie "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 getLanguageProperty(java.lang.String propertyName, java.lang.String language)
propertyName
- The name of the property, it must include the namespace
prefix. ie "pdf:Keywords"language
- The language code of the value. If null then "x-default" is
assumed.
public void setThumbnailProperty(java.lang.String propertyName, java.lang.String language, Thumbnail value)
propertyName
- The name of the property, it must include the namespace
prefix. ie "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 Thumbnail getThumbnailProperty(java.lang.String propertyName, java.lang.String language)
propertyName
- The name of the property, it must include the namespace
prefix. ie "pdf:Keywords"language
- The language code of the value. If null then "x-default" is
assumed.
public java.util.List<java.lang.String> getLanguagePropertyLanguages(java.lang.String propertyName)
propertyName
- The name of the property, it must include the namespace
prefix. ie "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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |