Examples of ParentNode


Examples of nu.xom.ParentNode

    private boolean convertNamespace(Element element, String prefix)
      throws SAXException {
       
        // XXX could store a stack of these in a namespaceSupport to avoid going up to the parent
        String uri = element.getNamespaceURI(prefix);
        ParentNode parentNode = element.getParent();
        Element parent = null;
        if (parentNode instanceof Element) {
            parent = (Element) parentNode;  
        }
       
View Full Code Here

Examples of nu.xom.ParentNode

            }
            return out;
        }
       
       
        ParentNode parent = result;
        boolean backtracking = false;
        while (true) {
            if (current.hasChildNodes() && !backtracking) {
                current = current.getFirstChild();
                backtracking = false;
            }
            else if (current == element) {
                break;  
            }
            else if (current.getNextSibling() != null) {
                current = current.getNextSibling();
                backtracking = false;
            }
            else {
                current = current.getParentNode();
                backtracking = true;
                if (parent.getParent() != null) parent = parent.getParent();
                continue;
            }
           
            int type = current.getNodeType();
            if (type == org.w3c.dom.Node.ELEMENT_NODE) {
                Element child = makeElement((org.w3c.dom.Element) current, factory);
                if (child != null) {
                    parent.appendChild(child);
                    if (current.hasChildNodes()) parent = child;
                }
            }
            else {
                Nodes children = convert(current, factory);
                for (int i = 0; i < children.size(); i++) {
                    parent.appendChild(children.get(i));
                }
            }
           
        }
       
View Full Code Here

Examples of org.sonatype.security.rest.model.ParentNode

      foundResource.setId(privilege.getId());
      foundResource.setName(privilege.getName());
      response.addData(foundResource);
    }

    ParentNode root = null;
    ParentNode parent = null;

    // iterate through each role and add to tree
    for (Role role : parentList) {
      ParentNode newParent = new ParentNode();
      newParent.setId(role.getRoleId());
      newParent.setName(role.getName());

      // if we dont yet have a root, we are on first item
      if (root == null) {
        root = newParent;
        parent = root;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.