Class Metadata

  • All Implemented Interfaces:
    XMLizable, PropertyAccess

    public class Metadata
    extends java.lang.Object
    implements XMLizable, PropertyAccess
    This class represents the root of an XMP metadata tree. It's more or less equivalent to the x:xmpmeta element together with its nested rdf:RDF element.
    • Constructor Detail

      • Metadata

        public Metadata()
    • Method Detail

      • getProperty

        public XMPProperty getProperty​(java.lang.String uri,
                                       java.lang.String localName)
        Returns a property
        Specified by:
        getProperty in interface PropertyAccess
        Parameters:
        uri - the namespace URI of the property
        localName - the local name of the property
        Returns:
        the requested property or null if it's not available
      • getProperty

        public XMPProperty getProperty​(QName name)
        Returns a property.
        Specified by:
        getProperty in interface PropertyAccess
        Parameters:
        name - the name of the property
        Returns:
        the requested property or null if it's not available
      • removeProperty

        public XMPProperty removeProperty​(QName name)
        Removes a property and returns it if it was found.
        Specified by:
        removeProperty in interface PropertyAccess
        Parameters:
        name - the name of the property
        Returns:
        the removed property or null if it was not found
      • getValueProperty

        public XMPProperty getValueProperty()
        Returns the rdf:value property. This is a shortcut for getProperty(XMPConstants.RDF_VALUE).
        Specified by:
        getValueProperty in interface PropertyAccess
        Returns:
        the rdf:value property or null if it's no available
      • getPropertyCount

        public int getPropertyCount()
        Returns the number of properties.
        Specified by:
        getPropertyCount in interface PropertyAccess
        Returns:
        the number of properties in this metadata object.
      • iterator

        public java.util.Iterator iterator()
        Returns an Iterator over all properties in this structured property.
        Specified by:
        iterator in interface PropertyAccess
        Returns:
        an Iterator over all properties
      • mergeInto

        public void mergeInto​(Metadata target,
                              java.util.List<java.lang.Class> exclude)
        Merges this metadata object into a given target metadata object. The merge rule set provided by each schema is used for the merge.
        Parameters:
        target - the target metadata to merge the local metadata into
      • toSAX

        public void toSAX​(org.xml.sax.ContentHandler handler)
                   throws org.xml.sax.SAXException
        Generates SAX events representing the object's state.
        Specified by:
        toSAX in interface XMLizable
        Parameters:
        handler - ContentHandler instance to send the SAX events to
        Throws:
        org.xml.sax.SAXException - if there's a problem generating the SAX events
      • writeCustomDescription

        private void writeCustomDescription​(org.xml.sax.ContentHandler handler)
                                     throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException