Search in sources :

Example 1 with IteratorOptions

use of com.adobe.xmp.options.IteratorOptions in project tika by apache.

the class XMPMetadata method size.

/**
     * Returns the number of top-level namespaces
     */
@Override
public int size() {
    int size = 0;
    try {
        // Get an iterator for the XMP packet, starting at the top level schema nodes
        XMPIterator nsIter = xmpData.iterator(new IteratorOptions().setJustChildren(true).setOmitQualifiers(true));
        // iterate all top level namespaces
        while (nsIter.hasNext()) {
            nsIter.next();
            size++;
        }
    } catch (XMPException e) {
    // ignore
    }
    return size;
}
Also used : XMPIterator(com.adobe.xmp.XMPIterator) XMPException(com.adobe.xmp.XMPException) IteratorOptions(com.adobe.xmp.options.IteratorOptions)

Aggregations

XMPException (com.adobe.xmp.XMPException)1 XMPIterator (com.adobe.xmp.XMPIterator)1 IteratorOptions (com.adobe.xmp.options.IteratorOptions)1