Search in sources :

Example 1 with XMLBoxMetadataNode

use of it.geosolutions.imageio.plugins.jp2k.box.XMLBoxMetadataNode in project imageio-ext by geosolutions-it.

the class JP2KStreamMetadata method buildTree.

private Node buildTree(final JP2KBoxMetadata node) {
    if (node == null)
        throw new IllegalArgumentException("Null node provided ");
    IIOMetadataNode mdNode;
    switch(node.getType()) {
        // Using LazyBox in the following 3 cases.
        case XMLBox.BOX_TYPE:
            mdNode = new XMLBoxMetadataNode(node);
            break;
        case UUIDBox.BOX_TYPE:
            mdNode = new UUIDBoxMetadataNode(node);
            break;
        case ASOCBox.BOX_TYPE:
            mdNode = new ASOCBoxMetadataNode(node);
            break;
        case JP2KFileBox.BOX_TYPE:
            mdNode = node.getNativeNode();
            mdNode.setAttribute(NUM_CODESTREAMS, Integer.toString(0));
            break;
        case ContiguousCodestreamBox.BOX_TYPE:
            return null;
        default:
            mdNode = node.getNativeNode();
    }
    final int childCount = node.getChildCount();
    int i = 0;
    while (i < childCount) {
        final Node appendMe = buildTree((JP2KBoxMetadata) node.getChildAt(i++));
        if (appendMe != null)
            mdNode.appendChild(appendMe);
    }
    return mdNode;
}
Also used : XMLBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.XMLBoxMetadataNode) UUIDBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.UUIDBoxMetadataNode) ASOCBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode) IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode) Node(org.w3c.dom.Node) UUIDBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.UUIDBoxMetadataNode) XMLBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.XMLBoxMetadataNode) ASOCBoxMetadataNode(it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode) IIOMetadataNode(javax.imageio.metadata.IIOMetadataNode)

Aggregations

ASOCBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode)1 UUIDBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.UUIDBoxMetadataNode)1 XMLBoxMetadataNode (it.geosolutions.imageio.plugins.jp2k.box.XMLBoxMetadataNode)1 IIOMetadataNode (javax.imageio.metadata.IIOMetadataNode)1 Node (org.w3c.dom.Node)1