Package org.dom4j

Examples of org.dom4j.Branch


   *
   * @return DOCUMENT ME!
   */
  protected List createChildList() {
    // add attributes and content as children?
    Branch branch = getXmlBranch();
    int size = branch.nodeCount();
    List childList = new ArrayList(size);

    for (int i = 0; i < size; i++) {
      Node node = branch.node(i);

      // ignore whitespace text nodes
      if (node instanceof CharacterData) {
        String text = node.getText();

View Full Code Here


    public void beginDocument() {
    }

    @Override
    public void openTag(String tagName) {
        Branch top = stack.getLast();
        Element element = top.addElement(tagName);
        stack.addLast(element);
    }
View Full Code Here

        stack.addLast(element);
    }

    @Override
    public void openTag(String tagName, XMLAttributeList attributeList) {
        Branch top = stack.getLast();
        Element element = top.addElement(tagName);
        stack.addLast(element);

        for (Iterator<XMLAttributeList.NameValuePair> i = attributeList.iterator(); i.hasNext();) {
            XMLAttributeList.NameValuePair pair = i.next();
            element.addAttribute(pair.getName(), pair.getValue());
View Full Code Here

        closeTag(tagName);
    }

    @Override
    public void startTag(String tagName) {
        Branch top = stack.getLast();
        Element element = top.addElement(tagName);
        stack.addLast(element);
    }
View Full Code Here

    }

    @Override
    protected Object createNode(final String name) {
        final Element element = documentFactory.createElement(encodeNode(name));
        final Branch top = top();
        if (top != null) {
            top().add(element);
        }
        return element;
    }
View Full Code Here

    public Iterator getChildAxisIterator(Object contextNode)
    {
        if ( contextNode instanceof Branch )
        {
            Branch node = (Branch) contextNode;
           
            return node.nodeIterator();
        }

        return null;
    }
View Full Code Here

    if (node instanceof Element) {
      Element element = (Element)node;
      addChildNodes(element.attributes());
    }
    if (node instanceof Branch) {
      Branch branch = (Branch) node;
      addChildNodes(branch.content());
    }
    if (node instanceof Attribute) {
      icon = IconFetcher.getIcon("attribute.png");
      return;
      }
View Full Code Here

        this(new DocumentFactory(), new XmlFriendlyNameCoder());
    }

    protected Object createNode(final String name) {
        final Element element = documentFactory.createElement(encodeNode(name));
        final Branch top = top();
        if (top != null) {
            top().add(element);
        }
        return element;
    }
View Full Code Here

   * @param insertNode - an org.dom4j.Node object to insert under the parent
   */
  public void insertNode(Node parentNode, Node insertNode)throws Exception{
   
    //we can't append Nodes, but a Branch is a Subinterface of Node
    Branch parentBranch = (Branch) parentNode;
   
    parentBranch.appendContent((Branch) insertNode);
   
   
  }
View Full Code Here

    if (node instanceof Element) {
      Element element = (Element)node;
      addChildNodes(element.attributes());
    }
    if (node instanceof Branch) {
      Branch branch = (Branch) node;
      addChildNodes(branch.content());
    }
    if (node instanceof Attribute) {
      icon = IconFetcher.getIcon("attribute.png");
      return;
      }
View Full Code Here

TOP

Related Classes of org.dom4j.Branch

Copyright © 2018 www.massapicom. 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.