Exemplo n.º 1
0
 public List<String> getPath() {
   LinkedList<String> path = new LinkedList<>();
   for (OMANode node = this; node != null; node = node.getParent()) {
     path.addFirst(node.getName());
   }
   return path;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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);
     }
   }
 }