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