ARRAY_ITEM_NAME, ARRAY_LAST_ITEM, FALSESTR, NS_ADOBESTOCKPHOTO, NS_ASF, NS_BWF, NS_CAMERARAW, NS_CREATOR_ATOM, NS_DC, NS_DC_DEPRECATED, NS_DICOM, NS_DM, NS_EXIF, NS_EXIF_AUX, NS_EXIFX, NS_IPTCCORE, NS_IPTCEXT, NS_IX, NS_JP2K, NS_JPEG, NS_PDF, NS_PDFA_EXTENSION, NS_PDFA_FIELD, NS_PDFA_ID, NS_PDFA_PROPERTY, NS_PDFA_SCHEMA, NS_PDFA_TYPE, NS_PDFUA_ID, NS_PDFX, NS_PDFX_ID, NS_PHOTOSHOP, NS_PLUS, NS_PNG, NS_PSALBUM, NS_RDF, NS_RIFFINFO, NS_SCRIPT, NS_SWF, NS_TIFF, NS_TRANSIENT, NS_TXMP, NS_WAV, NS_X, NS_XML, NS_XMP, NS_XMP_BJ, NS_XMP_MM, NS_XMP_NOTE, NS_XMP_RIGHTS, RDF_TYPE, TAG_XAPMETA, TAG_XMPMETA, TRUESTR, TYPE_DIMENSIONS, TYPE_FONT, TYPE_GRAPHICS, TYPE_IDENTIFIERQUAL, TYPE_IMAGE, TYPE_MANIFESTITEM, TYPE_PAGEDFILE, TYPE_RESOURCEEVENT, TYPE_RESOURCEREF, TYPE_ST_JOB, TYPE_ST_VERSION, TYPE_TEXT, X_DEFAULT, XML_LANG, XMP_PI| Constructor and Description |
|---|
XMPMetaImpl()
Constructor for an empty metadata object.
|
XMPMetaImpl(com.itextpdf.xmp.impl.XMPNode tree)
Constructor for a cloned metadata tree.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendArrayItem(String schemaNS,
String arrayName,
PropertyOptions arrayOptions,
String itemValue,
PropertyOptions itemOptions)
Simplifies the construction of an array by not requiring that you pre-create an empty array.
|
void |
appendArrayItem(String schemaNS,
String arrayName,
String itemValue) |
Object |
clone()
Performs a deep clone of the XMPMeta-object
|
int |
countArrayItems(String schemaNS,
String arrayName)
Returns the number of items in the array.
|
void |
deleteArrayItem(String schemaNS,
String arrayName,
int itemIndex)
Deletes the given XMP subtree rooted at the given array item.
|
void |
deleteProperty(String schemaNS,
String propName)
Deletes the given XMP subtree rooted at the given property.
|
void |
deleteQualifier(String schemaNS,
String propName,
String qualNS,
String qualName)
Deletes the given XMP subtree rooted at the given qualifier.
|
void |
deleteStructField(String schemaNS,
String structName,
String fieldNS,
String fieldName)
Deletes the given XMP subtree rooted at the given struct field.
|
boolean |
doesArrayItemExist(String schemaNS,
String arrayName,
int itemIndex)
Tells if the array item exists.
|
boolean |
doesPropertyExist(String schemaNS,
String propName)
Returns whether the property exists.
|
boolean |
doesQualifierExist(String schemaNS,
String propName,
String qualNS,
String qualName)
DoesQualifierExist tells if the qualifier exists.
|
boolean |
doesStructFieldExist(String schemaNS,
String structName,
String fieldNS,
String fieldName)
DoesStructFieldExist tells if the struct field exists.
|
String |
dumpObject()
Renders this node and the tree unter this node in a human readable form.
|
XMPProperty |
getArrayItem(String schemaNS,
String arrayName,
int itemIndex)
Provides access to items within an array.
|
XMPProperty |
getLocalizedText(String schemaNS,
String altTextName,
String genericLang,
String specificLang)
These functions provide convenient support for localized text properties, including a number
of special and obscure aspects.
|
String |
getObjectName()
This correlates to the about-attribute,
returns the empty String if no name is set.
|
String |
getPacketHeader() |
XMPProperty |
getProperty(String schemaNS,
String propName)
The property value getter-methods all take a property specification: the first two parameters
are always the top level namespace URI (the "schema" namespace) and the basic name
of the property being referenced.
|
protected XMPProperty |
getProperty(String schemaNS,
String propName,
int valueType)
Returns a property, but the result value can be requested.
|
byte[] |
getPropertyBase64(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
Boolean |
getPropertyBoolean(String schemaNS,
String propName)
These are very similar to
getProperty() and SetProperty() above,
but the value is returned or provided in a literal form instead of as a UTF-8 string. |
Calendar |
getPropertyCalendar(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
XMPDateTime |
getPropertyDate(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
Double |
getPropertyDouble(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
Integer |
getPropertyInteger(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
Long |
getPropertyLong(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
protected Object |
getPropertyObject(String schemaNS,
String propName,
int valueType)
Returns a property, but the result value can be requested.
|
String |
getPropertyString(String schemaNS,
String propName)
Convenience method to retrieve the literal value of a property.
|
XMPProperty |
getQualifier(String schemaNS,
String propName,
String qualNS,
String qualName)
Provides access to a qualifier attached to a property.
|
com.itextpdf.xmp.impl.XMPNode |
getRoot() |
XMPProperty |
getStructField(String schemaNS,
String structName,
String fieldNS,
String fieldName)
Provides access to fields within a nested structure.
|
void |
insertArrayItem(String schemaNS,
String arrayName,
int itemIndex,
String itemValue) |
void |
insertArrayItem(String schemaNS,
String arrayName,
int itemIndex,
String itemValue,
PropertyOptions options)
Inserts an item into an array previous to the given index.
|
XMPIterator |
iterator()
Constructs an iterator for the properties within this XMP object.
|
XMPIterator |
iterator(IteratorOptions options)
Constructs an iterator for the properties within this XMP object using some options.
|
XMPIterator |
iterator(String schemaNS,
String propName,
IteratorOptions options)
Construct an iterator for the properties within an XMP object.
|
void |
normalize(ParseOptions options)
Perform the normalization as a separate parsing step.
|
void |
setArrayItem(String schemaNS,
String arrayName,
int itemIndex,
String itemValue) |
void |
setArrayItem(String schemaNS,
String arrayName,
int itemIndex,
String itemValue,
PropertyOptions options)
Replaces an item within an array.
|
void |
setLocalizedText(String schemaNS,
String altTextName,
String genericLang,
String specificLang,
String itemValue) |
void |
setLocalizedText(String schemaNS,
String altTextName,
String genericLang,
String specificLang,
String itemValue,
PropertyOptions options)
Modifies the value of a selected item in an alt-text array.
|
void |
setObjectName(String name) |
void |
setPacketHeader(String packetHeader)
Sets the packetHeader attributes, only used by the parser.
|
void |
setProperty(String schemaNS,
String propName,
Object propValue) |
void |
setProperty(String schemaNS,
String propName,
Object propValue,
PropertyOptions options)
The property value
setters all take a property specification, their
differences are in the form of this. |
void |
setPropertyBase64(String schemaNS,
String propName,
byte[] propValue) |
void |
setPropertyBase64(String schemaNS,
String propName,
byte[] propValue,
PropertyOptions options)
Convenience method to set a property from a binary
byte[]-array,
which is serialized as base64-string. |
void |
setPropertyBoolean(String schemaNS,
String propName,
boolean propValue) |
void |
setPropertyBoolean(String schemaNS,
String propName,
boolean propValue,
PropertyOptions options)
Convenience method to set a property to a literal
boolean value. |
void |
setPropertyCalendar(String schemaNS,
String propName,
Calendar propValue) |
void |
setPropertyCalendar(String schemaNS,
String propName,
Calendar propValue,
PropertyOptions options)
Convenience method to set a property with a Java Calendar-object,
which is serialized to an ISO8601 date.
|
void |
setPropertyDate(String schemaNS,
String propName,
XMPDateTime propValue) |
void |
setPropertyDate(String schemaNS,
String propName,
XMPDateTime propValue,
PropertyOptions options)
Convenience method to set a property with an XMPDateTime-object,
which is serialized to an ISO8601 date.
|
void |
setPropertyDouble(String schemaNS,
String propName,
double propValue) |
void |
setPropertyDouble(String schemaNS,
String propName,
double propValue,
PropertyOptions options)
Convenience method to set a property to a literal
double value. |
void |
setPropertyInteger(String schemaNS,
String propName,
int propValue) |
void |
setPropertyInteger(String schemaNS,
String propName,
int propValue,
PropertyOptions options)
Convenience method to set a property to a literal
int value. |
void |
setPropertyLong(String schemaNS,
String propName,
long propValue) |
void |
setPropertyLong(String schemaNS,
String propName,
long propValue,
PropertyOptions options)
Convenience method to set a property to a literal
long value. |
void |
setQualifier(String schemaNS,
String propName,
String qualNS,
String qualName,
String qualValue) |
void |
setQualifier(String schemaNS,
String propName,
String qualNS,
String qualName,
String qualValue,
PropertyOptions options)
Provides access to a qualifier attached to a property.
|
void |
setStructField(String schemaNS,
String structName,
String fieldNS,
String fieldName,
String fieldValue) |
void |
setStructField(String schemaNS,
String structName,
String fieldNS,
String fieldName,
String fieldValue,
PropertyOptions options)
Provides access to fields within a nested structure.
|
void |
sort()
Sorts the complete datamodel according to the following rules:
Schema nodes are sorted by prefix.
|
public XMPMetaImpl()
public XMPMetaImpl(com.itextpdf.xmp.impl.XMPNode tree)
tree - an prefilled metadata tree which fulfills all
XMPNode contracts.public void appendArrayItem(String schemaNS, String arrayName, PropertyOptions arrayOptions, String itemValue, PropertyOptions itemOptions) throws XMPException
XMPMetaappendArrayItem in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be null or
the empty string. Has the same namespace prefix usage as propPath in getProperty.arrayOptions - Option flags describing the array form. The only valid options are
PropertyOptions.ARRAY,
PropertyOptions.ARRAY_ORDERED,
PropertyOptions.ARRAY_ALTERNATE or
PropertyOptions.ARRAY_ALT_TEXT.
null or use
XMPMeta.appendArrayItem(String, String, String).itemValue - the value of the array item. Has the same usage as propValue in getProperty.itemOptions - Option flags describing the item to append (PropertyOptions)XMPException - Wraps all errors and exceptions that may occur.XMPMeta.appendArrayItem(String, String, PropertyOptions, String,
PropertyOptions)public void appendArrayItem(String schemaNS, String arrayName, String itemValue) throws XMPException
appendArrayItem in interface XMPMetaschemaNS - The namespace URI for the arrayarrayName - The name of the arrayitemValue - the value of the array itemXMPException - Wraps all errors and exceptionsXMPMeta.appendArrayItem(String, String, String)public int countArrayItems(String schemaNS, String arrayName) throws XMPException
XMPMetacountArrayItems in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().XMPExceptionXMPMeta.countArrayItems(String, String)public void deleteArrayItem(String schemaNS, String arrayName, int itemIndex)
XMPMetadeleteArrayItem in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().itemIndex - The index of the desired item. Arrays in XMP are indexed from 1. The
constant XMPConst.ARRAY_LAST_ITEM always refers to the last
existing array item.XMPMeta.deleteArrayItem(String, String, int)public void deleteProperty(String schemaNS, String propName)
XMPMetadeleteProperty in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property. Has the same usage as in getProperty.XMPMeta.deleteProperty(String, String)public void deleteQualifier(String schemaNS, String propName, String qualNS, String qualName)
XMPMetadeleteQualifier in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in
getProperty().propName - The name of the property to which the qualifier is attached. Has the same
usage as in getProperty.qualNS - The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNS parameter.qualName - The name of the qualifier. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
propName parameter.XMPMeta.deleteQualifier(String, String, String, String)public void deleteStructField(String schemaNS, String structName, String fieldNS, String fieldName)
XMPMetadeleteStructField in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in
getProperty().structName - The name of the struct. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty.fieldNS - The namespace URI for the field. Has the same URI and prefix usage as the
schemaNS parameter.fieldName - The name of the field. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
structName parameter.XMPMeta.deleteStructField(String, String, String, String)public boolean doesPropertyExist(String schemaNS, String propName)
XMPMetadoesPropertyExist in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().XMPMeta.doesPropertyExist(String, String)public boolean doesArrayItemExist(String schemaNS, String arrayName, int itemIndex)
XMPMetadoesArrayItemExist in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in
getProperty().arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().itemIndex - The index of the desired item. Arrays in XMP are indexed from 1. The
constant XMPConst.ARRAY_LAST_ITEM always refers to the last
existing array item.true if the array exists, false otherwise.XMPMeta.doesArrayItemExist(String, String, int)public boolean doesStructFieldExist(String schemaNS, String structName, String fieldNS, String fieldName)
XMPMetadoesStructFieldExist in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in
getProperty().structName - The name of the struct. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().fieldNS - The namespace URI for the field. Has the same URI and prefix usage as the
schemaNS parameter.fieldName - The name of the field. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
structName parameter.XMPMeta.doesStructFieldExist(String, String, String, String)public boolean doesQualifierExist(String schemaNS, String propName, String qualNS, String qualName)
XMPMetadoesQualifierExist in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in
getProperty().propName - The name of the property to which the qualifier is attached. Has the same
usage as in getProperty().qualNS - The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNS parameter.qualName - The name of the qualifier. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
propName parameter.XMPMeta.doesQualifierExist(String, String, String, String)public XMPProperty getArrayItem(String schemaNS, String arrayName, int itemIndex) throws XMPException
XMPMetagetArrayItem in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().itemIndex - The index of the desired item. Arrays in XMP are indexed from 1. The
constant XMPConst.ARRAY_LAST_ITEM always refers to the last existing array
item.XMPProperty containing the value and the options or
null if the property does not exist.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.getArrayItem(String, String, int)public XMPProperty getLocalizedText(String schemaNS, String altTextName, String genericLang, String specificLang) throws XMPException
XMPMetaNote: RFC 3066 language tags must be treated in a case insensitive manner. The XMP Toolkit does this by normalizing their capitalization:
getLocalizedText returns information about a selected item in
an alt-text array. The array item is selected according to the rules given above.
Note: In a future version of this API a method
using Java java.lang.Locale will be added.getLocalizedText in interface XMPMetaschemaNS - The namespace URI for the alt-text array. Has the same usage as in
getProperty().altTextName - The name of the alt-text array. May be a general path expression, must not
be null or the empty string. Has the same namespace prefix usage as
propName in getProperty().genericLang - The name of the generic language as an RFC 3066 primary subtag. May be
null or the empty string if no generic language is wanted.specificLang - The name of the specific language as an RFC 3066 tag. Must not be
null or the empty string.XMPProperty containing the value, the actual language and
the options if an appropriate alternate collection item exists, null
if the property.
does not exist.XMPExceptionXMPMeta.getLocalizedText(String, String, String, String)public void setLocalizedText(String schemaNS, String altTextName, String genericLang, String specificLang, String itemValue, PropertyOptions options) throws XMPException
XMPMetajava.lang.Locale will be added.setLocalizedText in interface XMPMetaschemaNS - The namespace URI for the alt-text array. Has the same usage as in
getProperty().altTextName - The name of the alt-text array. May be a general path expression, must not
be null or the empty string. Has the same namespace prefix usage as
propName in getProperty().genericLang - The name of the generic language as an RFC 3066 primary subtag. May be
null or the empty string if no generic language is wanted.specificLang - The name of the specific language as an RFC 3066 tag. Must not be
null or the empty string.itemValue - A pointer to the null terminated UTF-8 string that is the new
value for the appropriate array item.options - Option flags, none are defined at present.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.setLocalizedText(String, String, String, String, String,
PropertyOptions)public void setLocalizedText(String schemaNS, String altTextName, String genericLang, String specificLang, String itemValue) throws XMPException
setLocalizedText in interface XMPMetaschemaNS - The namespace URI for the alt-text arrayaltTextName - The name of the alt-text arraygenericLang - The name of the generic languagespecificLang - The name of the specific languageitemValue - the new value for the appropriate array itemXMPException - Wraps all errors and exceptionsXMPMeta.setLocalizedText(String, String, String, String, String)public XMPProperty getProperty(String schemaNS, String propName) throws XMPException
XMPMeta
All of the functions return an object inherited from PropertyBase or
null if the property does not exists. The result object contains the value of
the property and option flags describing the property. Arrays and the non-leaf levels of
nodes do not have values.
See PropertyOptions for detailed information about the options.
This is the simplest property getter, mainly for top level simple properties or after using the path composition functions in XMPPathFactory.
getProperty in interface XMPMetaschemaNS - The namespace URI for the property. May be null or the empty
string if the first component of the propName path contains a namespace prefix. The
URI must be for a registered namespace.propName - The name of the property. May be a general path expression, must not be
null or the empty string. Using a namespace prefix on the first
component is optional. If present without a schemaNS value then the prefix specifies
the namespace. The prefix must be for a registered namespace. If both a schemaNS URI
and propName prefix are present, they must be corresponding parts of a registered
namespace.XMPProperty containing the value and the options or
null if the property does not exist.XMPExceptionXMPMeta.getProperty(String, String)protected XMPProperty getProperty(String schemaNS, String propName, int valueType) throws XMPException
VALUE_STRING, VALUE_BOOLEAN,
VALUE_INTEGER, VALUE_LONG,
VALUE_DOUBLE, VALUE_DATE,
VALUE_CALENDAR, VALUE_BASE64.schemaNS - a schema namespacepropName - a property name or pathvalueType - the type of the value, see VALUE_...XMPPropertyXMPException - Collects any exception that occurs.XMPMeta.getProperty(String, String)protected Object getPropertyObject(String schemaNS, String propName, int valueType) throws XMPException
schemaNS - a schema namespacepropName - a property name or pathvalueType - the type of the value, see VALUE_...valueType.XMPException - Collects any exception that occurs.XMPMeta.getProperty(String, String)public Boolean getPropertyBoolean(String schemaNS, String propName) throws XMPException
XMPMetagetProperty() and SetProperty() above,
but the value is returned or provided in a literal form instead of as a UTF-8 string.
The path composition functions in XMPPathFactory may be used to compose an path
expression for fields in nested structures, items in arrays, or qualifiers.getPropertyBoolean in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().Boolean value or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyBoolean(String, String)public void setPropertyBoolean(String schemaNS, String propName, boolean propValue, PropertyOptions options) throws XMPException
XMPMetaboolean value.setPropertyBoolean in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the literal property value as boolean.options - options of the property to set (optional).XMPExceptionXMPMeta.setPropertyBoolean(String, String, boolean, PropertyOptions)public void setPropertyBoolean(String schemaNS, String propName, boolean propValue) throws XMPException
setPropertyBoolean in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the literal property value as booleanXMPException - Wraps all exceptionsXMPMeta.setPropertyBoolean(String, String, boolean)public Integer getPropertyInteger(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyInteger in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().Integer value or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyInteger(String, String)public void setPropertyInteger(String schemaNS, String propName, int propValue, PropertyOptions options) throws XMPException
XMPMetaint value.setPropertyInteger in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the literal property value as int.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyInteger(String, String, int, PropertyOptions)public void setPropertyInteger(String schemaNS, String propName, int propValue) throws XMPException
setPropertyInteger in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the literal property value as intXMPException - Wraps all exceptionsXMPMeta.setPropertyInteger(String, String, int)public Long getPropertyLong(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyLong in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().Long value or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyLong(String, String)public void setPropertyLong(String schemaNS, String propName, long propValue, PropertyOptions options) throws XMPException
XMPMetalong value.setPropertyLong in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the literal property value as long.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyLong(String, String, long, PropertyOptions)public void setPropertyLong(String schemaNS, String propName, long propValue) throws XMPException
setPropertyLong in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the literal property value as longXMPException - Wraps all exceptionsXMPMeta.setPropertyLong(String, String, long)public Double getPropertyDouble(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyDouble in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().Double value or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyDouble(String, String)public void setPropertyDouble(String schemaNS, String propName, double propValue, PropertyOptions options) throws XMPException
XMPMetadouble value.setPropertyDouble in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the literal property value as double.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyDouble(String, String, double, PropertyOptions)public void setPropertyDouble(String schemaNS, String propName, double propValue) throws XMPException
setPropertyDouble in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the literal property value as doubleXMPException - Wraps all exceptionsXMPMeta.setPropertyDouble(String, String, double)public XMPDateTime getPropertyDate(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyDate in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().XMPDateTime-object or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyDate(String, String)public void setPropertyDate(String schemaNS, String propName, XMPDateTime propValue, PropertyOptions options) throws XMPException
XMPMetasetPropertyDate in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the property value as XMPDateTime.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyDate(String, String, XMPDateTime,
PropertyOptions)public void setPropertyDate(String schemaNS, String propName, XMPDateTime propValue) throws XMPException
setPropertyDate in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the property value as XMPDateTimeXMPException - Wraps all exceptionsXMPMeta.setPropertyDate(String, String, XMPDateTime)public Calendar getPropertyCalendar(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyCalendar in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().Calendar-object or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyCalendar(String, String)public void setPropertyCalendar(String schemaNS, String propName, Calendar propValue, PropertyOptions options) throws XMPException
XMPMetasetPropertyCalendar in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the property value as Java Calendar.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyCalendar(String, String, Calendar,
PropertyOptions)public void setPropertyCalendar(String schemaNS, String propName, Calendar propValue) throws XMPException
setPropertyCalendar in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the property value as CalendarXMPException - Wraps all exceptionsXMPMeta.setPropertyCalendar(String, String, Calendar)public byte[] getPropertyBase64(String schemaNS, String propName) throws XMPException
XMPMetagetPropertyBase64 in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().byte[]-array contained the decoded base64 value
or null if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyBase64(String, String)public String getPropertyString(String schemaNS, String propName) throws XMPException
XMPMetasetPropertyString(),
because setProperty() sets a string value.getPropertyString in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
getProperty().propName - The name of the property.
Has the same usage as in getProperty().String value or null
if the property does not exist.XMPException - Wraps all exceptions that may occur,
especially conversion errors.XMPMeta.getPropertyString(String, String)public void setPropertyBase64(String schemaNS, String propName, byte[] propValue, PropertyOptions options) throws XMPException
XMPMetabyte[]-array,
which is serialized as base64-string.setPropertyBase64 in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in
setProperty().propName - The name of the property.
Has the same usage as in getProperty().propValue - the literal property value as byte array.options - options of the property to set (optional).XMPException - Wraps all exceptions that may occur.XMPMeta.setPropertyBase64(String, String, byte[], PropertyOptions)public void setPropertyBase64(String schemaNS, String propName, byte[] propValue) throws XMPException
setPropertyBase64 in interface XMPMetaschemaNS - The namespace URI for the propertypropName - The name of the propertypropValue - the literal property value as byte arrayXMPException - Wraps all exceptionsXMPMeta.setPropertyBase64(String, String, byte[])public XMPProperty getQualifier(String schemaNS, String propName, String qualNS, String qualName) throws XMPException
XMPMetaThe names of qualifiers should be XML qualified names, that is within an XML namespace. The path syntax for a qualified name uses the namespace prefix. This is unreliable since the prefix is never guaranteed. The URI is the formal name, the prefix is just a local shorthand in a given sequence of XML text.
Note: Qualifiers are only supported for simple leaf properties at this time.
getQualifier in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in getProperty.propName - The name of the property to which the qualifier is attached. May be a general
path expression, must not be null or the empty string. Has the same
namespace prefix usage as in getProperty().qualNS - The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNS parameter.qualName - The name of the qualifier. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
propName parameter.XMPProperty containing the value and the options of the
qualifier or null if the property does not exist. The name of the
qualifier must be a single XML name, must not be null or the empty
string. Has the same namespace prefix usage as the propName parameter.
The value of the qualifier is only set if it has one (Arrays and non-leaf levels of structs do not have values).
XMPExceptionXMPMeta.getQualifier(String, String, String, String)public XMPProperty getStructField(String schemaNS, String structName, String fieldNS, String fieldName) throws XMPException
XMPMetaThe names of fields should be XML qualified names, that is within an XML namespace. The path syntax for a qualified name uses the namespace prefix. This is unreliable since the prefix is never guaranteed. The URI is the formal name, the prefix is just a local shorthand in a given sequence of XML text.
getStructField in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in getProperty.structName - The name of the struct. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty().fieldNS - The namespace URI for the field. Has the same URI and prefix usage as the
schemaNS parameter.fieldName - The name of the field. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
structName parameter.XMPProperty containing the value and the options or
null if the property does not exist. Arrays and non-leaf levels of
structs do not have values.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.getStructField(String, String, String, String)public XMPIterator iterator() throws XMPException
XMPMetaiterator in interface XMPMetaXMPIterator.XMPExceptionXMPMeta.iterator()public XMPIterator iterator(IteratorOptions options) throws XMPException
XMPMetaiterator in interface XMPMetaoptions - Option flags to control the iteration.XMPIterator.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.iterator(IteratorOptions)public XMPIterator iterator(String schemaNS, String propName, IteratorOptions options) throws XMPException
XMPMetaiterator in interface XMPMetaschemaNS - Optional schema namespace URI to restrict the iteration. Omitted (visit all
schema) by passing null or empty String.propName - Optional property name to restrict the iteration. May be an arbitrary path
expression. Omitted (visit all properties) by passing null or empty
String. If no schema URI is given, it is ignored.options - Option flags to control the iteration. See IteratorOptions for
details.XMPIterator for this XMPMeta-object
considering the given options.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.iterator(String, String, IteratorOptions)public void setArrayItem(String schemaNS, String arrayName, int itemIndex, String itemValue, PropertyOptions options) throws XMPException
XMPMetasetArrayItem in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty.itemIndex - The index of the desired item. Arrays in XMP are indexed from 1. To address
the last existing item, use XMPMeta.countArrayItems(String, String) to find
out the length of the array.itemValue - the new value of the array item. Has the same usage as propValue in
setProperty().options - the set options for the item.XMPExceptionXMPMeta.setArrayItem(String, String, int, String, PropertyOptions)public void setArrayItem(String schemaNS, String arrayName, int itemIndex, String itemValue) throws XMPException
setArrayItem in interface XMPMetaschemaNS - The namespace URIarrayName - The name of the arrayitemIndex - The index to insert the new itemitemValue - the new value of the array itemXMPException - Wraps all errors and exceptionsXMPMeta.setArrayItem(String, String, int, String)public void insertArrayItem(String schemaNS, String arrayName, int itemIndex, String itemValue, PropertyOptions options) throws XMPException
XMPMetainsertArrayItem in interface XMPMetaschemaNS - The namespace URI for the array. Has the same usage as in getProperty.arrayName - The name of the array. May be a general path expression, must not be
null or the empty string. Has the same namespace prefix usage as
propName in getProperty.itemIndex - The index to insert the new item. Arrays in XMP are indexed from 1. Use
XMPConst.ARRAY_LAST_ITEM to append items.itemValue - the new value of the array item. Has the same usage as
propValue in setProperty().options - the set options that decide about the kind of the node.XMPExceptionXMPMeta.insertArrayItem(String, String, int, String,
PropertyOptions)public void insertArrayItem(String schemaNS, String arrayName, int itemIndex, String itemValue) throws XMPException
insertArrayItem in interface XMPMetaschemaNS - The namespace URI for the arrayarrayName - The name of the arrayitemIndex - The index to insert the new itemitemValue - the value of the array itemXMPException - Wraps all errors and exceptionsXMPMeta.insertArrayItem(String, String, int, String)public void setProperty(String schemaNS, String propName, Object propValue, PropertyOptions options) throws XMPException
XMPMetasetters all take a property specification, their
differences are in the form of this. The first two parameters are always the top level
namespace URI (the schema namespace) and the basic name of the property being
referenced. See the introductory discussion of path expression usage for more information.
All of the functions take a string value for the property and option flags describing the property. The value must be Unicode in UTF-8 encoding. Arrays and non-leaf levels of structs do not have values. Empty arrays and structs may be created using appropriate option flags. All levels of structs that is assigned implicitly are created if necessary. appendArayItem implicitly creates the named array if necessary.
See PropertyOptions for detailed information about the options.
This is the simplest property setter, mainly for top level simple properties or after using
the path composition functions in XMPPathFactory.
setProperty in interface XMPMetaschemaNS - The namespace URI for the property. Has the same usage as in getProperty.propName - The name of the property.
Has the same usage as in getProperty().propValue - the value for the property (only leaf properties have a value).
Arrays and non-leaf levels of structs do not have values.
Must be null if the value is not relevant.toString() is called.options - Option flags describing the property. See the earlier description.XMPExceptionXMPMeta.setProperty(String, String, Object, PropertyOptions)public void setProperty(String schemaNS, String propName, Object propValue) throws XMPException
setProperty in interface XMPMetaschemaNS - The namespace URIpropName - The name of the propertypropValue - the value for the propertyXMPException - Wraps all errors and exceptionsXMPMeta.setProperty(String, String, Object)public void setQualifier(String schemaNS, String propName, String qualNS, String qualName, String qualValue, PropertyOptions options) throws XMPException
XMPMetasetQualifier in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in getProperty.propName - The name of the property to which the qualifier is attached. Has the same
usage as in getProperty.qualNS - The namespace URI for the qualifier. Has the same URI and prefix usage as the
schemaNS parameter.qualName - The name of the qualifier. Must be a single XML name, must not be
null or the empty string. Has the same namespace prefix usage as the
propName parameter.qualValue - A pointer to the null terminated UTF-8 string that is the
value of the qualifier, if the qualifier has a value. Has the same usage as propValue
in getProperty.options - Option flags describing the qualifier. See the earlier description.XMPExceptionXMPMeta.setQualifier(String, String, String, String, String,
PropertyOptions)public void setQualifier(String schemaNS, String propName, String qualNS, String qualName, String qualValue) throws XMPException
setQualifier in interface XMPMetaschemaNS - The namespace URI for the structpropName - The name of the property to which the qualifier is attachedqualNS - The namespace URI for the qualifierqualName - The name of the qualifierqualValue - the value of the qualifierXMPException - Wraps all errors and exceptionsXMPMeta.setQualifier(String, String, String, String, String)public void setStructField(String schemaNS, String structName, String fieldNS, String fieldName, String fieldValue, PropertyOptions options) throws XMPException
XMPMetasetStructField in interface XMPMetaschemaNS - The namespace URI for the struct. Has the same usage as in getProperty.structName - The name of the struct. May be a general path expression, must not be null
or the empty string. Has the same namespace prefix usage as propName in getProperty.fieldNS - The namespace URI for the field. Has the same URI and prefix usage as the
schemaNS parameter.fieldName - The name of the field. Must be a single XML name, must not be null or the
empty string. Has the same namespace prefix usage as the structName parameter.fieldValue - the value of thefield, if the field has a value.
Has the same usage as propValue in getProperty.options - Option flags describing the field. See the earlier description.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.setStructField(String, String, String, String, String,
PropertyOptions)public void setStructField(String schemaNS, String structName, String fieldNS, String fieldName, String fieldValue) throws XMPException
setStructField in interface XMPMetaschemaNS - The namespace URI for the structstructName - The name of the structfieldNS - The namespace URI for the fieldfieldName - The name of the fieldfieldValue - the value of the fieldXMPException - Wraps all errors and exceptionsXMPMeta.setStructField(String, String, String, String, String)public String getObjectName()
XMPMetagetObjectName in interface XMPMetaXMPMeta.getObjectName()public void setObjectName(String name)
setObjectName in interface XMPMetaname - Sets the name of the XMP object.XMPMeta.setObjectName(String)public String getPacketHeader()
getPacketHeader in interface XMPMetanull is returned.XMPMeta.getPacketHeader()public void setPacketHeader(String packetHeader)
packetHeader - the processing instruction contentpublic Object clone()
clone in interface XMPMetaclone in class ObjectObject.clone()public String dumpObject()
XMPMetadumpObject in interface XMPMetaXMPMeta.dumpObject()public void sort()
XMPMetasort in interface XMPMetaXMPMeta.sort()public void normalize(ParseOptions options) throws XMPException
XMPMetaParseOptions.OMIT_NORMALIZATION is set to true.
Note: It does no harm to call this method to an already normalized xmp object.
It was a PDF/A requirement to get hand on the unnormalized XMPMeta object.normalize in interface XMPMetaoptions - optional parsing options.XMPException - Wraps all errors and exceptions that may occur.XMPMeta.normalize(ParseOptions)public com.itextpdf.xmp.impl.XMPNode getRoot()
Copyright © 2020. All rights reserved.