Interface XMPMeta
This class represents the set of XMP metadata as a DOM representation.
public interface XMPMeta
Remarks
This class represents the set of XMP metadata as a DOM representation. It has methods to read and
modify all kinds of properties, create an iterator over all properties and serialize the metadata
to a String, byte-array or OutputStream
.
Methods
AppendArrayItem(string, string, string)
void AppendArrayItem(string schemaNS, string arrayName, string itemValue)
Parameters
schemaNS
stringThe namespace URI for the array
arrayName
stringThe name of the array
itemValue
stringthe value of the array item
- See Also
AppendArrayItem(string, string, PropertyOptions, string, PropertyOptions)
Simplifies the construction of an array by not requiring that you pre-create an empty array.
void AppendArrayItem(string schemaNS, string arrayName, PropertyOptions arrayOptions, string itemValue, PropertyOptions itemOptions)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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
PropertyOptionsOption flags describing the array form. The only valid options are
Note: the array options only need to be provided if the array is not already existing, otherwise you can set them tonull
or use AppendArrayItem(string, string, string).itemValue
stringthe value of the array item. Has the same usage as propValue in getProperty.
itemOptions
PropertyOptionsOption flags describing the item to append ( PropertyOptions )
Remarks
Simplifies the construction of an array by not requiring that you pre-create an empty array. The array that is assigned is created automatically if it does not yet exist. Each call to appendArrayItem() appends an item to the array. The corresponding parameters have the same use as setArrayItem(). The arrayOptions parameter is used to specify what kind of array. If the array exists, it must have the specified form.
Clone()
Clones the complete metadata tree.
object Clone()
Returns
- object
Returns a deep copy of this instance.
CountArrayItems(string, string)
Returns the number of items in the array.
int CountArrayItems(string schemaNS, string arrayName)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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 ingetProperty()
.
Returns
- int
Returns the number of items in the array.
DeleteArrayItem(string, string, int)
Deletes the given XMP subtree rooted at the given array item.
void DeleteArrayItem(string schemaNS, string arrayName, int itemIndex)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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 ingetProperty()
.itemIndex
intThe 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.
Remarks
Deletes the given XMP subtree rooted at the given array item. It is not an error if the array item does not exist.
DeleteProperty(string, string)
Deletes the given XMP subtree rooted at the given property.
void DeleteProperty(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in getProperty.
Remarks
Deletes the given XMP subtree rooted at the given property. It is not an error if the property does not exist.
DeleteQualifier(string, string, string, string)
Deletes the given XMP subtree rooted at the given qualifier.
void DeleteQualifier(string schemaNS, string propName, string qualNS, string qualName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in
getProperty()
.propName
stringThe name of the property to which the qualifier is attached. Has the same usage as in getProperty.
qualNS
stringThe namespace URI for the qualifier. Has the same URI and prefix usage as the schemaNS parameter.
qualName
stringThe 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.
Remarks
Deletes the given XMP subtree rooted at the given qualifier. It is not an error if the qualifier does not exist.
DeleteStructField(string, string, string, string)
Deletes the given XMP subtree rooted at the given struct field.
void DeleteStructField(string schemaNS, string structName, string fieldNS, string fieldName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in
getProperty()
.structName
stringThe 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
stringThe namespace URI for the field. Has the same URI and prefix usage as the schemaNS parameter.
fieldName
stringThe 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.
Remarks
Deletes the given XMP subtree rooted at the given struct field. It is not an error if the field does not exist.
DoesArrayItemExist(string, string, int)
Tells if the array item exists.
bool DoesArrayItemExist(string schemaNS, string arrayName, int itemIndex)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in
getProperty()
.arrayName
stringThe 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 ingetProperty()
.itemIndex
intThe 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.
Returns
- bool
Returns
true
if the array exists,false
otherwise.
DoesPropertyExist(string, string)
Returns whether the property exists.
bool DoesPropertyExist(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- bool
Returns true if the property exists.
DoesQualifierExist(string, string, string, string)
DoesQualifierExist tells if the qualifier exists.
bool DoesQualifierExist(string schemaNS, string propName, string qualNS, string qualName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in
getProperty()
.propName
stringThe name of the property to which the qualifier is attached. Has the same usage as in
getProperty()
.qualNS
stringThe namespace URI for the qualifier. Has the same URI and prefix usage as the schemaNS parameter.
qualName
stringThe 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.
Returns
- bool
Returns true if the qualifier exists.
DoesStructFieldExist(string, string, string, string)
DoesStructFieldExist tells if the struct field exists.
bool DoesStructFieldExist(string schemaNS, string structName, string fieldNS, string fieldName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in
getProperty()
.structName
stringThe 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 ingetProperty()
.fieldNS
stringThe namespace URI for the field. Has the same URI and prefix usage as the schemaNS parameter.
fieldName
stringThe 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.
Returns
- bool
Returns true if the field exists.
DumpObject()
Renders this node and the tree unter this node in a human readable form.
string DumpObject()
Returns
- string
Returns a multiline string containing the dump.
GetArrayItem(string, string, int)
Provides access to items within an array.
XMPProperty GetArrayItem(string schemaNS, string arrayName, int itemIndex)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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 ingetProperty()
.itemIndex
intThe index of the desired item. Arrays in XMP are indexed from 1. The constant ARRAY_LAST_ITEM always refers to the last existing array item.
Returns
- XMPProperty
Returns a
XMPProperty
containing the value and the options ornull
if the property does not exist.
Remarks
Provides access to items within an array. The index is passed as an integer, you need not worry about the path string syntax for array items, convert a loop index to a string, etc.
GetLocalizedText(string, string, string, string)
These functions provide convenient support for localized text properties, including a number of special and obscure aspects.
XMPProperty GetLocalizedText(string schemaNS, string altTextName, string genericLang, string specificLang)
Parameters
schemaNS
stringThe namespace URI for the alt-text array. Has the same usage as in
getProperty()
.altTextName
stringThe 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 ingetProperty()
.genericLang
stringThe 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
stringThe name of the specific language as an RFC 3066 tag. Must not be
null
or the empty string.
Returns
- XMPProperty
Returns an
XMPProperty
containing the value, the actual language and the options if an appropriate alternate collection item exists,null
if the property. does not exist.
Remarks
These functions provide convenient support for localized text properties, including a number of special and obscure aspects. Localized text properties are stored in alt-text arrays. They allow multiple concurrent localizations of a property value, for example a document title or copyright in several languages. The most important aspect of these functions is that they select an appropriate array item based on one or two RFC 3066 language tags. One of these languages, the "specific" language, is preferred and selected if there is an exact match. For many languages it is also possible to define a "generic" language that may be used if there is no specific language match. The generic language must be a valid RFC 3066 primary subtag, or the empty string. For example, a specific language of "en-US" should be used in the US, and a specific language of "en-UK" should be used in England. It is also appropriate to use "en" as the generic language in each case. If a US document goes to England, the "en-US" title is selected by using the "en" generic language and the "en-UK" specific language. It is considered poor practice, but allowed, to pass a specific language that is just an RFC 3066 primary tag. For example "en" is not a good specific language, it should only be used as a generic language. Passing "i" or "x" as the generic language is also considered poor practice but allowed. Advice from the W3C about the use of RFC 3066 language tags can be found at: http://www.w3.org/International/articles/language-tags/
Note: RFC 3066 language tags must be treated in a case insensitive manner. The XMP Toolkit does this by normalizing their capitalization:- The primary subtag is lower case, the suggested practice of ISO 639.
- All 2 letter secondary subtags are upper case, the suggested practice of ISO 3166.
- All other subtags are lower case. The XMP specification defines an artificial language,
- "x-default", that is used to explicitly denote a default item in an alt-text array.
- Look for an exact match with the specific language.
- If a generic language is given, look for a partial match.
- Look for an x-default item.
- Choose the first item.
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.
GetObjectName()
This correlates to the about-attribute, returns the empty String if no name is set.
string GetObjectName()
Returns
- string
Returns the name of the XMP object.
GetPacketHeader()
string GetPacketHeader()
Returns
- string
Returns the unparsed content of the <?xpacket> processing instruction. This contains normally the attribute-like elements 'begin="<BOM>" id="W5M0MpCehiHzreSzNTczkc9d"' and possibly the deprecated elements 'bytes="1234"' or 'encoding="XXX"'. If the parsed packet has not been wrapped into an xpacket,
null
is returned.
GetProperty(string, string)
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.
XMPProperty GetProperty(string schemaNS, string propName)
Parameters
schemaNS
stringThe 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
stringThe 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.
Returns
- XMPProperty
Returns a
XMPProperty
containing the value and the options ornull
if the property does not exist.
Remarks
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. See the introductory discussion of path expression usage for more information.
All of the functions return an object inherited fromPropertyBase
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.
GetPropertyBase64(string, string)
Convenience method to retrieve the literal value of a property.
byte[] GetPropertyBase64(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- byte[]
Returns a
byte[]
-array contained the decoded base64 value ornull
if the property does not exist.
GetPropertyBoolean(string, string)
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.
bool? GetPropertyBoolean(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- bool?
Returns a
Boolean
value ornull
if the property does not exist.
Remarks
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.
The path composition functions in XMPPathFactory
may be used to compose an path
expression for fields in nested structures, items in arrays, or qualifiers.
GetPropertyCalendar(string, string)
Convenience method to retrieve the literal value of a property.
DateTime GetPropertyCalendar(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- DateTime
Returns a Java
Calendar
-object ornull
if the property does not exist.
GetPropertyDate(string, string)
Convenience method to retrieve the literal value of a property.
XMPDateTime GetPropertyDate(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- XMPDateTime
Returns a
XMPDateTime
-object ornull
if the property does not exist.
GetPropertyDouble(string, string)
Convenience method to retrieve the literal value of a property.
double? GetPropertyDouble(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- double?
Returns a
Double
value ornull
if the property does not exist.
GetPropertyInteger(string, string)
Convenience method to retrieve the literal value of a property.
int? GetPropertyInteger(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- int?
Returns an
Integer
value ornull
if the property does not exist.
GetPropertyLong(string, string)
Convenience method to retrieve the literal value of a property.
long? GetPropertyLong(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- long?
Returns a
Long
value ornull
if the property does not exist.
GetPropertyString(string, string)
Convenience method to retrieve the literal value of a property.
string GetPropertyString(string schemaNS, string propName)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
getProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.
Returns
- string
Returns a
String
value ornull
if the property does not exist.
Remarks
Convenience method to retrieve the literal value of a property.
Note: There is no setPropertyString()
,
because setProperty()
sets a string value.
GetQualifier(string, string, string, string)
Provides access to a qualifier attached to a property.
XMPProperty GetQualifier(string schemaNS, string propName, string qualNS, string qualName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in getProperty.
propName
stringThe 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 ingetProperty()
.qualNS
stringThe namespace URI for the qualifier. Has the same URI and prefix usage as the schemaNS parameter.
qualName
stringThe 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.
Returns
- XMPProperty
Returns a
The value of the qualifier is only set if it has one (Arrays and non-leaf levels of structs do not have values).XMPProperty
containing the value and the options of the qualifier ornull
if the property does not exist. The name of the qualifier must be a single XML name, must not benull
or the empty string. Has the same namespace prefix usage as the propName parameter.
Remarks
Provides access to a qualifier attached to a property. The namespace for the qualifier is passed as a URI, you need not worry about the path string syntax. In many regards qualifiers are like struct fields. See the introductory discussion of qualified properties for more information.
The 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.GetStructField(string, string, string, string)
Provides access to fields within a nested structure.
XMPProperty GetStructField(string schemaNS, string structName, string fieldNS, string fieldName)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in getProperty.
structName
stringThe 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 ingetProperty()
.fieldNS
stringThe namespace URI for the field. Has the same URI and prefix usage as the schemaNS parameter.
fieldName
stringThe 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.
Returns
- XMPProperty
Returns a
XMPProperty
containing the value and the options ornull
if the property does not exist. Arrays and non-leaf levels of structs do not have values.
Remarks
Provides access to fields within a nested structure. The namespace for the field is passed as a URI, you need not worry about the path string syntax.
The 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.InsertArrayItem(string, string, int, string)
void InsertArrayItem(string schemaNS, string arrayName, int itemIndex, string itemValue)
Parameters
schemaNS
stringThe namespace URI for the array
arrayName
stringThe name of the array
itemIndex
intThe index to insert the new item
itemValue
stringthe value of the array item
- See Also
InsertArrayItem(string, string, int, string, PropertyOptions)
Inserts an item into an array previous to the given index.
void InsertArrayItem(string schemaNS, string arrayName, int itemIndex, string itemValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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
intThe index to insert the new item. Arrays in XMP are indexed from 1. Use
XMPConst.ARRAY_LAST_ITEM
to append items.itemValue
stringthe new value of the array item. Has the same usage as propValue in
setProperty()
.options
PropertyOptionsthe set options that decide about the kind of the node.
Remarks
Inserts an item into an array previous to the given index. The index is passed as an integer, you need not worry about the path string syntax for array items, convert a loop index to a string, etc. The array passed must already exist. In normal usage the selected array item is modified. A new item is automatically appended if the index is the array size plus 1.
Iterator()
Constructs an iterator for the properties within this XMP object.
XMPIterator Iterator()
Returns
- XMPIterator
Returns an
XMPIterator
.
- See Also
Iterator(string, string, IteratorOptions)
Construct an iterator for the properties within an XMP object.
XMPIterator Iterator(string schemaNS, string propName, IteratorOptions options)
Parameters
schemaNS
stringOptional schema namespace URI to restrict the iteration. Omitted (visit all schema) by passing
null
or empty String.propName
stringOptional 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
IteratorOptionsOption flags to control the iteration. See IteratorOptions for details.
Returns
- XMPIterator
Returns an
XMPIterator
for thisXMPMeta
-object considering the given options.
Remarks
Construct an iterator for the properties within an XMP object. According to the parameters it iterates the entire data tree, properties within a specific schema, or a subtree rooted at a specific node.
Iterator(IteratorOptions)
Constructs an iterator for the properties within this XMP object using some options.
XMPIterator Iterator(IteratorOptions options)
Parameters
options
IteratorOptionsOption flags to control the iteration.
Returns
- XMPIterator
Returns an
XMPIterator
.
- See Also
Normalize(ParseOptions)
Perform the normalization as a separate parsing step.
void Normalize(ParseOptions options)
Parameters
options
ParseOptionsoptional parsing options.
Remarks
Perform the normalization as a separate parsing step.
Normally it is done during parsing, unless the parsing option
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.
SetArrayItem(string, string, int, string)
void SetArrayItem(string schemaNS, string arrayName, int itemIndex, string itemValue)
Parameters
schemaNS
stringThe namespace URI
arrayName
stringThe name of the array
itemIndex
intThe index to insert the new item
itemValue
stringthe new value of the array item
- See Also
SetArrayItem(string, string, int, string, PropertyOptions)
Replaces an item within an array.
void SetArrayItem(string schemaNS, string arrayName, int itemIndex, string itemValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the array. Has the same usage as in getProperty.
arrayName
stringThe 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
intThe index of the desired item. Arrays in XMP are indexed from 1. To address the last existing item, use CountArrayItems(string, string) to find out the length of the array.
itemValue
stringthe new value of the array item. Has the same usage as propValue in
setProperty()
.options
PropertyOptionsthe set options for the item.
Remarks
Replaces an item within an array. The index is passed as an integer, you need not worry about the path string syntax for array items, convert a loop index to a string, etc. The array passed must already exist. In normal usage the selected array item is modified. A new item is automatically appended if the index is the array size plus 1.
SetLocalizedText(string, string, string, string, string)
void SetLocalizedText(string schemaNS, string altTextName, string genericLang, string specificLang, string itemValue)
Parameters
schemaNS
stringThe namespace URI for the alt-text array
altTextName
stringThe name of the alt-text array
genericLang
stringThe name of the generic language
specificLang
stringThe name of the specific language
itemValue
stringthe new value for the appropriate array item
- See Also
SetLocalizedText(string, string, string, string, string, PropertyOptions)
Modifies the value of a selected item in an alt-text array.
void SetLocalizedText(string schemaNS, string altTextName, string genericLang, string specificLang, string itemValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the alt-text array. Has the same usage as in
getProperty()
.altTextName
stringThe 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 ingetProperty()
.genericLang
stringThe 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
stringThe name of the specific language as an RFC 3066 tag. Must not be
null
or the empty string.itemValue
stringA pointer to the
null
terminated UTF-8 string that is the new value for the appropriate array item.options
PropertyOptionsOption flags, none are defined at present.
Remarks
Modifies the value of a selected item in an alt-text array. Creates an appropriate array item
if necessary, and handles special cases for the x-default item. If the selected item is from
a match with the specific language, the value of that item is modified. If the existing value
of that item matches the existing value of the x-default item, the x-default item is also
modified. If the array only has 1 existing item (which is not x-default), an x-default item
is added with the given value. If the selected item is from a match with the generic language
and there are no other generic matches, the value of that item is modified. If the existing
value of that item matches the existing value of the x-default item, the x-default item is
also modified. If the array only has 1 existing item (which is not x-default), an x-default
item is added with the given value. If the selected item is from a partial match with the
generic language and there are other partial matches, a new item is created for the specific
language. The x-default item is not modified. If the selected item is from the last 2 rules
then a new item is created for the specific language. If the array only had an x-default
item, the x-default item is also modified. If the array was empty, items are created for the
specific language and x-default.
Note: In a future version of this API a method
using Java java.lang.Locale
will be added.
SetObjectName(string)
void SetObjectName(string name)
Parameters
name
stringSets the name of the XMP object.
SetProperty(string, string, object)
void SetProperty(string schemaNS, string propName, object propValue)
Parameters
schemaNS
stringThe namespace URI
propName
stringThe name of the property
propValue
objectthe value for the property
- See Also
SetProperty(string, string, object, PropertyOptions)
The property value setters
all take a property specification, their
differences are in the form of this.
void SetProperty(string schemaNS, string propName, object propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in getProperty.
propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
objectthe 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.
The value is automatically detected: Boolean, Integer, Long, Double, XMPDateTime and byte[] are handled, on all othertoString()
is called.options
PropertyOptionsOption flags describing the property. See the earlier description.
Remarks
The property value setters
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.
SetPropertyBase64(string, string, byte[])
void SetPropertyBase64(string schemaNS, string propName, byte[] propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
byte[]the literal property value as byte array
- See Also
SetPropertyBase64(string, string, byte[], PropertyOptions)
Convenience method to set a property from a binary byte[]
-array,
which is serialized as base64-string.
void SetPropertyBase64(string schemaNS, string propName, byte[] propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
byte[]the literal property value as byte array.
options
PropertyOptionsoptions of the property to set (optional).
SetPropertyBoolean(string, string, bool)
void SetPropertyBoolean(string schemaNS, string propName, bool propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
boolthe literal property value as
boolean
- See Also
SetPropertyBoolean(string, string, bool, PropertyOptions)
Convenience method to set a property to a literal boolean
value.
void SetPropertyBoolean(string schemaNS, string propName, bool propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
boolthe literal property value as
boolean
.options
PropertyOptionsoptions of the property to set (optional).
SetPropertyCalendar(string, string, DateTime)
void SetPropertyCalendar(string schemaNS, string propName, DateTime propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
DateTimethe property value as
Calendar
- See Also
SetPropertyCalendar(string, string, DateTime, PropertyOptions)
Convenience method to set a property with a Java Calendar-object, which is serialized to an ISO8601 date.
void SetPropertyCalendar(string schemaNS, string propName, DateTime propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
DateTimethe property value as Java
Calendar
.options
PropertyOptionsoptions of the property to set (optional).
SetPropertyDate(string, string, XMPDateTime)
void SetPropertyDate(string schemaNS, string propName, XMPDateTime propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
XMPDateTimethe property value as
XMPDateTime
- See Also
SetPropertyDate(string, string, XMPDateTime, PropertyOptions)
Convenience method to set a property with an XMPDateTime-object, which is serialized to an ISO8601 date.
void SetPropertyDate(string schemaNS, string propName, XMPDateTime propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
XMPDateTimethe property value as
XMPDateTime
.options
PropertyOptionsoptions of the property to set (optional).
SetPropertyDouble(string, string, double)
void SetPropertyDouble(string schemaNS, string propName, double propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
doublethe literal property value as
double
- See Also
SetPropertyDouble(string, string, double, PropertyOptions)
Convenience method to set a property to a literal double
value.
void SetPropertyDouble(string schemaNS, string propName, double propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
doublethe literal property value as
double
.options
PropertyOptionsoptions of the property to set (optional).
SetPropertyInteger(string, string, int)
void SetPropertyInteger(string schemaNS, string propName, int propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
intthe literal property value as
int
- See Also
SetPropertyInteger(string, string, int, PropertyOptions)
Convenience method to set a property to a literal int
value.
void SetPropertyInteger(string schemaNS, string propName, int propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
intthe literal property value as
int
.options
PropertyOptionsoptions of the property to set (optional).
SetPropertyLong(string, string, long)
void SetPropertyLong(string schemaNS, string propName, long propValue)
Parameters
schemaNS
stringThe namespace URI for the property
propName
stringThe name of the property
propValue
longthe literal property value as
long
- See Also
SetPropertyLong(string, string, long, PropertyOptions)
Convenience method to set a property to a literal long
value.
void SetPropertyLong(string schemaNS, string propName, long propValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the property. Has the same usage as in
setProperty()
.propName
stringThe name of the property. Has the same usage as in
getProperty()
.propValue
longthe literal property value as
long
.options
PropertyOptionsoptions of the property to set (optional).
SetQualifier(string, string, string, string, string)
void SetQualifier(string schemaNS, string propName, string qualNS, string qualName, string qualValue)
Parameters
schemaNS
stringThe namespace URI for the struct
propName
stringThe name of the property to which the qualifier is attached
qualNS
stringThe namespace URI for the qualifier
qualName
stringThe name of the qualifier
qualValue
stringthe value of the qualifier
- See Also
SetQualifier(string, string, string, string, string, PropertyOptions)
Provides access to a qualifier attached to a property.
void SetQualifier(string schemaNS, string propName, string qualNS, string qualName, string qualValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in getProperty.
propName
stringThe name of the property to which the qualifier is attached. Has the same usage as in getProperty.
qualNS
stringThe namespace URI for the qualifier. Has the same URI and prefix usage as the schemaNS parameter.
qualName
stringThe 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
stringA 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
PropertyOptionsOption flags describing the qualifier. See the earlier description.
Remarks
Provides access to a qualifier attached to a property. The namespace for the qualifier is passed as a URI, you need not worry about the path string syntax. In many regards qualifiers are like struct fields. See the introductory discussion of qualified properties for more information. The 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, which is unreliable because 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. The property the qualifier will be attached has to exist.
SetStructField(string, string, string, string, string)
void SetStructField(string schemaNS, string structName, string fieldNS, string fieldName, string fieldValue)
Parameters
schemaNS
stringThe namespace URI for the struct
structName
stringThe name of the struct
fieldNS
stringThe namespace URI for the field
fieldName
stringThe name of the field
fieldValue
stringthe value of the field
- See Also
SetStructField(string, string, string, string, string, PropertyOptions)
Provides access to fields within a nested structure.
void SetStructField(string schemaNS, string structName, string fieldNS, string fieldName, string fieldValue, PropertyOptions options)
Parameters
schemaNS
stringThe namespace URI for the struct. Has the same usage as in getProperty.
structName
stringThe 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
stringThe namespace URI for the field. Has the same URI and prefix usage as the schemaNS parameter.
fieldName
stringThe 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
stringthe value of thefield, if the field has a value. Has the same usage as propValue in getProperty.
options
PropertyOptionsOption flags describing the field. See the earlier description.
Remarks
Provides access to fields within a nested structure. The namespace for the field is passed as a URI, you need not worry about the path string syntax. The 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, which is unreliable because 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.
Sort()
void Sort()