Interface XMPStruct

All Superinterfaces:
Iterable<XMPNode>, XMPNode
All Known Subinterfaces:
XMPMetadata, XMPQualifiers

public interface XMPStruct extends XMPNode
This represents a structure in the XMP tree. It has a number of child nodes that can be of any valid XMPNode type.
  • Method Details

    • setSimple

      XMPSimple setSimple(String namespace, String name, String value)
      Create a new child node as a simple property
      Parameters:
      namespace - the namespace of the new child
      name - the name of the new child
      value - 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

      XMPStruct setStruct(String namespace, String name)
      Create a new child node as a nested empty struct
      Parameters:
      namespace - the namespace of the new child
      name - 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

      XMPArray setArray(String namespace, String name, XMPArray.Form form)
      Create a new child node as an empty array with a certain form (ordered, unordered, alternative)
      Parameters:
      namespace - the namespace of the new child
      name - the name of the new child
      form - 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

      XMPLanguageAlternative setLanguageAlternative(String namespace, String name)
      Create a new child node as an empty Language Alternative
      Parameters:
      namespace - the namespace of the new child
      name - 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

      XMPNode get(String namespace, String name)
      Return a child node as base node (without specifing the exact type)
      Parameters:
      namespace - the namespace of the child to return
      name - the name of the child to return
      Returns:
      the desired child node or null if there in none with this name
    • remove

      XMPNode remove(String namespace, String name)
      Remove a child from the struct
      Parameters:
      namespace - the namespace of the child to remove
      name - the name of the child to remove
      Returns:
      the node that was returned of null if there was no child to remove
    • getSimple

      XMPSimple getSimple(String namespace, String name)
      Returns a child node as a simple property
      Parameters:
      namespace - the namespace of child
      name - the name of the child
      Returns:
      the child node or null if there in none with this name or type
    • getStruct

      XMPStruct getStruct(String namespace, String name)
      Returns a child node as a nested struct
      Parameters:
      namespace - the namespace of child
      name - the name of the child
      Returns:
      the child node or null if there in none with this name or type
    • getArray

      XMPArray getArray(String namespace, String name)
      Returns a child node as an array
      Parameters:
      namespace - the namespace of child
      name - the name of the child
      Returns:
      the child node or null if there in none with this name or type
    • getLanguageAlternative

      XMPLanguageAlternative getLanguageAlternative(String namespace, String name)
      Returns a child node as a language Alternative
      Parameters:
      namespace - the namespace of child
      name - the name of the child
      Returns:
      the child node or null if there in none with this name or type
    • renameField

      void renameField(String namespace, String name, String newNamespace, String newName)
      Renames an existing child node.
      Parameters:
      namespace - the namespace of child which is to be renamed
      name - the name of child which is to be renamed
      newNamespace - new namespace of the child node
      newName - 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

      Iterator<XMPNode> getNamespaceProperties(String namespace)
      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

      Set<String> getUsedNamespaces()
      Returns an immutable set of namespaces of properties in this struct.
      Returns:
      Returns an immutable Set of namespace strings.
    • copy

      XMPSimple copy(XMPSimple simple)
      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

      XMPStruct copy(XMPStruct struct)
      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

      XMPArray copy(XMPArray array)
      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

      XMPNode get(XMPPath path)
      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

      XMPNode remove(XMPPath path) throws XMPException
      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

      XMPSimple getSimple(XMPPath path)
      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

      XMPStruct getStruct(XMPPath path)
      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

      XMPArray getArray(XMPPath path)
      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

      XMPLanguageAlternative getLanguageAlternative(XMPPath path)
      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)