public class XmpPackage extends Object implements IXmlValue
Represents base abstraction for XMP package.
Modifier and Type | Field and Description |
---|---|
protected String |
namespaceUri
Namespace uri for the specific XMP schema.
|
protected String |
prefix
Xmlns prefix.
|
protected com.aspose.ms.System.Collections.Generic.Dictionary<String,XmpValueBase> |
properties
Dictionary of key/value properties XMP package.
|
Constructor and Description |
---|
XmpPackage(String prefix,
String namespaceUri)
Initializes a new instance of the
XmpPackage class. |
Modifier and Type | Method and Description |
---|---|
void |
addValue(String key,
boolean value)
Adds boolean property.
|
void |
addValue(String key,
Date value)
Adds
DateTime property. |
void |
addValue(String key,
int value)
Adds integer property.
|
void |
addValue(String key,
String value)
Adds string property.
|
void |
clear()
Removes all XMP properties.
|
boolean |
containsKey(String key)
Determines whether package contains key.
|
<T extends XmpComplexType> |
getGenericArray(String key,
T[] t) |
String[] |
getKeys()
Gets keys in XMP package.
|
protected String |
getKeyValueAsXml(String key)
Returns XMP representation of the XMP metadata by it's key.
|
LangAlt |
getLangAlt(String key) |
String |
getNamespaceUri()
Gets package namespace URI.
|
com.aspose.ms.System.Type |
getNodeType(String key)
Returns node type but it's key.
|
String |
getPrefix()
Gets package xmlns prefix.
|
com.aspose.ms.System.Nullable<Float> |
getReal(String key) |
String |
getString(String key) |
String[] |
getStringArray(String key) |
String |
getXmlNamespace()
Gets xml namespace.
|
String |
getXmlValue()
Converts XMP value to the xml representation.
|
XmpValueBase |
readByXmpKey(String key) |
boolean |
remove(String key)
Remove the value with the specified key.
|
void |
setArray(String key,
XmpArray array)
Sets the
XmpArray value. |
void |
setBoolValue(String key,
boolean value) |
void |
setDateValue(String key,
Date value) |
void |
setIntValue(String key,
int value) |
void |
setLangAlt(String key,
LangAlt langAlt)
Sets the
LangAlt value. |
void |
setNullableInt(String xmpKey,
Integer integerValue,
String paramName) |
void |
setRealValue(String key,
float value) |
void |
setStingArray(String key,
String[] values,
int arrayType) |
void |
setTextValue(String key,
String value) |
void |
setXmpComplexTypeValue(String key,
XmpComplexType value)
Sets the value inherited from
XmpTypeBase . |
void |
setXmpTypeValue(String key,
XmpTypeBase value)
Sets the value inherited from
XmpTypeBase . |
void |
setXmpValue(String key,
XmpValueBase value) |
protected final String prefix
Xmlns prefix. For example, xmlns:dc.
protected final String namespaceUri
Namespace uri for the specific XMP schema.
protected com.aspose.ms.System.Collections.Generic.Dictionary<String,XmpValueBase> properties
Dictionary of key/value properties XMP package.
public final String getXmlNamespace()
Gets xml namespace.
public final String getPrefix()
Gets package xmlns prefix.
public final String getNamespaceUri()
Gets package namespace URI.
public String[] getKeys()
Gets keys in XMP package.
public boolean containsKey(String key)
Determines whether package contains key.
key
- XMP metadata key.true
if key is found; otherwise false
.public void addValue(String key, String value)
Adds string property.
key
- XMP metadata key.value
- XMP metadata value.public void addValue(String key, int value)
Adds integer property.
key
- XMP metadata key.value
- XMP metadata value.public void addValue(String key, boolean value)
Adds boolean property.
key
- XMP metadata key.value
- XMP metadata value.public void addValue(String key, Date value)
Adds DateTime
property.
key
- XMP metadata key.value
- XMP metadata value.public boolean remove(String key)
Remove the value with the specified key.
key
- XMP metadata key.public void clear()
Removes all XMP properties.
public final void setLangAlt(String key, LangAlt langAlt)
Sets the LangAlt
value.
key
- XMP metadata key.langAlt
- LangAlt value.com.aspose.ms.System.ArgumentNullException
- LangAlt could not be null.public final void setArray(String key, XmpArray array)
Sets the XmpArray
value.
key
- XMP metadata key.array
- Array value.com.aspose.ms.System.ArgumentNullException
- Array could not be null.public void setXmpTypeValue(String key, XmpTypeBase value)
Sets the value inherited from XmpTypeBase
.
key
- XMP metadata key.value
- XMP metadata value.public void setXmpComplexTypeValue(String key, XmpComplexType value)
Sets the value inherited from XmpTypeBase
.
key
- XMP metadata key.value
- XMP metadata value.public final com.aspose.ms.System.Type getNodeType(String key)
Returns node type but it's key.
key
- Package key.System.Type
.com.aspose.ms.System.ArgumentNullException
- Key could not be null or empty.com.aspose.ms.System.ArgumentException
- Key not found.public String getXmlValue()
Converts XMP value to the xml representation.
getXmlValue
in interface IXmlValue
string
representation of XMP value.public final <T extends XmpComplexType> T[] getGenericArray(String key, T[] t)
public final void setBoolValue(String key, boolean value)
public final void setIntValue(String key, int value)
public final void setRealValue(String key, float value)
public final void setNullableInt(String xmpKey, Integer integerValue, String paramName)
public final XmpValueBase readByXmpKey(String key)
public final void setXmpValue(String key, XmpValueBase value)
Copyright © 2018. All rights reserved.