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