1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.xml;
21  
22  import java.util.Iterator;
23  import java.util.List;
24  import java.util.Map;
25  
26  /**
27   * <a href="Element.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   *
31   */
32  public interface Element extends Branch {
33  
34      public void add(Attribute attribute);
35  
36      public void add(CDATA cdata);
37  
38      public void add(Entity entity);
39  
40      public void add(Namespace namespace);
41  
42      public void add(Text text);
43  
44      public Element addAttribute(QName qName, String value);
45  
46      public Element addAttribute(String name, String value);
47  
48      public Element addCDATA(String cdata);
49  
50      public Element addComment(String comment);
51  
52      public Element addEntity(String name, String text);
53  
54      public List<Namespace> additionalNamespaces();
55  
56      public Element addNamespace(String prefix, String uri);
57  
58      public Element addProcessingInstruction(
59          String target, Map<String, String> data);
60  
61      public Element addProcessingInstruction(String target, String data);
62  
63      public Element addText(String text);
64  
65      public void appendAttributes(Element element);
66  
67      public Attribute attribute(int index);
68  
69      public Attribute attribute(QName qName);
70  
71      public Attribute attribute(String name);
72  
73      public int attributeCount();
74  
75      public Iterator<Attribute> attributeIterator();
76  
77      public List<Attribute> attributes();
78  
79      public String attributeValue(QName qName);
80  
81      public String attributeValue(QName qName, String defaultValue);
82  
83      public String attributeValue(String name);
84  
85      public String attributeValue(String name, String defaultValue);
86  
87      public Element createCopy();
88  
89      public Element createCopy(QName qName);
90  
91      public Element createCopy(String name);
92  
93      public List<Namespace> declaredNamespaces();
94  
95      public Element element(QName qName);
96  
97      public Element element(String name);
98  
99      public Iterator<Element> elementIterator();
100 
101     public Iterator<Element> elementIterator(QName qName);
102 
103     public Iterator<Element> elementIterator(String name);
104 
105     public List<Element> elements();
106 
107     public List<Element> elements(QName qName);
108 
109     public List<Element> elements(String name);
110 
111     public String elementText(QName qName);
112 
113     public String elementText(String name);
114 
115     public String elementTextTrim(QName qName);
116 
117     public String elementTextTrim(String name);
118 
119     public Object getData();
120 
121     public Namespace getNamespace();
122 
123     public Namespace getNamespaceForPrefix(String prefix);
124 
125     public Namespace getNamespaceForURI(String uri);
126 
127     public String getNamespacePrefix();
128 
129     public List<Namespace> getNamespacesForURI(String uri);
130 
131     public String getNamespaceURI();
132 
133     public QName getQName();
134 
135     public QName getQName(String qualifiedName);
136 
137     public String getQualifiedName();
138 
139     public String getStringValue();
140 
141     public String getText();
142 
143     public String getTextTrim();
144 
145     public Node getXPathResult(int index);
146 
147     public boolean hasMixedContent();
148 
149     public boolean isRootElement();
150 
151     public boolean isTextOnly();
152 
153     public boolean remove(Attribute attribute);
154 
155     public boolean remove(CDATA cdata);
156 
157     public boolean remove(Entity entity);
158 
159     public boolean remove(Namespace namespace);
160 
161     public boolean remove(Text text);
162 
163     public void setAttributes(List<Attribute> attributes);
164 
165     public void setData(Object data);
166 
167     public void setQName(QName qName);
168 
169 }