001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.xml;
016    
017    import java.io.IOException;
018    
019    import java.util.Iterator;
020    import java.util.List;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public interface Branch extends Node {
026    
027            public void add(Comment comment);
028    
029            public void add(Element element);
030    
031            public void add(Node node);
032    
033            public void add(ProcessingInstruction processingInstruction);
034    
035            public Element addElement(QName qName);
036    
037            public Element addElement(String name);
038    
039            public Element addElement(String qualifiedName, String namespaceURI);
040    
041            public void appendContent(Branch branch);
042    
043            public void clearContent();
044    
045            public List<Node> content();
046    
047            public Element elementByID(String elementID);
048    
049            public String formattedString() throws IOException;
050    
051            public String formattedString(String indent) throws IOException;
052    
053            public String formattedString(String indent, boolean expandEmptyElements)
054                    throws IOException;
055    
056            public int indexOf(Node node);
057    
058            public Node node(int index);
059    
060            public int nodeCount();
061    
062            public Iterator<Node> nodeIterator();
063    
064            public void normalize();
065    
066            public ProcessingInstruction processingInstruction(String target);
067    
068            public List<ProcessingInstruction> processingInstructions();
069    
070            public List<ProcessingInstruction> processingInstructions(String target);
071    
072            public boolean remove(Comment comment);
073    
074            public boolean remove(Element element);
075    
076            public boolean remove(Node node);
077    
078            public boolean remove(ProcessingInstruction processingInstruction);
079    
080            public boolean removeProcessingInstruction(String target);
081    
082            public void setContent(List<Node> content);
083    
084            public void setProcessingInstructions(
085                    List<ProcessingInstruction> processingInstructions);
086    
087    }