Package com.adobe.xmp.core
Interface XMPStruct
- All Known Subinterfaces:
XMPMetadata,XMPQualifiers
This represents a structure in the XMP tree. It has a number of child nodes that
can be of any valid XMPNode type.
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new XMPArray node and copies the whole tree of the provided array into the new nodeCreates a new XMPSimple node and copies the provided simple node with qualifiers into the new nodeCreates a new XMPStruct node and copies the whole tree of the provided struct into the new nodedump()returns a human readable version of this node tree (recursive)Return the node of the given path, relative to this node.Return a child node as base node (without specifing the exact type)Returns an array from the given path, relative to this node.Returns a child node as an arrayReturns a language Alternative from the given path, relative to this node.getLanguageAlternative(String namespace, String name) Returns a child node as a language AlternativegetNamespaceProperties(String namespace) Returns an iterator which iterates over all properties in this struct that belong to the specified namespaceReturns a simple property from the given path, relative to this node.Returns a child node as a simple propertyReturns a struct property from the given path, relative to this node.Returns a child node as a nested structReturns an immutable set of namespaces of properties in this struct.Return the path of this XMPNodeRemove a node at a given path, relative to this nodeRemove a child from the structvoidrenameField(String namespace, String name, String newNamespace, String newName) Renames an existing child node.setArray(String namespace, String name, XMPArray.Form form) Create a new child node as an empty array with a certain form (ordered, unordered, alternative)setLanguageAlternative(String namespace, String name) Create a new child node as an empty Language AlternativeCreate a new child node as a simple propertyCreate a new child node as a nested empty structMethods 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
-
setSimple
Create a new child node as a simple property- Parameters:
namespace- the namespace of the new childname- the name of the new childvalue- the value of the new child- Returns:
- the newly created child
- Throws:
IllegalArgumentException- If name is not valid as per XML Spec or namespace equals http://www.w3.org/1999/02/22-rdf-syntax-ns#
-
setStruct
Create a new child node as a nested empty struct- Parameters:
namespace- the namespace of the new childname- the name of the new child- Returns:
- the newly created child as an empty struct
- Throws:
IllegalArgumentException- If name is not valid as per XML Spec or namespace equals http://www.w3.org/1999/02/22-rdf-syntax-ns#
-
setArray
Create a new child node as an empty array with a certain form (ordered, unordered, alternative)- Parameters:
namespace- the namespace of the new childname- the name of the new childform- the array form of the new child- Returns:
- the newly created child as an empty XMPArray with a certain form
- Throws:
IllegalArgumentException- If name is not valid as per XML Spec or namespace equals http://www.w3.org/1999/02/22-rdf-syntax-ns#
-
setLanguageAlternative
Create a new child node as an empty Language Alternative- Parameters:
namespace- the namespace of the new childname- the name of the new child- Returns:
- the newly created child as an empty XMPArray of a certain type
- Throws:
IllegalArgumentException- If name is not valid as per XML Spec or namespace equals http://www.w3.org/1999/02/22-rdf-syntax-ns#
-
get
Return a child node as base node (without specifing the exact type)- Parameters:
namespace- the namespace of the child to returnname- the name of the child to return- Returns:
- the desired child node or null if there in none with this name
-
remove
Remove a child from the struct- Parameters:
namespace- the namespace of the child to removename- the name of the child to remove- Returns:
- the node that was returned of null if there was no child to remove
-
getSimple
Returns a child node as a simple property- Parameters:
namespace- the namespace of childname- the name of the child- Returns:
- the child node or null if there in none with this name or type
-
getStruct
Returns a child node as a nested struct- Parameters:
namespace- the namespace of childname- the name of the child- Returns:
- the child node or null if there in none with this name or type
-
getArray
Returns a child node as an array- Parameters:
namespace- the namespace of childname- the name of the child- Returns:
- the child node or null if there in none with this name or type
-
getLanguageAlternative
Returns a child node as a language Alternative- Parameters:
namespace- the namespace of childname- the name of the child- Returns:
- the child node or null if there in none with this name or type
-
renameField
Renames an existing child node.- Parameters:
namespace- the namespace of child which is to be renamedname- the name of child which is to be renamednewNamespace- new namespace of the child nodenewName- new name of the child node- Throws:
IllegalArgumentException- If name is not valid as per XML Spec or namespace equals http://www.w3.org/1999/02/22-rdf-syntax-ns#
-
getNamespaceProperties
Returns an iterator which iterates over all properties in this struct that belong to the specified namespace- Parameters:
namespace- the namespace- Returns:
- Iterator which iterate over list of
XMPNode
-
getUsedNamespaces
Returns an immutable set of namespaces of properties in this struct.- Returns:
- Returns an immutable Set of namespace strings.
-
copy
Creates a new XMPSimple node and copies the provided simple node with qualifiers into the new node- Parameters:
simple- the simple node to copy- Returns:
- the newly created simple node
-
copy
Creates a new XMPStruct node and copies the whole tree of the provided struct into the new node- Parameters:
struct- the Struct to copy- Returns:
- the newly created struct node
-
copy
Creates a new XMPArray node and copies the whole tree of the provided array into the new node- Parameters:
array- the array to copy- Returns:
- the newly created array node
-
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)
-