public ObjectFindingVisitor(Class classTypeToFind,boolean recurse) { super(recurse, true); this.classTypeToFind = classTypeToFind; this.tags = new NodeList(); }
/** * Make a 1:1 clone of the Node. * * @param node Node to deepclone * @param <T> Node of child of Node * @return deepcloned version of node */ @SuppressWarnings("unchecked") public static <T extends Node> T deepClone(T node) { return (T) deepClone(new NodeList(node), null).elementAt(0); }
private void setContent(String s) { TextNode textNode = new TextNode(s); NodeList nodeList = new NodeList(textNode); columnNode.setChildren(nodeList); }
/** * Make a 1:1 clone of the Node. * * @param node Node to deepclone * @param <T> Node of child of Node * @return deepcloned version of node */ @SuppressWarnings("unchecked") public static <T extends Node> T deepClone(T node) { return (T) deepClone(new NodeList(node), null).elementAt(0); }
private void setContent(String s) { TextNode textNode = new TextNode(s); NodeList nodeList = new NodeList(textNode); columnNode.setChildren(nodeList); }
public Row() { rowNode = (TableRow) newTag(TableRow.class); rowNode.setChildren(new NodeList()); Tag endNode = new TableRow(); endNode.setTagName("/" + rowNode.getTagName().toLowerCase()); rowNode.setEndTag(endNode); }
public Row() { rowNode = (TableRow) newTag(TableRow.class); rowNode.setChildren(new NodeList()); Tag endNode = new TableRow(); endNode.setTagName("/" + rowNode.getTagName().toLowerCase()); rowNode.setEndTag(endNode); }
/** * Return the child tags as an iterator. * Equivalent to calling getChildren ().elements (). * @return An iterator over the children. */ public SimpleNodeIterator elements() { return ( (null == getChildren ()) ? new NodeList ().elements () : getChildren ().elements ()); }
/** * Get an iterator over the children of this node. * @return Am iterator over the children of this node. */ public SimpleNodeIterator children () { SimpleNodeIterator ret; if (null != getChildren ()) ret = getChildren ().elements (); else ret = (new NodeList ()).elements (); return (ret); }
private NodeList getRows(NodeList tables) { TagNameFilter trFilter = new TagNameFilter("tr"); Node table = tables.elementAt(0); if (table.getChildren() != null) return table.getChildren().extractAllNodesThatMatch(trFilter); return new NodeList(); }
/** * Add a child to the given tag. * @param parent The parent tag. * @param child The child node. */ protected void addChild (Tag parent, Node child) { if (null == parent.getChildren ()) parent.setChildren (new NodeList ()); child.setParent (parent); parent.getChildren ().add (child); }
/** * Add a child to the given tag. * @param parent The parent tag. * @param child The child node. */ protected void addChild (Tag parent, Node child) { if (null == parent.getChildren ()) parent.setChildren (new NodeList ()); child.setParent (parent); parent.getChildren ().add (child); }
private NodeList getRows(NodeList tables) { TagNameFilter trFilter = new TagNameFilter("tr"); Node table = tables.elementAt(0); if (table.getChildren() != null) return table.getChildren().extractAllNodesThatMatch(trFilter); return new NodeList(); }
private Row makeChildRow(Row row, Node contents, String type) { Row childRow = new Row(); TableColumn column = (TableColumn) newTag(TableColumn.class); column.setChildren(new NodeList(contents)); column.setAttribute("colspan", "" + colspan(row), '"'); childRow.appendCell(new Cell(column)); row.rowNode.setAttribute("class", type + " closed", '"'); childRow.rowNode.setAttribute("class", type + "-detail closed-detail", '"'); return childRow; }
private static NodeList deepClone(NodeList tree, Node clonedParent) { NodeList newNodeList = new NodeList(); for (int i = 0; i < tree.size(); i++) { Node node = tree.elementAt(i); Node newNode = cloneOnlyNode(node, clonedParent); newNodeList.add(newNode); if (node.getChildren() != null) { newNode.setChildren(deepClone(node.getChildren(), newNode)); } } return newNodeList; }
private Row makeChildRow(Row row, Node contents, String type) { Row childRow = new Row(); TableColumn column = (TableColumn) newTag(TableColumn.class); column.setChildren(new NodeList(contents)); column.setAttribute("colspan", "" + colspan(row), '"'); childRow.appendCell(new Cell(column)); row.rowNode.setAttribute("class", type + " closed", '"'); childRow.rowNode.setAttribute("class", type + "-detail closed-detail", '"'); return childRow; }
private static NodeList deepClone(NodeList tree, Node clonedParent) { NodeList newNodeList = new NodeList(); for (int i = 0; i < tree.size(); i++) { Node node = tree.elementAt(i); Node newNode = cloneOnlyNode(node, clonedParent); newNodeList.add(newNode); if (node.getChildren() != null) { newNode.setChildren(deepClone(node.getChildren(), newNode)); } } return newNodeList; }