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