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;
}
Aggregations