use of it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode 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;
}
use of it.geosolutions.imageio.plugins.jp2k.box.ASOCBoxMetadataNode in project imageio-ext by geosolutions-it.
the class JP2KStreamMetadata method searchFirstOccurrenceNode.
// private ASOCBoxMetadataNode findParentASOCBoxMetadataNode(){
// final Node rootNode = createNativeTree();
// final IIOMetadataNode returnedNode[] = new IIOMetadataNode[1];
// searchFirstOccurrenceNode (rootNode,
// BoxUtilities.getName(ASOCBox.BOX_TYPE), returnedNode);
// if (returnedNode[0]!=null)
// return (ASOCBoxMetadataNode)returnedNode[0];
// return null;
// }
//
/**
* Search the first occurrence of a node related to the specified box type
* and return it as a {@link IIOMetadataNode} or null in case of not found.
* Search is performed visiting the children of a node before the brothers.
*/
public IIOMetadataNode searchFirstOccurrenceNode(final int requestedBoxType) {
final Node rootNode = getAsTree(nativeMetadataFormatName);
final List<IIOMetadataNode> returnedNodes = new ArrayList<IIOMetadataNode>(1);
searchOccurrencesNode(rootNode, BoxUtilities.getName(requestedBoxType), returnedNodes, true);
if (!returnedNodes.isEmpty())
return returnedNodes.get(0);
return null;
}
Aggregations