public List<String> getPath() { LinkedList<String> path = new LinkedList<>(); for (OMANode node = this; node != null; node = node.getParent()) { path.addFirst(node.getName()); } return path; }
public static OMAConstructed unmarshal(InputStream in) throws IOException { OMANode node = buildNode(in, null); if (node == null || node.isLeaf()) { throw new IOException("Bad OMA tree"); } unmarshal(in, (OMAConstructed) node); return (OMAConstructed) node; }
private static void unmarshal(InputStream in, OMAConstructed parent) throws IOException { for (; ; ) { OMANode node = buildNode(in, parent); if (node == null) { return; } else if (!node.isLeaf()) { unmarshal(in, (OMAConstructed) node); } } }