Package com.adobe.xmp.core
Interface XMPArray
This represents a array in the XMP tree. There are 3 types of XMP arrays: unordered, ordered or alternative
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe different types that an XMP Array can be -
Method Summary
Modifier and TypeMethodDescriptionappendArray(XMPArray.Form form) Append new empty array to the end of the listAppend new language alternative to the end of the listappendSimple(String value) Append new simple property to the end of the listAppend new empty struct property to the end of the listvoidclear()Delete all array elementsdump()returns a human readable version of this node tree (recursive)get(int index) Returns the base item at position index (without knowing the special type)Return the node of the given path, relative to this node.getArray(int index) Get nested array property in this array at position indexReturns an array from the given path, relative to this node.getForm()Returns the array Form (Unordered, ordered or alternative)getLanguageAlternative(int index) Get language alternative property in this array at position indexReturns a language Alternative from the given path, relative to this node.getSimple(int index) Get simple array item at position indexReturns a simple property from the given path, relative to this node.getStruct(int index) Get a struct array item at position indexReturns a struct property from the given path, relative to this node.Return the path of this XMPNodeinsertArray(int index, XMPArray.Form form) Insert new array at position index and shift other array items to the back.insertLanguageAlternative(int index) Insert new language alternative at position index and shift other array items to the back.insertSimple(int index, String value) Insert new simple property at position index and shift other array items to the back.insertStruct(int index) Insert new struct property at position index and shift other array items to the back.booleanisEmpty()Checks if the array is emptyremove(int index) Remove a node from position indexRemove a node at a given path, relative to this nodesetArray(int index, XMPArray.Form form) Sets a new array at position index.setLanguageAlternative(int index) Sets a new language alternative at position index.Sets a new simple property at position index.setStruct(int index) Sets a new struct at position index.Methods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.adobe.xmp.core.XMPNode
accept, accessQualifiers, adaptTo, copyReplace, getName, getNamespace, getParent, hasQualifiers, isArrayItem, iterator, size
-
Method Details
-
getForm
XMPArray.Form getForm()Returns the array Form (Unordered, ordered or alternative)- Returns:
- the array Form
-
clear
void clear()Delete all array elements -
isEmpty
boolean isEmpty()Checks if the array is empty- Returns:
- True if the array is empty False otherwise
-
get
Returns the base item at position index (without knowing the special type)- Parameters:
index- the index of the array item to get- Returns:
- the array item at position index (or throws IndexOutOfBoundsException if there is no node at position index)
- Throws:
IndexOutOfBoundsException- if index is not in range
-
remove
Remove a node from position index- Parameters:
index- the index of the element to remove- Returns:
- the removed child element
- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
getSimple
Get simple array item at position index- Parameters:
index- the index for the item to get- Returns:
- the simple property or null if there was nothing to return or the type was wrong
-
getStruct
Get a struct array item at position index- Parameters:
index- the index for the item to get- Returns:
- the struct property or null if there was nothing to return or the type was wrong
-
getArray
Get nested array property in this array at position index- Parameters:
index- the index for the item to get- Returns:
- the array or null if there was nothing to return or the type was wrong
-
getLanguageAlternative
Get language alternative property in this array at position index- Parameters:
index- the index for the item to get- Returns:
- the array or null if there was nothing to return or the type was wrong
-
appendSimple
Append new simple property to the end of the list- Parameters:
value- the value of the new property (namespace is the same as the host array)- Returns:
- the newly appended property
-
appendStruct
XMPStruct appendStruct()Append new empty struct property to the end of the list- Returns:
- the newly appended property
-
appendArray
Append new empty array to the end of the list- Parameters:
form- the array form- Returns:
- the newly appended property
-
appendLanguageAlternative
XMPLanguageAlternative appendLanguageAlternative()Append new language alternative to the end of the list- Returns:
- the newly appended property
-
setSimple
Sets a new simple property at position index. This will overwrite any existing property at this index. If the index is equal to the size of the list, it will be appened.- Parameters:
index- the index to set the propertyvalue- the value of the property to set- Returns:
- the new property at position index or null if nothing was overwritten/appended
-
setStruct
Sets a new struct at position index. This will overwrite any existing property at this index. If the index is equal to the size of the list, it will be appened.- Parameters:
index- the index to set the property- Returns:
- the new property at position index or null if nothing was overwritten/appended
-
setArray
Sets a new array at position index. This will overwrite any existing property at this index. If the index is equal to the size of the list, it will be appened.- Parameters:
index- the index to set the arrayform- the array form- Returns:
- the new array at position index or null if nothing was overwritten/appended
-
setLanguageAlternative
Sets a new language alternative at position index. This will overwrite any existing property at this index. If the index is equal to the size of the list, it will be appened.- Parameters:
index- the index to set the language alternative- Returns:
- the new language alternative at position index or null if nothing was overwritten/appended
-
insertSimple
Insert new simple property at position index and shift other array items to the back. The insert at the end of the list is similar to an append.- Parameters:
index- the index for the insertvalue- the value for the inserted new simple property- Returns:
- the newly inserted simple property or null if nothing was inserted
-
insertStruct
Insert new struct property at position index and shift other array items to the back. The insert at the end of the list is similar to an append.- Parameters:
index- the index for the insert- Returns:
- the newly inserted struct property or null if nothing was inserted
-
insertArray
Insert new array at position index and shift other array items to the back. The insert at the end of the list is similar to an append.- Parameters:
index- the index for the insertform- the array form- Returns:
- the newly inserted array or null if nothing was inserted
-
insertLanguageAlternative
Insert new language alternative at position index and shift other array items to the back. The insert at the end of the list is similar to an append.- Parameters:
index- the index for the insert- Returns:
- the newly inserted array or null if nothing was inserted
-
getXMPPath
XMPPath getXMPPath()Return the path of this XMPNode- Returns:
- the path of this XMPNode
-
get
Return the node of the given path, relative to this node.- Parameters:
path- the path to the desired node relative to this node- Returns:
- the node at the path position or null if it could not be found
-
remove
Remove a node at a given path, relative to this node- Parameters:
path- the path to the node that shall be deleted- Returns:
- the removed node or null, if nothing is removed
- Throws:
XMPException- throws in case the remove path points to an xml:lang qualifier of a Language Alternative
-
getSimple
Returns a simple property from the given path, relative to this node.- Parameters:
path- the path to the simple property, relative to this node.- Returns:
- the desired simple property or null if there was none (or the type is different)
-
getStruct
Returns a struct property from the given path, relative to this node.- Parameters:
path- the path to the struct property, relative to this node.- Returns:
- the desired struct property or null if there was none (or the type is different)
-
getArray
Returns an array from the given path, relative to this node.- Parameters:
path- the path to the array, relative to this node.- Returns:
- the desired array or null if there was none (or the type is different)
-
getLanguageAlternative
Returns a language Alternative from the given path, relative to this node.- Parameters:
path- the path to the langAlt, relative to this node.- Returns:
- the desired langAlt or null if there was none (or the type is different)
-
dump
String dump()returns a human readable version of this node tree (recursive)- Returns:
- returns a human readable version of this node tree (recursive)
-