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