Modifier and Type | Method and Description |
---|---|
void |
AddArrayItem(String arrayKey,
int index,
XmpValue value)
Adds value into an array by specified index.
|
void |
addArrayItem(String arrayKey,
XmpValue value)
Adds value into an array.
|
void |
addItem(Map.Entry<String,XmpValue> item)
Adds pair with key and value into the dictionary.
|
void |
addNamedValue(String structureKey,
String valueKey,
XmpValue value)
Adds named value into a structure.
|
void |
clear()
Removes all elements from the object.
|
boolean |
containsKey(Object key)
Checks if dictionary contains the specified key.
|
boolean |
containsKey(String key)
Determines does this dictionary contasins specified key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the
specified value.
|
void |
copyToArray(Map.Entry<String,XmpValue>[] array,
int index)
Copy metadata into array.
|
Set<Map.Entry<String,XmpValue>> |
entrySet()
Gets enumerator object of the dictionary.
|
XmpValue |
get(Object key)
Gets value by key.
|
String |
getNamespaceURIByPrefix(String prefix)
Gets namespace URI by prefix.
|
String |
getPrefixByNamespaceURI(String namespaceURI)
Gets the prefix by namespace URI.
|
Object |
getSyncRoot()
Gets synchroniztion object of the collection.
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
Set<String> |
keySet()
Gets keys from the dictionary.
|
XmpValue |
put(String key,
XmpValue value)
Adds new element to the dictionary object.
|
void |
putAll(Map<? extends String,? extends XmpValue> m)
Copies all of the mappings from the specified map to this map
(optional operation).
|
void |
registerNamespaceURI(String prefix,
String namespaceURI)
Registers the namespace URI.
|
XmpValue |
remove(Map.Entry<String,XmpValue> item)
Removes key/value pair from the colleciton.
|
XmpValue |
remove(Object key)
Removes key from the dictionary.
|
void |
setArrayItem(String arrayKey,
int index,
XmpValue value)
Sets value in an array.
|
void |
setNamedValue(String structureKey,
String valueKey,
XmpValue value)
Sets named value into a structure.
|
int |
size()
Gets count if items in the collection.
|
boolean |
tryGetValue(String key,
Object[] value)
Tries to find key in the dictionary and retreives value if found.
|
Collection<XmpValue> |
values()
Gets the collection of values in dictionary.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public void registerNamespaceURI(String prefix, String namespaceURI)
Registers the namespace URI.
XmpMetadata xmp = new XmpMetadata("input.pdf"); xmp.registerNamespaceURI("xmp", "http://ns.adobe.com/xap/1.0/");
prefix
- The prefix.namespaceURI
- The namespace URI.public String getNamespaceURIByPrefix(String prefix)
Gets namespace URI by prefix.
XmpMetadata xmp = new XmpMetadata("input.pdf"); System.out.println(xmp.getNamespaceURIByPrefix("xmp"));
prefix
- The prefix.public String getPrefixByNamespaceURI(String namespaceURI)
Gets the prefix by namespace URI.
XmpMetadata xmp = new XmpMetadata("input.pdf"); System.out.println(xmp.getPrefixByNamespaceURI("http://ns.adobe.com/xap/1.0/"));
namespaceURI
- Namespace URI.public void clear()
Removes all elements from the object.
XmpMetadata xmp = new XmpMetadata(); xmp.bindPdf("input.pdf"); xmp.clear();
public boolean isEmpty()
public void putAll(Map<? extends String,? extends XmpValue> m)
put(k, v)
on this map once
for each mapping from key k to value v in the
specified map. The behavior of this operation is undefined if the
specified map is modified while the operation is in progress.putAll
in interface Map<String,XmpValue>
m
- mappings to be stored in this mapUnsupportedOperationException
- if the putAll operation
is not supported by this mapClassCastException
- if the class of a key or value in the
specified map prevents it from being stored in this mapNullPointerException
- if the specified map is null, or if
this map does not permit null keys or values, and the
specified map contains null keys or valuesIllegalArgumentException
- if some property of a key or value in
the specified map prevents it from being stored in this mappublic boolean containsKey(Object key)
Checks if dictionary contains the specified key.
XmpMetadata xmp = new XmpMetadata(); xmp.bindPdf("input.pdf"); xmp.add("xmp:Nickname", "Nickname1"); if (!xmp.contains("xmp:Nickname")) System.out.println("Key does not exists");
containsKey
in interface Map<String,XmpValue>
key
- Key which will be checked.public boolean containsValue(Object value)
containsValue
in interface Map<String,XmpValue>
value
- value whose presence in this map is to be testedClassCastException
- if the value is of an inappropriate type for
this map
(optional)NullPointerException
- if the specified value is null and this
map does not permit null values
(optional)public Set<Map.Entry<String,XmpValue>> entrySet()
Gets enumerator object of the dictionary.
public XmpValue remove(Object key)
Removes key from the dictionary.
XmpMetadata xmp = new XmpMetadata(); xmp.bindPdf("input.pdf"); xmp.remove("xmp:Nickname");
public Collection<XmpValue> values()
Gets the collection of values in dictionary.
public XmpValue get(Object key)
Gets value by key.
XmpMetadata pxm = new XmpMetadata(); pxm.bindPdf("PdfFile.pdf"); System.out.println(pxm.get_Item("xmp:Nickname"));
public void copyToArray(Map.Entry<String,XmpValue>[] array, int index)
Copy metadata into array.
array
- The destination array.index
- The starting index.public int size()
Gets count if items in the collection.
public Object getSyncRoot()
Gets synchroniztion object of the collection.
public boolean containsKey(String key)
Determines does this dictionary contasins specified key.
key
- Key to search in the dictionary.public boolean tryGetValue(String key, Object[] value)
Tries to find key in the dictionary and retreives value if found.
key
- Key to search in the dictionary.value
- Retreived value.public void addItem(Map.Entry<String,XmpValue> item)
Adds pair with key and value into the dictionary.
item
- Item to be added.public void addArrayItem(String arrayKey, XmpValue value)
Adds value into an array. The value will be added at the end of the array.
arrayKey
- Key of the array to search in the dictionary.value
- Value to add into the array.public void AddArrayItem(String arrayKey, int index, XmpValue value)
Adds value into an array by specified index.
arrayKey
- Key of the array to search in the dictionary.index
- Index of new value in the array.value
- Value to add into the array.public void setArrayItem(String arrayKey, int index, XmpValue value)
Sets value in an array. Previous value will be replaced with new one.
arrayKey
- Key of the array to search in the dictionary.index
- Index of new value in the array.value
- Value to set in the array.public void addNamedValue(String structureKey, String valueKey, XmpValue value)
Adds named value into a structure.
structureKey
- Key of the structure to search in the dictionary.valueKey
- Name of the value to add into the structure.value
- Value to add into the structure.public void setNamedValue(String structureKey, String valueKey, XmpValue value)
Sets named value into a structure. Previous named value, if already exists, will be replaced with new one.
structureKey
- Key of the structure to search in the dictionary.valueKey
- Name of the value to add into the structure.value
- Value to set into the structure.Copyright © 2022 Aspose. All Rights Reserved.