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