7cddc7be810e33e16dc67079cc17c8b3255b28b0
[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         }
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.Float").equals(this.getAttribute("type"))) {
285             sbParameter.append("          type: number\n");
286             sbParameter.append("          format: float\n");
287         }
288         if (("java.lang.Double").equals(this.getAttribute("type"))) {
289             sbParameter.append("          type: number\n");
290             sbParameter.append("          format: double\n");
291         }
292         if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
293             sbParameter.append("          type: boolean\n");
294         }
295         return sbParameter.toString();
296     }
297
298     public String getPathParamYAML(String elementDescription) {
299         return getPathParamYAML(elementDescription, null);
300     }
301
302     public String getPathParamYAML(String elementDescription, String overrideName) {
303         // updated to allow caller to provide parameter name to use in API
304         StringBuilder sbParameter = new StringBuilder();
305         if (overrideName == null) {
306             overrideName = this.getAttribute("name");
307         }
308         sbParameter.append("        - name: ").append(overrideName).append("\n");
309         sbParameter.append(("          in: path\n"));
310         if (elementDescription != null && elementDescription.length() > 0) {
311             sbParameter.append("          description: ").append(elementDescription).append("\n");
312         }
313         sbParameter.append(("          required: true\n"));
314         if (("java.lang.String").equals(this.getAttribute("type"))) {
315             sbParameter.append("          type: string\n");
316         }
317         if (("java.lang.Long").equals(this.getAttribute("type"))) {
318             sbParameter.append("          type: integer\n");
319             sbParameter.append("          format: int64\n");
320         }
321         if (("java.lang.Integer").equals(this.getAttribute("type"))) {
322             sbParameter.append("          type: integer\n");
323             sbParameter.append("          format: int32\n");
324         }
325         if (("java.lang.Float").equals(this.getAttribute("type"))) {
326             sbParameter.append("          type: number\n");
327             sbParameter.append("          format: float\n");
328         }
329         if (("java.lang.Double").equals(this.getAttribute("type"))) {
330             sbParameter.append("          type: number\n");
331             sbParameter.append("          format: double\n");
332         }
333         if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
334             sbParameter.append("          type: boolean\n");
335         }
336         return sbParameter.toString();
337     }
338
339     public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
340         StringBuilder sbElement = new StringBuilder();
341         String elementName = this.getAttribute("name");
342         String elementType = this.getAttribute("type");
343         String elementContainerType = this.getAttribute("container-type");
344         String elementIsRequired = this.getAttribute("required");
345         String addType = elementType.contains("." + v.toString() + ".")
346             ? elementType.substring(elementType.lastIndexOf('.') + 1)
347             : null;
348
349         if (addType != null) {
350             sbElement.append("        <xs:element ref=\"tns:")
351                 .append(driver.getXmlRootElementName(addType)).append("\"");
352         } else {
353             sbElement.append("        <xs:element name=\"").append(elementName).append("\"");
354         }
355         if (elementType.equals("java.lang.String")) {
356             sbElement.append(" type=\"xs:string\"");
357         }
358         if (elementType.equals("java.lang.Long")) {
359             sbElement.append(" type=\"xs:unsignedInt\"");
360         }
361         if (elementType.equals("java.lang.Integer")) {
362             sbElement.append(" type=\"xs:int\"");
363         }
364         if (elementType.equals("java.lang.Float")) {
365             sbElement.append(" type=\"xs:float\"");
366         }
367         if (elementType.equals("java.lang.Double")) {
368             sbElement.append(" type=\"xs:double\"");
369         }
370         if (elementType.equals("java.lang.Boolean")) {
371             sbElement.append(" type=\"xs:boolean\"");
372         }
373         if (addType != null || elementType.startsWith("java.lang.")) {
374             sbElement.append(" minOccurs=\"0\"");
375         }
376         if (elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
377             sbElement.append(" maxOccurs=\"").append(maxOccurs).append("\"");
378         }
379         if (useAnnotation) {
380             String annotation = new XSDElement(xmlElementElement, maxOccurs)
381                 .getHTMLAnnotation("field", "          ");
382             sbElement.append(
383                 StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
384             sbElement.append(annotation);
385             sbElement.append(StringUtils.isNotEmpty(annotation)
386                 ? "        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR
387                 : "/>" + OxmFileProcessor.LINE_SEPARATOR);
388         } else {
389             sbElement.append("/>").append(OxmFileProcessor.LINE_SEPARATOR);
390         }
391         return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
392         // return sbElement.toString();
393     }
394
395     public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v,
396         boolean useAnnotation) {
397
398         NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
399
400         String xmlElementWrapper = null;
401         if (childNodes.getLength() > 0) {
402             Element childElement = (Element) childNodes.item(0);
403             // get name
404             xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
405         }
406         if (xmlElementWrapper == null) {
407             return unwrappedElement;
408         }
409
410         StringBuilder sbElement = new StringBuilder();
411         sbElement.append("        <xs:element name=\"").append(xmlElementWrapper).append("\"");
412         String elementType = xmlElementElement.getAttribute("type");
413         String elementIsRequired = this.getAttribute("required");
414         String addType = elementType.contains("." + v.toString() + ".")
415             ? elementType.substring(elementType.lastIndexOf('.') + 1)
416             : null;
417
418         if (elementIsRequired == null || !elementIsRequired.equals("true") || addType != null) {
419             sbElement.append(" minOccurs=\"0\"");
420         }
421         sbElement.append(">").append(OxmFileProcessor.LINE_SEPARATOR);
422         sbElement.append("          <xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
423         if (useAnnotation) {
424             XSDElement javaTypeElement = new XSDElement((Element) this.getParentNode(), maxOccurs);
425             sbElement.append(javaTypeElement.getHTMLAnnotation("class", "            "));
426         }
427         sbElement.append("            <xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
428         sbElement.append("      ");
429         sbElement.append(unwrappedElement);
430         sbElement.append("            </xs:sequence>").append(OxmFileProcessor.LINE_SEPARATOR);
431         sbElement.append("          </xs:complexType>").append(OxmFileProcessor.LINE_SEPARATOR);
432         sbElement.append("        </xs:element>").append(OxmFileProcessor.LINE_SEPARATOR);
433         return sbElement.toString();
434     }
435
436     public String getHTMLAnnotation(String target, String indentation) {
437         StringBuilder sb = new StringBuilder();
438         List<String> metadata = new ArrayList<>();
439         if ("true".equals(this.getAttribute("xml-key"))) {
440             metadata.add("isKey=true");
441         }
442
443         NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
444         Element xmlPropElement = null;
445         for (int i = 0; i < xmlPropTags.getLength(); ++i) {
446             xmlPropElement = (Element) xmlPropTags.item(i);
447             if (xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue()
448                 .equals(this.xmlElementElement.getAttribute("name"))) {
449                 break;
450             }
451         }
452         if (xmlPropElement != null) {
453             NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
454             for (int i = 0; i < xmlProperties.getLength(); i++) {
455                 Element item = (Element) xmlProperties.item(i);
456                 String name = item.getAttribute("name");
457                 String value = item.getAttribute("value");
458                 if (name.equals("abstract")) {
459                     name = "isAbstract";
460                 } else if (name.equals("extends")) {
461                     name = "extendsFrom";
462                 }
463                 metadata.add(name + "=\"" + value.replaceAll("&", "&amp;") + "\"");
464             }
465         }
466         if (metadata.size() == 0) {
467             return "";
468         }
469         sb.append(indentation).append("<xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
470         sb.append(indentation).append("  <xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR)
471             .append(indentation).append("    <annox:annotate target=\"").append(target)
472             .append("\">@org.onap.aai.annotations.Metadata(").append(Joiner.on(",").join(metadata))
473             .append(")</annox:annotate>").append(OxmFileProcessor.LINE_SEPARATOR)
474             .append(indentation).append("  </xs:appinfo>").append(OxmFileProcessor.LINE_SEPARATOR);
475         sb.append(indentation).append("</xs:annotation>").append(OxmFileProcessor.LINE_SEPARATOR);
476         return sb.toString();
477     }
478
479     public String getTypePropertyYAML(boolean isDslStartNode) {
480         StringBuilder sbProperties = new StringBuilder();
481         sbProperties.append("      ").append(this.getAttribute("name")).append(":\n");
482         sbProperties.append("        type: ");
483
484         if (("java.lang.String").equals(this.getAttribute("type"))) {
485             sbProperties.append("string\n");
486         } else if (("java.lang.Long").equals(this.getAttribute("type"))) {
487             sbProperties.append("integer\n");
488             sbProperties.append("        format: int64\n");
489         } else if (("java.lang.Integer").equals(this.getAttribute("type"))) {
490             sbProperties.append("integer\n");
491             sbProperties.append("        format: int32\n");
492         } else if (("java.lang.Float").equals(this.getAttribute("type"))) {
493             sbProperties.append("number\n");
494             sbProperties.append("        format: float\n");
495         } else if (("java.lang.Double").equals(this.getAttribute("type"))) {
496             sbProperties.append("number\n");
497             sbProperties.append("        format: double\n");
498         } else if (("java.lang.Boolean").equals(this.getAttribute("type"))) {
499             sbProperties.append("boolean\n");
500         }
501         String attrDescription = this.getPathDescriptionProperty();
502         if (attrDescription != null && attrDescription.length() > 0) {
503             if (!isDslStartNode) {
504                 sbProperties.append("        description: ").append(attrDescription).append("\n");
505             } else {
506                 sbProperties.append("        description: |\n");
507                 sbProperties.append("          ").append(attrDescription).append("\n");
508                 sbProperties.append(
509                     "          *This property can be used as a filter to find the start node for a dsl query\n");
510             }
511         } else {
512             if (isDslStartNode) {
513                 sbProperties.append("        description: |\n");
514                 sbProperties.append("          \n");
515                 sbProperties.append(
516                     "          *This property can be used as a filter to find the start node for a dsl query\n");
517             }
518         }
519         return sbProperties.toString();
520     }
521
522     public boolean isStandardType() {
523         switch (this.getAttribute("type")) {
524             case "java.lang.String":
525             case "java.lang.Long":
526             case "java.lang.Integer":
527             case "java.lang.Float":
528             case "java.lang.Double":
529             case "java.lang.Boolean":
530                 return true;
531         }
532         return false;
533     }
534
535     @Override
536     public String getNodeName() {
537         return xmlElementElement.getNodeName();
538     }
539
540     @Override
541     public String getNodeValue() throws DOMException {
542         return xmlElementElement.getNodeValue();
543     }
544
545     @Override
546     public void setNodeValue(String nodeValue) throws DOMException {
547         xmlElementElement.setNodeValue(nodeValue);
548     }
549
550     @Override
551     public short getNodeType() {
552         return xmlElementElement.getNodeType();
553     }
554
555     @Override
556     public Node getParentNode() {
557         return xmlElementElement.getParentNode();
558     }
559
560     @Override
561     public NodeList getChildNodes() {
562         return xmlElementElement.getChildNodes();
563     }
564
565     @Override
566     public Node getFirstChild() {
567         return xmlElementElement.getFirstChild();
568     }
569
570     @Override
571     public Node getLastChild() {
572         return xmlElementElement.getLastChild();
573     }
574
575     @Override
576     public Node getPreviousSibling() {
577         return xmlElementElement.getPreviousSibling();
578     }
579
580     @Override
581     public Node getNextSibling() {
582         return xmlElementElement.getNextSibling();
583     }
584
585     @Override
586     public NamedNodeMap getAttributes() {
587         return xmlElementElement.getAttributes();
588     }
589
590     @Override
591     public Document getOwnerDocument() {
592         return xmlElementElement.getOwnerDocument();
593     }
594
595     @Override
596     public Node insertBefore(Node newChild, Node refChild) throws DOMException {
597         return xmlElementElement.insertBefore(newChild, refChild);
598     }
599
600     @Override
601     public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
602         return xmlElementElement.replaceChild(newChild, oldChild);
603     }
604
605     @Override
606     public Node removeChild(Node oldChild) throws DOMException {
607         return xmlElementElement.removeChild(oldChild);
608     }
609
610     @Override
611     public Node appendChild(Node newChild) throws DOMException {
612         return xmlElementElement.appendChild(newChild);
613     }
614
615     @Override
616     public boolean hasChildNodes() {
617         return xmlElementElement.hasChildNodes();
618     }
619
620     @Override
621     public Node cloneNode(boolean deep) {
622         return xmlElementElement.cloneNode(deep);
623     }
624
625     @Override
626     public void normalize() {
627         xmlElementElement.normalize();
628     }
629
630     @Override
631     public boolean isSupported(String feature, String version) {
632         return xmlElementElement.isSupported(feature, version);
633     }
634
635     @Override
636     public String getNamespaceURI() {
637         return xmlElementElement.getNamespaceURI();
638     }
639
640     @Override
641     public String getPrefix() {
642         return xmlElementElement.getPrefix();
643     }
644
645     @Override
646     public void setPrefix(String prefix) throws DOMException {
647         xmlElementElement.setPrefix(prefix);
648     }
649
650     @Override
651     public String getLocalName() {
652
653         return xmlElementElement.getLocalName();
654     }
655
656     @Override
657     public boolean hasAttributes() {
658         return xmlElementElement.hasAttributes();
659     }
660
661     @Override
662     public String getBaseURI() {
663         return xmlElementElement.getBaseURI();
664     }
665
666     @Override
667     public short compareDocumentPosition(Node other) throws DOMException {
668         return xmlElementElement.compareDocumentPosition(other);
669     }
670
671     @Override
672     public String getTextContent() throws DOMException {
673         return xmlElementElement.getTextContent();
674     }
675
676     @Override
677     public void setTextContent(String textContent) throws DOMException {
678         xmlElementElement.setTextContent(textContent);
679     }
680
681     @Override
682     public boolean isSameNode(Node other) {
683         return xmlElementElement.isSameNode(other);
684     }
685
686     @Override
687     public String lookupPrefix(String namespaceURI) {
688         return xmlElementElement.lookupPrefix(namespaceURI);
689     }
690
691     @Override
692     public boolean isDefaultNamespace(String namespaceURI) {
693         return xmlElementElement.isDefaultNamespace(namespaceURI);
694     }
695
696     @Override
697     public String lookupNamespaceURI(String prefix) {
698         return xmlElementElement.lookupNamespaceURI(prefix);
699     }
700
701     @Override
702     public boolean isEqualNode(Node arg) {
703         return xmlElementElement.isEqualNode(arg);
704     }
705
706     @Override
707     public Object getFeature(String feature, String version) {
708         return xmlElementElement.getFeature(feature, version);
709     }
710
711     @Override
712     public Object setUserData(String key, Object data, UserDataHandler handler) {
713         return xmlElementElement.setUserData(key, data, handler);
714     }
715
716     @Override
717     public Object getUserData(String key) {
718         return xmlElementElement.getUserData(key);
719     }
720
721     @Override
722     public String getTagName() {
723         return xmlElementElement.getTagName();
724     }
725
726     @Override
727     public String getAttribute(String name) {
728         return xmlElementElement.getAttribute(name);
729     }
730
731     @Override
732     public void setAttribute(String name, String value) throws DOMException {
733         xmlElementElement.setAttribute(name, value);
734     }
735
736     @Override
737     public void removeAttribute(String name) throws DOMException {
738         xmlElementElement.removeAttribute(name);
739     }
740
741     @Override
742     public Attr getAttributeNode(String name) {
743         return xmlElementElement.getAttributeNode(name);
744     }
745
746     @Override
747     public Attr setAttributeNode(Attr newAttr) throws DOMException {
748         return xmlElementElement.setAttributeNode(newAttr);
749     }
750
751     @Override
752     public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
753         return xmlElementElement.removeAttributeNode(oldAttr);
754     }
755
756     @Override
757     public NodeList getElementsByTagName(String name) {
758         return xmlElementElement.getElementsByTagName(name);
759     }
760
761     @Override
762     public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
763         return xmlElementElement.getAttributeNS(namespaceURI, localName);
764     }
765
766     @Override
767     public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
768         throws DOMException {
769         xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
770     }
771
772     @Override
773     public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
774         xmlElementElement.removeAttributeNS(namespaceURI, localName);
775     }
776
777     @Override
778     public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
779         return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
780     }
781
782     @Override
783     public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
784         return xmlElementElement.setAttributeNodeNS(newAttr);
785     }
786
787     @Override
788     public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
789         throws DOMException {
790         return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
791     }
792
793     @Override
794     public boolean hasAttribute(String name) {
795         return xmlElementElement.hasAttribute(name);
796     }
797
798     @Override
799     public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
800         return xmlElementElement.hasAttributeNS(namespaceURI, localName);
801     }
802
803     @Override
804     public TypeInfo getSchemaTypeInfo() {
805         return xmlElementElement.getSchemaTypeInfo();
806     }
807
808     @Override
809     public void setIdAttribute(String name, boolean isId) throws DOMException {
810         xmlElementElement.setIdAttribute(name, isId);
811
812     }
813
814     @Override
815     public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
816         throws DOMException {
817         xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
818     }
819
820     @Override
821     public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
822         xmlElementElement.setIdAttributeNode(idAttr, isId);
823     }
824
825 }