9de7967e04f779cc3de8902847430f57d5abae82
[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                 StringBuffer sbParameter = new StringBuffer();
239                 sbParameter.append(("        - name: " + this.getAttribute("name") + "\n"));
240                 sbParameter.append(("          in: query\n"));
241                 if ( this.getAttribute("description") != null && this.getAttribute("description").length() > 0 )
242                         sbParameter.append(("          description: " + this.getAttribute("description") + "\n"));
243                 else
244                         sbParameter.append(("          description:\n"));
245                 sbParameter.append(("          required: false\n"));
246                 if ( ("java.lang.String").equals(this.getAttribute("type")))
247                         sbParameter.append("          type: string\n");
248                 if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
249                         sbParameter.append("          type: integer\n");
250                         sbParameter.append("          format: int64\n");
251                 }
252                 if ( ("java.lang.Integer").equals(this.getAttribute("type"))) {
253                         sbParameter.append("          type: integer\n");
254                         sbParameter.append("          format: int32\n");
255                 }
256                 if ( ("java.lang.Boolean").equals(this.getAttribute("type"))) {
257                         sbParameter.append("          type: boolean\n");
258                 }
259                 return sbParameter.toString();
260         }
261         
262         public String getPathParamYAML(String elementDescription) {
263                 StringBuffer sbParameter = new StringBuffer();
264                 sbParameter.append(("        - name: " + this.getAttribute("name") + "\n"));
265                 sbParameter.append(("          in: path\n"));
266                 if ( elementDescription != null && elementDescription.length() > 0 )
267                         sbParameter.append(("          description: " + elementDescription + "\n"));
268                 sbParameter.append(("          required: true\n"));
269                 if ( ("java.lang.String").equals(this.getAttribute("type")))
270                         sbParameter.append("          type: string\n");
271                 if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
272                         sbParameter.append("          type: integer\n");
273                         sbParameter.append("          format: int64\n");
274                 }
275                 if ( ("java.lang.Integer").equals(this.getAttribute("type"))) {
276                         sbParameter.append("          type: integer\n");
277                         sbParameter.append("          format: int32\n");
278                 }
279                 if ( ("java.lang.Boolean").equals(this.getAttribute("type"))) {
280                         sbParameter.append("          type: boolean\n");
281                 }
282                 if(StringUtils.isNotBlank(this.getAttribute("name"))) {
283                         sbParameter.append("          example: "+"__"+this.getAttribute("name").toUpperCase()+"__"+"\n");
284                 }
285                 return sbParameter.toString();
286         }
287         
288         public String getHTMLElement(SchemaVersion v, boolean useAnnotation, HTMLfromOXM driver) {
289                 StringBuffer sbElement = new StringBuffer();
290                 String elementName = this.getAttribute("name");
291                 String elementType = this.getAttribute("type");
292                 String elementContainerType = this.getAttribute("container-type");
293                 String elementIsRequired = this.getAttribute("required");
294                 String addType = elementType.contains("." + v.toString() + ".") ? elementType.substring(elementType.lastIndexOf('.')+1) : null;
295
296                 if ( addType != null ) {
297                         sbElement.append("        <xs:element ref=\"tns:" + driver.getXmlRootElementName(addType)+"\"");
298                 } else {
299                         sbElement.append("        <xs:element name=\"" + elementName +"\"");
300                 }
301                 if ( elementType.equals("java.lang.String"))
302                         sbElement.append(" type=\"xs:string\"");
303                 if ( elementType.equals("java.lang.Long"))
304                         sbElement.append(" type=\"xs:unsignedInt\"");
305                 if ( elementType.equals("java.lang.Integer"))
306                         sbElement.append(" type=\"xs:int\"");
307                 if ( elementType.equals("java.lang.Boolean"))
308                         sbElement.append(" type=\"xs:boolean\"");
309                 if ( addType != null || elementType.startsWith("java.lang.") ) {        
310                         sbElement.append(" minOccurs=\"0\"");
311                 } 
312                 if ( elementContainerType != null && elementContainerType.equals("java.util.ArrayList")) {
313                         sbElement.append(" maxOccurs=\"" + maxOccurs + "\"");
314                 }
315                 if(useAnnotation) {                             
316                         String annotation = new XSDElement(xmlElementElement, maxOccurs).getHTMLAnnotation("field", "          ");
317                         sbElement.append(StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : "");
318                                 sbElement.append(annotation);
319                                 sbElement.append(StringUtils.isNotEmpty(annotation) ? "        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR : "/>" + OxmFileProcessor.LINE_SEPARATOR );
320                 } else {
321                         sbElement.append("/>" + OxmFileProcessor.LINE_SEPARATOR);
322                 }
323                 return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation);
324 //              return sbElement.toString();
325         }
326         
327         public String getHTMLElementWrapper(String unwrappedElement, SchemaVersion v, boolean useAnnotation) {
328                 
329                 NodeList childNodes = this.getElementsByTagName("xml-element-wrapper");
330                 
331                 String xmlElementWrapper = null;
332                 if ( childNodes.getLength() > 0 ) {
333                         Element childElement = (Element)childNodes.item(0);
334                         // get name
335                         xmlElementWrapper = childElement == null ? null : childElement.getAttribute("name");
336                 }
337                 if(xmlElementWrapper == null)
338                         return unwrappedElement;
339                 
340                 StringBuffer sbElement = new StringBuffer();
341                 sbElement.append("        <xs:element name=\"" + xmlElementWrapper +"\"");
342                 String elementType = xmlElementElement.getAttribute("type");
343                 String elementIsRequired = this.getAttribute("required");
344                 String addType = elementType.contains("." + v.toString() + ".") ? elementType.substring(elementType.lastIndexOf('.')+1) : null;
345
346                 if ( elementIsRequired == null || !elementIsRequired.equals("true")||addType != null) { 
347                         sbElement.append(" minOccurs=\"0\"");   
348                 } 
349                 sbElement.append(">" + OxmFileProcessor.LINE_SEPARATOR);
350                 sbElement.append("          <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
351                 if(useAnnotation) {
352                         XSDElement javaTypeElement = new XSDElement((Element)this.getParentNode(), maxOccurs);
353                         sbElement.append(javaTypeElement.getHTMLAnnotation("class", "            "));
354                 }
355                 sbElement.append("            <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
356                 sbElement.append("      ");
357                 sbElement.append(unwrappedElement);
358                 sbElement.append("            </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
359                 sbElement.append("          </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
360                 sbElement.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
361                 return sbElement.toString();
362         }
363         
364         public String getHTMLAnnotation(String target, String indentation) {
365                 StringBuffer sb = new StringBuffer();
366                 List<String> metadata = new ArrayList<>();
367                 if("true".equals(this.getAttribute("xml-key")) ) {
368                         metadata.add("isKey=true");
369                 }
370                 
371                 NodeList xmlPropTags = this.getElementsByTagName("xml-properties");
372                 Element xmlPropElement = null;
373                 for ( int i = 0; i < xmlPropTags.getLength(); ++i ) {
374                         xmlPropElement = (Element)xmlPropTags.item(i);
375                         if (! xmlPropElement.getParentNode().getAttributes().getNamedItem("name").getNodeValue().equals(this.xmlElementElement.getAttribute("name")))
376                                 continue;
377                         else
378                                 break;
379                 }
380                 if(xmlPropElement != null) {
381                         NodeList xmlProperties = xmlPropElement.getElementsByTagName("xml-property");
382                         for (int i = 0; i < xmlProperties.getLength(); i++) {
383                                 Element item = (Element)xmlProperties.item(i);
384                                 String name = item.getAttribute("name");
385                                 String value = item.getAttribute("value");
386                                 if (name.equals("abstract")) {
387                                         name = "isAbstract";
388                                 } else if (name.equals("extends")) {
389                                         name = "extendsFrom";
390                                 }
391                                 metadata.add(name + "=\"" + value.replaceAll("&",  "&amp;") + "\"");
392                         }
393                 }
394                 if(metadata.size() == 0) {                      
395                         return "";
396                 }
397                 sb.append(indentation +"<xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
398                 sb.append(
399                         indentation + "  <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + 
400                         indentation + "    <annox:annotate target=\""+target+"\">@org.onap.aai.annotations.Metadata(" + Joiner.on(",").join(metadata) + ")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR +
401                         indentation + "  </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
402                 sb.append(indentation +"</xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
403                 return sb.toString();
404         }
405
406         public String getTypePropertyYAML() {
407                 StringBuffer sbProperties = new StringBuffer();
408                 sbProperties.append("      " + this.getAttribute("name") + ":\n");
409                 sbProperties.append("        type: ");
410
411                 if (  ("java.lang.String").equals(this.getAttribute("type")))
412                         sbProperties.append("string\n");
413                 else if ( ("java.lang.Long").equals(this.getAttribute("type"))) {
414                         sbProperties.append("integer\n");
415                         sbProperties.append("        format: int64\n");
416                 }
417                 else if ( ("java.lang.Integer").equals(this.getAttribute("type"))){
418                         sbProperties.append("integer\n");
419                         sbProperties.append("        format: int32\n");
420                 }
421                 else if ( ("java.lang.Boolean").equals(this.getAttribute("type")))
422                         sbProperties.append("boolean\n");
423                 String attrDescription = this.getPathDescriptionProperty();
424                 if ( attrDescription != null && attrDescription.length() > 0 )
425                         sbProperties.append("        description: " + attrDescription + "\n");
426                 String elementAlsoRequiresProperty=this.getRequiresProperty();
427                 if ( StringUtils.isNotEmpty(elementAlsoRequiresProperty) )
428                         sbProperties.append("        also requires: " + elementAlsoRequiresProperty + "\n");
429                 return sbProperties.toString();
430         }
431         
432         public boolean isStandardType()
433         {
434                 switch ( this.getAttribute("type") ) {
435                 case "java.lang.String":
436                 case "java.lang.Long":
437                 case "java.lang.Integer":
438                 case"java.lang.Boolean":
439                         return true;
440                 }
441                 return false;
442         }
443
444         @Override
445         public String getNodeName() {
446                 return xmlElementElement.getNodeName();
447         }
448
449         @Override
450         public String getNodeValue() throws DOMException {
451                 return xmlElementElement.getNodeValue();
452         }
453
454         @Override
455         public void setNodeValue(String nodeValue) throws DOMException {
456                 xmlElementElement.setNodeValue(nodeValue);
457         }
458
459         @Override
460         public short getNodeType() {
461                 return xmlElementElement.getNodeType();
462         }
463
464         @Override
465         public Node getParentNode() {
466                 return xmlElementElement.getParentNode();
467         }
468
469         @Override
470         public NodeList getChildNodes() {
471                 return xmlElementElement.getChildNodes();
472         }
473
474         @Override
475         public Node getFirstChild() {
476                 return xmlElementElement.getFirstChild();
477         }
478
479         @Override
480         public Node getLastChild() {
481                 return xmlElementElement.getLastChild();
482         }
483
484         @Override
485         public Node getPreviousSibling() {
486                 return xmlElementElement.getPreviousSibling();
487         }
488
489         @Override
490         public Node getNextSibling() {
491                 return xmlElementElement.getNextSibling();
492         }
493
494         @Override
495         public NamedNodeMap getAttributes() {
496                 return xmlElementElement.getAttributes();
497         }
498
499         @Override
500         public Document getOwnerDocument() {
501                 return xmlElementElement.getOwnerDocument();
502         }
503
504         @Override
505         public Node insertBefore(Node newChild, Node refChild) throws DOMException {
506                 return xmlElementElement.insertBefore(newChild, refChild);
507         }
508
509         @Override
510         public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
511                 return xmlElementElement.replaceChild(newChild, oldChild);
512         }
513
514         @Override
515         public Node removeChild(Node oldChild) throws DOMException {
516                 return xmlElementElement.removeChild(oldChild);
517         }
518
519         @Override
520         public Node appendChild(Node newChild) throws DOMException {
521                 return xmlElementElement.appendChild(newChild);
522         }
523
524         @Override
525         public boolean hasChildNodes() {
526                 return xmlElementElement.hasChildNodes();
527         }
528
529         @Override
530         public Node cloneNode(boolean deep) {
531                 return xmlElementElement.cloneNode(deep);
532         }
533
534         @Override
535         public void normalize() {
536                 xmlElementElement.normalize();
537         }
538
539         @Override
540         public boolean isSupported(String feature, String version) {
541                 return xmlElementElement.isSupported(feature, version);
542         }
543
544         @Override
545         public String getNamespaceURI() {
546                 return xmlElementElement.getNamespaceURI();
547         }
548
549         @Override
550         public String getPrefix() {
551                 return xmlElementElement.getPrefix();
552         }
553
554         @Override
555         public void setPrefix(String prefix) throws DOMException {
556                 xmlElementElement.setPrefix(prefix);
557         }
558
559         @Override
560         public String getLocalName() {
561
562                 return xmlElementElement.getLocalName();
563         }
564
565         @Override
566         public boolean hasAttributes() {
567                 return xmlElementElement.hasAttributes();
568         }
569
570         @Override
571         public String getBaseURI() {
572                 return xmlElementElement.getBaseURI();
573         }
574
575         @Override
576         public short compareDocumentPosition(Node other) throws DOMException {
577                 return xmlElementElement.compareDocumentPosition(other);
578         }
579
580         @Override
581         public String getTextContent() throws DOMException {
582                 return xmlElementElement.getTextContent();
583         }
584
585         @Override
586         public void setTextContent(String textContent) throws DOMException {
587                 xmlElementElement.setTextContent(textContent);
588         }
589
590         @Override
591         public boolean isSameNode(Node other) {
592                 return xmlElementElement.isSameNode(other);
593         }
594
595         @Override
596         public String lookupPrefix(String namespaceURI) {
597                 return xmlElementElement.lookupPrefix(namespaceURI);
598         }
599
600         @Override
601         public boolean isDefaultNamespace(String namespaceURI) {
602                 return xmlElementElement.isDefaultNamespace(namespaceURI);
603         }
604
605         @Override
606         public String lookupNamespaceURI(String prefix) {
607                 return xmlElementElement.lookupNamespaceURI(prefix);
608         }
609
610         @Override
611         public boolean isEqualNode(Node arg) {
612                 return xmlElementElement.isEqualNode(arg);
613         }
614
615         @Override
616         public Object getFeature(String feature, String version) {
617                 return xmlElementElement.getFeature(feature, version);
618         }
619
620         @Override
621         public Object setUserData(String key, Object data, UserDataHandler handler) {
622                 return xmlElementElement.setUserData(key, data, handler);
623         }
624
625         @Override
626         public Object getUserData(String key) {
627                 return xmlElementElement.getUserData(key);
628         }
629
630         @Override
631         public String getTagName() {
632                 return xmlElementElement.getTagName();
633         }
634
635         @Override
636         public String getAttribute(String name) {
637                 return xmlElementElement.getAttribute(name);
638         }
639
640         @Override
641         public void setAttribute(String name, String value) throws DOMException {
642                 xmlElementElement.setAttribute(name, value);
643         }
644
645         @Override
646         public void removeAttribute(String name) throws DOMException {
647                 xmlElementElement.removeAttribute(name);
648         }
649
650         @Override
651         public Attr getAttributeNode(String name) {
652                 return xmlElementElement.getAttributeNode(name);
653         }
654
655         @Override
656         public Attr setAttributeNode(Attr newAttr) throws DOMException {
657                 return xmlElementElement.setAttributeNode(newAttr);
658         }
659
660         @Override
661         public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
662                 return xmlElementElement.removeAttributeNode(oldAttr);
663         }
664
665         @Override
666         public NodeList getElementsByTagName(String name) {
667                 return xmlElementElement.getElementsByTagName(name);
668         }
669
670         @Override
671         public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
672                 return xmlElementElement.getAttributeNS(namespaceURI, localName);
673         }
674
675         @Override
676         public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException {
677                  xmlElementElement.setAttributeNS(namespaceURI, qualifiedName, value);
678                  return;
679         }
680
681         @Override
682         public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
683                 xmlElementElement.removeAttributeNS(namespaceURI, localName);
684         }
685
686         @Override
687         public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
688                 return xmlElementElement.getAttributeNodeNS(namespaceURI, localName);
689         }
690
691         @Override
692         public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
693                 return xmlElementElement.setAttributeNodeNS(newAttr);
694         }
695
696         @Override
697         public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
698                 return xmlElementElement.getElementsByTagNameNS(namespaceURI, localName);
699         }
700
701         @Override
702         public boolean hasAttribute(String name) {
703                 return xmlElementElement.hasAttribute(name);
704         }
705
706         @Override
707         public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
708                 return xmlElementElement.hasAttributeNS(namespaceURI, localName);
709         }
710
711         @Override
712         public TypeInfo getSchemaTypeInfo() {
713                 return xmlElementElement.getSchemaTypeInfo();
714         }
715
716         @Override
717         public void setIdAttribute(String name, boolean isId) throws DOMException {
718                 xmlElementElement.setIdAttribute(name, isId);
719
720         }
721
722         @Override
723         public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
724                 xmlElementElement.setIdAttributeNS(namespaceURI, localName, isId);
725         }
726
727         @Override
728         public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
729                 xmlElementElement.setIdAttributeNode(idAttr, isId);
730                 return;
731         }
732
733
734 }