001    /**
002     * Copyright (c) 2000-2013 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.util.Iterator;
018    import java.util.List;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public interface Branch extends Node {
024    
025            public void add(Comment comment);
026    
027            public void add(Element element);
028    
029            public void add(Node node);
030    
031            public void add(ProcessingInstruction processingInstruction);
032    
033            public Element addElement(QName qName);
034    
035            public Element addElement(String name);
036    
037            public Element addElement(String qualifiedName, String namespaceURI);
038    
039            public void appendContent(Branch branch);
040    
041            public void clearContent();
042    
043            public List<Node> content();
044    
045            public Element elementByID(String elementID);
046    
047            public int indexOf(Node node);
048    
049            public Node node(int index);
050    
051            public int nodeCount();
052    
053            public Iterator<Node> nodeIterator();
054    
055            public void normalize();
056    
057            public ProcessingInstruction processingInstruction(String target);
058    
059            public List<ProcessingInstruction> processingInstructions();
060    
061            public List<ProcessingInstruction> processingInstructions(String target);
062    
063            public boolean remove(Comment comment);
064    
065            public boolean remove(Element element);
066    
067            public boolean remove(Node node);
068    
069            public boolean remove(ProcessingInstruction processingInstruction);
070    
071            public boolean removeProcessingInstruction(String target);
072    
073            public void setContent(List<Node> content);
074    
075            public void setProcessingInstructions(
076                    List<ProcessingInstruction> processingInstructions);
077    
078    }