5fe3564fba778ba790072719c188490818cf17bb
[aai/schema-service.git] / aai-schema-gen / src / main / java / org / onap / aai / schemagen / genxsd / XSDElement.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * <p>
11  * http://www.apache.org/licenses/LICENSE-2.0
12  * <p>
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.aai.schemagen.genxsd;
22
23 import com.google.common.base.Joiner;
24 import java.util.ArrayList;
25 import java.util.List;
26 import java.util.StringTokenizer;
27 import java.util.Vector;
28 import org.apache.commons.lang3.StringUtils;
29 import org.onap.aai.setup.SchemaVersion;
30 import org.w3c.dom.Attr;
31 import org.w3c.dom.DOMException;
32 import org.w3c.dom.Document;
33 import org.w3c.dom.Element;
34 import org.w3c.dom.NamedNodeMap;
35 import org.w3c.dom.Node;
36 import org.w3c.dom.NodeList;
37 import org.w3c.dom.TypeInfo;
38 import org.w3c.dom.UserDataHandler;
39
40 public class XSDElement implements Element {
41     Element xmlElementElement;
42     String maxOccurs;
43     private static final int VALUE_NONE = 0;
44     private static final int VALUE_DESCRIPTION = 1;
45     private static final int VALUE_INDEXED_PROPS = 2;
46     private static final int VALUE_CONTAINER = 3;
47     private static final int VALUE_REQUIRES = 4;
48     private static final int VALUE_DSLSTARTNODE = 5;
49
50     public XSDElement(Element xmlElementElement, String maxOccurs) {
51         super();
52         this.xmlElementElement = xmlElementElement;
53         this.maxOccurs = maxOccurs;
54     }
55
56     public XSDElement(Element xmlElementElement) {
57         super();
58         this.xmlElementElement = xmlElementElement;
59         this.maxOccurs = null;
60     }
61
62     public String name() {
63         return this.getAttribute("name");
64     }
65
66     public Vector<String> getAddTypes(String version) {
67         String apiVersionFmt = "." + version + ".";
68         NamedNodeMap attributes = this.getAttributes();
69         Vector<String> addTypeV = new Vector<>(); // vector of 1
70         String addType = null;
71
72         for (int j = 0; j < attributes.getLength(); ++j) {
73             Attr attr = (Attr) attributes.item(j);
74             String attrName = attr.getNodeName();
75
76             String attrValue = attr.getNodeValue();
77             if ("type".equals(attrName)) {
78                 if (attrValue.contains(apiVersionFmt)) {
79                     addType = attrValue.substring(attrValue.lastIndexOf('.') + 1);
80                     addTypeV.add(addType);
81                 }
82
83             }
84         }
85         return addTypeV;
86     }
87
88     public String getRequiresProperty() {
89         String elementAlsoRequiresProperty = null;
90         NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
91
92         for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
93             Element xmlPropElement = (Element) xmlPropNodes.item(i);
94             if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
95                 .equals(this.xmlElementElement.getAttribute("name"))) {
96                 continue;
97             }
98             NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
99
100             for (int j = 0; j < childNodes.getLength(); ++j) {
101                 Element childElement = (Element) childNodes.item(j);
102                 // get name
103                 int useValue = VALUE_NONE;
104                 NamedNodeMap attributes = childElement.getAttributes();
105                 for (int k = 0; k < attributes.getLength(); ++k) {
106                     Attr attr = (Attr) attributes.item(k);
107                     String attrName = attr.getNodeName();
108                     String attrValue = attr.getNodeValue();
109                     if (attrName == null || attrValue == null) {
110                         continue;
111                     }
112                     if (attrName.equals("name") && attrValue.equals("requires")) {
113                         useValue = VALUE_REQUIRES;
114                     }
115                     if (useValue == VALUE_REQUIRES && attrName.equals("value")) {
116                         elementAlsoRequiresProperty = attrValue;
117                     }
118                 }
119             }
120         }
121         return elementAlsoRequiresProperty;
122     }
123
124     public String getPathDescriptionProperty() {
125         String pathDescriptionProperty = null;
126         NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
127
128         for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
129             Element xmlPropElement = (Element) xmlPropNodes.item(i);
130             if (!xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
131                 .equals(this.xmlElementElement.getAttribute("name"))) {
132                 continue;
133             }
134 //                      This stopped working, replaced with above - should figure out why...
135 //                      if ( !xmlPropElement.getParentNode().isSameNode(this.xmlElementElement))
136 //                              continue;
137             NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
138
139             for (int j = 0; j < childNodes.getLength(); ++j) {
140                 Element childElement = (Element) childNodes.item(j);
141                 // get name
142                 int useValue = VALUE_NONE;
143                 NamedNodeMap attributes = childElement.getAttributes();
144                 for (int k = 0; k < attributes.getLength(); ++k) {
145                     Attr attr = (Attr) attributes.item(k);
146                     String attrName = attr.getNodeName();
147                     String attrValue = attr.getNodeValue();
148                     if (attrName == null || attrValue == null) {
149                         continue;
150                     }
151                     if (attrName.equals("name") && attrValue.equals("description")) {
152                         useValue = VALUE_DESCRIPTION;
153                     }
154                     if (useValue == VALUE_DESCRIPTION && attrName.equals("value")) {
155                         pathDescriptionProperty = attrValue;
156                     }
157                 }
158             }
159         }
160         if (pathDescriptionProperty != null) {
161             //suppress non-printable characters in a description
162             String replaceDescription = pathDescriptionProperty.replaceAll("[^\\p{ASCII}]", "");
163             return replaceDescription;
164         }
165         return pathDescriptionProperty;
166     }
167
168     public Vector<String> getProps(int needValue) {
169         Vector<String> props = new Vector<String>();
170         NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
171
172         for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
173             Element xmlPropElement = (Element) xmlPropNodes.item(i);
174             if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
175                 continue;
176             }
177             NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
178             for (int j = 0; j < childNodes.getLength(); ++j) {
179                 Element childElement = (Element) childNodes.item(j);
180                 // get name
181                 int useValue = VALUE_NONE;
182                 NamedNodeMap attributes = childElement.getAttributes();
183                 for (int k = 0; k < attributes.getLength(); ++k) {
184                     Attr attr = (Attr) attributes.item(k);
185                     String attrName = attr.getNodeName();
186                     String attrValue = attr.getNodeValue();
187                     if (attrName == null || attrValue == null) {
188                         continue;
189                     }
190                     if (needValue == VALUE_INDEXED_PROPS && attrValue.equals("indexedProps")) {
191                         useValue = VALUE_INDEXED_PROPS;
192                     } else if (needValue == VALUE_DSLSTARTNODE &&
193                         attrValue.equals("dslStartNodeProps")) {
194                         useValue = VALUE_DSLSTARTNODE;
195                     }
196                     if (useValue != VALUE_NONE && attrName.equals("value")) {
197                         props = getProps(attrValue);
198                     }
199                 }
200             }
201         }
202         return props;
203     }
204
205     private static Vector<String> getProps(String attrValue) {
206         if (attrValue == null) {
207             return null;
208         }
209         StringTokenizer st = new StringTokenizer(attrValue, ",");
210         if (st.countTokens() == 0) {
211             return null;
212         }
213         Vector<String> result = new Vector<String>();
214         while (st.hasMoreTokens()) {
215             result.add(st.nextToken());
216         }
217         return result;
218     }
219
220     public Vector<String> getIndexedProps() {
221         return getProps(VALUE_INDEXED_PROPS);
222     }
223
224     public Vector<String> getDslStartNodeProps() {
225         return getProps(VALUE_DSLSTARTNODE);
226     }
227
228     public String getContainerProperty() {
229         NodeList xmlPropNodes = this.getElementsByTagName("xml-properties");
230         String container = null;
231         for (int i = 0; i < xmlPropNodes.getLength(); ++i) {
232             Element xmlPropElement = (Element) xmlPropNodes.item(i);
233             if (!xmlPropElement.getParentNode().isSameNode(this.xmlElementElement)) {
234                 continue;
235             }
236             NodeList childNodes = xmlPropElement.getElementsByTagName("xml-property");
237             for (int j = 0; j < childNodes.getLength(); ++j) {
238                 Element childElement = (Element) childNodes.item(j);
239                 // get name
240                 int useValue = VALUE_NONE;
241                 NamedNodeMap attributes = childElement.getAttributes();
242                 for (int k = 0; k < attributes.getLength(); ++k) {
243                     Attr attr = (Attr) attributes.item(k);
244                     String attrName = attr.getNodeName();
245                     String attrValue = attr.getNodeValue();
246                     if (attrName == null || attrValue == null) {
247                         continue;
248                     }
249                     if (useValue == VALUE_CONTAINER && attrName.equals("value")) {
250                         container = attrValue;
251                     }
252                     if (attrValue.equals("container")) {
253                         useValue = VALUE_CONTAINER;
254                     }
255                 }
256             }
257         }
258         return container;
259     }
260
261     public String getQueryParamYAML() {
262         StringBuilder sbParameter = new StringBuilder();
263         sbParameter.append("        - name: ").append(this.getAttribute("name")).append("\n");
264         sbParameter.append(("          in: query\n"));
265         if (this.getAttribute("description") != null &&
266             this.getAttribute("description").length() > 0) {
267             sbParameter.append("          description: ").append(this.getAttribute("description"))
268                 .append("\n");
269         } else {
270             sbParameter.append(("          description: n/a\n"));
271         }
272         sbParameter.append(("          required: false\n"));
273         if (("java.lang.String").equals(this.getAttribute("type"))) {
274             sbParameter.append("          type: string\n");
275         }
276         if (("java.lang.Long").equals(this.getAttribute("type"))) {
277             sbParameter.append("          type: integer\n");
278             sbParameter.append("          format: int64\n");
279         }
280         if (("java.lang.Integer").equals(this.getAttribute("type"))) {
281             sbParameter.append("          type: integer\n");
282             sbParameter.append("          format: int32\n");
283         }
284         if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
285             sbParameter.append("          type: boolean\n");
286         }
287         return sbParameter.toString();
288     }
289
290     public String getPathParamYAML(String elementDescription) {
291         return getPathParamYAML(elementDescription, null);
292     }
293
294     public String getPathParamYAML(String elementDescription, String overrideName) {
295         // updated to allow caller to provide parameter name to use in API
296         StringBuilder sbParameter = new StringBuilder();
297         if (overrideName == null) {
298             overrideName = this.getAttribute("name");
299         }
300         sbParameter.append("        - name: ").append(overrideName).append("\n");
301         sbParameter.append(("          in: path\n"));
302         if (elementDescription != null && elementDescription.length() > 0) {
303             sbParameter.append("          description: ").append(elementDescription).append("\n");
304         }
305         sbParameter.append(("          required: true\n"));
306         if (("java.lang.String").equals(this.getAttribute("type"))) {
307             sbParameter.append("          type: string\n");
308         }
309         if (("java.lang.Long").equals(this.getAttribute("type"))) {
310             sbParameter.append("          type: integer\n");
311             sbParameter.append("          format: int64\n");
312         }
313         if (("java.lang.Integer").equals(this.getAttribute("type"))) {
314             sbParameter.append("          type: integer\n");
315             sbParameter.append("          format: int32\n");
316         }
317         if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
318             sbParameter.append("          type: boolean\n");
319         }
320         if (StringUtils.isNotBlank(this.getAttribute("name"))) {
321             sbParameter.append("          example: " + "__")
322                 .append(this.getAttribute("name").toUpperCase()).append("__").append("\n");
323         }
324         return sbParameter.toString();
325     }
326
327     public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
328         StringBuilder sbElement = new StringBuilder();
329         String elementName = this.getAttribute("name");
330         String elementType = this.getAttribute("type");
331         String elementContainerType = this.getAttribute("container-type");
332         String elementIsRequired = this.getAttribute("required");
333         String addType = elementType.contains("." + v.toString() + ".") ?
334             elementType.substring(elementType.lastIndexOf('.') + 1) : null;
335
336         if (addType != null) {
337             sbElement.append("        <xs:element ref=\"tns:")
338                 .append(driver.getXmlRootElementName(addType)).append("\"");
339         } else {
340             sbElement.append("        <xs:element name=\"").append(elementName).append("\"");
341         }
342         if (elementType.equals("java.lang.String")) {
343             sbElement.append(" type=\"xs:string\"");
344         }
345         if (elementType.equals("java.lang.Long")) {
346             sbElement.append(" type=\"xs:unsignedInt\"");
347         }
348         if (elementType.equals("java.lang.Integer")) {
349             sbElement.append(" type=\"xs:int\"");
350         }
351         if (elementType.equals("java.lang.Boolean")) {
352             sbElement.append(" type=\"xs:boolean\"");
353         }
354         if (addType != null || elementType.startsWith("java.lang.")) {
355             sbElement.append(" minOccurs=\"0\"");
356         }
357         if (elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
358             sbElement.append(" maxOccurs=\"").append(maxOccurs).append("\"");
359         }
360         if (useAnnotation) {
361             String annotation = new XSDElement(xmlElementElement, maxOccurs)
362                 .getHTMLAnnotation("field", "          ");
363             sbElement.append(
364                 StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
365             sbElement.append(annotation);
366             sbElement.append(StringUtils.isNotEmpty(annotation) ?
367                 "        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR :
368                 "/>" + OxmFileProcessor.LINE_SEPARATOR);
369         } else {
370             sbElement.append("/>").append(OxmFileProcessor.LINE_SEPARATOR);
371         }
372         return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
373 //              return sbElement.toString();
374     }
375
376     public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v,
377                                         boolean useAnnotation) {
378
379         NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
380
381         String xmlElementWrapper = null;
382         if (childNodes.getLength() > 0) {
383             Element childElement = (Element) childNodes.item(0);
384             // get name
385             xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
386         }
387         if (xmlElementWrapper == null) {
388             return unwrappedElement;
389         }
390
391         StringBuilder sbElement = new StringBuilder();
392         sbElement.append("        <xs:element name=\"").append(xmlElementWrapper).append("\"");
393         String elementType = xmlElementElement.getAttribute("type");
394         String elementIsRequired = this.getAttribute("required");
395         String addType = elementType.contains("." + v.toString() + ".") ?
396             elementType.substring(elementType.lastIndexOf('.') + 1) : null;
397
398         if (elementIsRequired == null || !elementIsRequired.equals("true") || addType != null) {
399             sbElement.append(" minOccurs=\"0\"");
400         }
401         sbElement.append(">").append(OxmFileProcessor.LINE_SEPARATOR);
402         sbElement.append("          <xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
403         if (useAnnotation) {
404             XSDElement javaTypeElement = new XSDElement((Element) this.getParentNode(), maxOccurs);
405             sbElement.append(javaTypeElement.getHTMLAnnotation("class", "            "));
406         }
407         sbElement.append("            <xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
408         sbElement.append("      ");
409         sbElement.append(unwrappedElement);
410         sbElement.append("            </xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
411         sbElement.append("          </xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
412         sbElement.append("        </xs:element>").append(OxmFileProcessor.LINE_SEPARATOR);
413         return sbElement.toString();
414     }
415
416     public String getHTMLAnnotation(String target, String indentation) {
417         StringBuilder sb = new StringBuilder();
418         List<String> metadata = new ArrayList<>();
419         if ("true".equals(this.getAttribute("xml-key"))) {
420             metadata.add("isKey=true");
421         }
422
423         NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
424         Element xmlPropElement = null;
425         for (int i = 0; i < xmlPropTags.getLength(); ++i) {
426             xmlPropElement = (Element) xmlPropTags.item(i);
427             if (xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
428                 .equals(this.xmlElementElement.getAttribute("name"))) {
429                 break;
430             }
431         }
432         if (xmlPropElement != null) {
433             NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
434             for (int i = 0; i < xmlProperties.getLength(); i++) {
435                 Element item = (Element) xmlProperties.item(i);
436                 String name = item.getAttribute("name");
437                 String value = item.getAttribute("value");
438                 if (name.equals("abstract")) {
439                     name = "isAbstract";
440                 } else if (name.equals("extends")) {
441                     name = "extendsFrom";
442                 }
443                 metadata.add(name + "=\"" + value.replaceAll("&", "&amp;") + "\"");
444             }
445         }
446         if (metadata.size() == 0) {
447             return "";
448         }
449         sb.append(indentation).append("<xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
450         sb.append(indentation).append("  <xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR)
451             .append(indentation).append("    <annox:annotate target=\"").append(target)
452             .append("\">@org.onap.aai.annotations.Metadata(").append(Joiner.on(",").join(metadata))
453             .append(")</annox:annotate>").append(OxmFileProcessor.LINE_SEPARATOR)
454             .append(indentation).append("  </xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR);
455         sb.append(indentation).append("</xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
456         return sb.toString();
457     }
458
459     public String getTypePropertyYAML(boolean isDslStartNode) {
460         StringBuilder sbProperties = new StringBuilder();
461         sbProperties.append("      ").append(this.getAttribute("name")).append(":\n");
462         sbProperties.append("        type: ");
463
464         if (("java.lang.String").equals(this.getAttribute("type"))) {
465             sbProperties.append("string\n");
466         } else if (("java.lang.Long").equals(this.getAttribute("type"))) {
467             sbProperties.append("integer\n");
468             sbProperties.append("        format: int64\n");
469         } else if (("java.lang.Integer").equals(this.getAttribute("type"))) {
470             sbProperties.append("integer\n");
471             sbProperties.append("        format: int32\n");
472         } else if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
473             sbProperties.append("boolean\n");
474         }
475         String attrDescription = this.getPathDescriptionProperty();
476         if (attrDescription != null && attrDescription.length() > 0) {
477             if (!isDslStartNode) {
478                 sbProperties.append("        description: ").append(attrDescription).append("\n");
479             } else {
480                 sbProperties.append("        description: |\n");
481                 sbProperties.append("          ").append(attrDescription).append("\n");
482                 sbProperties.append(
483                     "          *This property can be used as a filter to find the start node for a dsl query\n");
484             }
485         } else {
486             if (isDslStartNode) {
487                 sbProperties.append("        description: |\n");
488                 sbProperties.append("          \n");
489                 sbProperties.append(
490                     "          *This property can be used as a filter to find the start node for a dsl query\n");
491             }
492         }
493         String elementAlsoRequiresProperty = this.getRequiresProperty();
494         if (StringUtils.isNotEmpty(elementAlsoRequiresProperty)) {
495             sbProperties.append("        also requires: ").append(elementAlsoRequiresProperty)
496                 .append("\n");
497         }
498         return sbProperties.toString();
499     }
500
501     public boolean isStandardType() {
502         switch (this.getAttribute("type")) {
503             case "java.lang.String":
504             case "java.lang.Long":
505             case "java.lang.Integer":
506             case "java.lang.Boolean":
507                 return true;
508         }
509         return false;
510     }
511
512     @Override
513     public String getNodeName() {
514         return xmlElementElement.getNodeName();
515     }
516
517     @Override
518     public String getNodeValue() throws DOMException {
519         return xmlElementElement.getNodeValue();
520     }
521
522     @Override
523     public void setNodeValue(String nodeValue) throws DOMException {
524         xmlElementElement.setNodeValue(nodeValue);
525     }
526
527     @Override
528     public short getNodeType() {
529         return xmlElementElement.getNodeType();
530     }
531
532     @Override
533     public Node getParentNode() {
534         return xmlElementElement.getParentNode();
535     }
536
537     @Override
538     public NodeList getChildNodes() {
539         return xmlElementElement.getChildNodes();
540     }
541
542     @Override
543     public Node getFirstChild() {
544         return xmlElementElement.getFirstChild();
545     }
546
547     @Override
548     public Node getLastChild() {
549         return xmlElementElement.getLastChild();
550     }
551
552     @Override
553     public Node getPreviousSibling() {
554         return xmlElementElement.getPreviousSibling();
555     }
556
557     @Override
558     public Node getNextSibling() {
559         return xmlElementElement.getNextSibling();
560     }
561
562     @Override
563     public NamedNodeMap getAttributes() {
564         return xmlElementElement.getAttributes();
565     }
566
567     @Override
568     public Document getOwnerDocument() {
569         return xmlElementElement.getOwnerDocument();
570     }
571
572     @Override
573     public Node insertBefore(Node newChild, Node refChild) throws DOMException {
574         return xmlElementElement.insertBefore(newChild, refChild);
575     }
576
577     @Override
578     public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
579         return xmlElementElement.replaceChild(newChild, oldChild);
580     }
581
582     @Override
583     public Node removeChild(Node oldChild) throws DOMException {
584         return xmlElementElement.removeChild(oldChild);
585     }
586
587     @Override
588     public Node appendChild(Node newChild) throws DOMException {
589         return xmlElementElement.appendChild(newChild);
590     }
591
592     @Override
593     public boolean hasChildNodes() {
594         return xmlElementElement.hasChildNodes();
595     }
596
597     @Override
598     public Node cloneNode(boolean deep) {
599         return xmlElementElement.cloneNode(deep);
600     }
601
602     @Override
603     public void normalize() {
604         xmlElementElement.normalize();
605     }
606
607     @Override
608     public boolean isSupported(String feature, String version) {
609         return xmlElementElement.isSupported(feature, version);
610     }
611
612     @Override
613     public String getNamespaceURI() {
614         return xmlElementElement.getNamespaceURI();
615     }
616
617     @Override
618     public String getPrefix() {
619         return xmlElementElement.getPrefix();
620     }
621
622     @Override
623     public void setPrefix(String prefix) throws DOMException {
624         xmlElementElement.setPrefix(prefix);
625     }
626
627     @Override
628     public String getLocalName() {
629
630         return xmlElementElement.getLocalName();
631     }
632
633     @Override
634     public boolean hasAttributes() {
635         return xmlElementElement.hasAttributes();
636     }
637
638     @Override
639     public String getBaseURI() {
640         return xmlElementElement.getBaseURI();
641     }
642
643     @Override
644     public short compareDocumentPosition(Node other) throws DOMException {
645         return xmlElementElement.compareDocumentPosition(other);
646     }
647
648     @Override
649     public String getTextContent() throws DOMException {
650         return xmlElementElement.getTextContent();
651     }
652
653     @Override
654     public void setTextContent(String textContent) throws DOMException {
655         xmlElementElement.setTextContent(textContent);
656     }
657
658     @Override
659     public boolean isSameNode(Node other) {
660         return xmlElementElement.isSameNode(other);
661     }
662
663     @Override
664     public String lookupPrefix(String namespaceURI) {
665         return xmlElementElement.lookupPrefix(namespaceURI);
666     }
667
668     @Override
669     public boolean isDefaultNamespace(String namespaceURI) {
670         return xmlElementElement.isDefaultNamespace(namespaceURI);
671     }
672
673     @Override
674     public String lookupNamespaceURI(String prefix) {
675         return xmlElementElement.lookupNamespaceURI(prefix);
676     }
677
678     @Override
679     public boolean isEqualNode(Node arg) {
680         return xmlElementElement.isEqualNode(arg);
681     }
682
683     @Override
684     public Object getFeature(String feature, String version) {
685         return xmlElementElement.getFeature(feature, version);
686     }
687
688     @Override
689     public Object setUserData(String key, Object data, UserDataHandler handler) {
690         return xmlElementElement.setUserData(key, data, handler);
691     }
692
693     @Override
694     public Object getUserData(String key) {
695         return xmlElementElement.getUserData(key);
696     }
697
698     @Override
699     public String getTagName() {
700         return xmlElementElement.getTagName();
701     }
702
703     @Override
704     public String getAttribute(String name) {
705         return xmlElementElement.getAttribute(name);
706     }
707
708     @Override
709     public void setAttribute(String name, String value) throws DOMException {
710         xmlElementElement.setAttribute(name, value);
711     }
712
713     @Override
714     public void removeAttribute(String name) throws DOMException {
715         xmlElementElement.removeAttribute(name);
716     }
717
718     @Override
719     public Attr getAttributeNode(String name) {
720         return xmlElementElement.getAttributeNode(name);
721     }
722
723     @Override
724     public Attr setAttributeNode(Attr newAttr) throws DOMException {
725         return xmlElementElement.setAttributeNode(newAttr);
726     }
727
728     @Override
729     public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
730         return xmlElementElement.removeAttributeNode(oldAttr);
731     }
732
733     @Override
734     public NodeList getElementsByTagName(String name) {
735         return xmlElementElement.getElementsByTagName(name);
736     }
737
738     @Override
739     public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
740         return xmlElementElement.getAttributeNS(namespaceURI, localName);
741     }
742
743     @Override
744     public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
745         throws DOMException {
746         xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
747     }
748
749     @Override
750     public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
751         xmlElementElement.removeAttributeNS(namespaceURI, localName);
752     }
753
754     @Override
755     public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
756         return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
757     }
758
759     @Override
760     public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
761         return xmlElementElement.setAttributeNodeNS(newAttr);
762     }
763
764     @Override
765     public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
766         throws DOMException {
767         return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
768     }
769
770     @Override
771     public boolean hasAttribute(String name) {
772         return xmlElementElement.hasAttribute(name);
773     }
774
775     @Override
776     public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
777         return xmlElementElement.hasAttributeNS(namespaceURI, localName);
778     }
779
780     @Override
781     public TypeInfo getSchemaTypeInfo() {
782         return xmlElementElement.getSchemaTypeInfo();
783     }
784
785     @Override
786     public void setIdAttribute(String name, boolean isId) throws DOMException {
787         xmlElementElement.setIdAttribute(name, isId);
788
789     }
790
791     @Override
792     public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
793         throws DOMException {
794         xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
795     }
796
797     @Override
798     public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
799         xmlElementElement.setIdAttributeNode(idAttr, isId);
800     }
801
802
803 }