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