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