private static LblTree createTree ( TreeWalker walker ) { Node parent = walker . getCurrentNode ( ) ; LblTree node = new LblTree ( parent . getNodeName ( ) , - 1 ) ; // treeID = -1 for ( Node n = walker . firstChild ( ) ; n != null ; n = walker . nextSibling ( ) ) { node . add ( createTree ( walker ) ) ; } walker . setCurrentNode ( parent ) ; return node ; }
Recursively construct a LblTree from DOM tree