1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.xml;
16  
17  import java.util.Iterator;
18  import java.util.List;
19  import java.util.Map;
20  
21  /**
22   * <a href="Element.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public interface Element extends Branch {
27  
28      public void add(Attribute attribute);
29  
30      public void add(CDATA cdata);
31  
32      public void add(Entity entity);
33  
34      public void add(Namespace namespace);
35  
36      public void add(Text text);
37  
38      public Element addAttribute(QName qName, String value);
39  
40      public Element addAttribute(String name, String value);
41  
42      public Element addCDATA(String cdata);
43  
44      public Element addComment(String comment);
45  
46      public Element addEntity(String name, String text);
47  
48      public List<Namespace> additionalNamespaces();
49  
50      public Element addNamespace(String prefix, String uri);
51  
52      public Element addProcessingInstruction(
53          String target, Map<String, String> data);
54  
55      public Element addProcessingInstruction(String target, String data);
56  
57      public Element addText(String text);
58  
59      public void appendAttributes(Element element);
60  
61      public Attribute attribute(int index);
62  
63      public Attribute attribute(QName qName);
64  
65      public Attribute attribute(String name);
66  
67      public int attributeCount();
68  
69      public Iterator<Attribute> attributeIterator();
70  
71      public List<Attribute> attributes();
72  
73      public String attributeValue(QName qName);
74  
75      public String attributeValue(QName qName, String defaultValue);
76  
77      public String attributeValue(String name);
78  
79      public String attributeValue(String name, String defaultValue);
80  
81      public Element createCopy();
82  
83      public Element createCopy(QName qName);
84  
85      public Element createCopy(String name);
86  
87      public List<Namespace> declaredNamespaces();
88  
89      public Element element(QName qName);
90  
91      public Element element(String name);
92  
93      public Iterator<Element> elementIterator();
94  
95      public Iterator<Element> elementIterator(QName qName);
96  
97      public Iterator<Element> elementIterator(String name);
98  
99      public List<Element> elements();
100 
101     public List<Element> elements(QName qName);
102 
103     public List<Element> elements(String name);
104 
105     public String elementText(QName qName);
106 
107     public String elementText(String name);
108 
109     public String elementTextTrim(QName qName);
110 
111     public String elementTextTrim(String name);
112 
113     public Object getData();
114 
115     public Namespace getNamespace();
116 
117     public Namespace getNamespaceForPrefix(String prefix);
118 
119     public Namespace getNamespaceForURI(String uri);
120 
121     public String getNamespacePrefix();
122 
123     public List<Namespace> getNamespacesForURI(String uri);
124 
125     public String getNamespaceURI();
126 
127     public QName getQName();
128 
129     public QName getQName(String qualifiedName);
130 
131     public String getQualifiedName();
132 
133     public String getStringValue();
134 
135     public String getText();
136 
137     public String getTextTrim();
138 
139     public Node getXPathResult(int index);
140 
141     public boolean hasMixedContent();
142 
143     public boolean isRootElement();
144 
145     public boolean isTextOnly();
146 
147     public boolean remove(Attribute attribute);
148 
149     public boolean remove(CDATA cdata);
150 
151     public boolean remove(Entity entity);
152 
153     public boolean remove(Namespace namespace);
154 
155     public boolean remove(Text text);
156 
157     public void setAttributes(List<Attribute> attributes);
158 
159     public void setData(Object data);
160 
161     public void setQName(QName qName);
162 
163 }