
/**
 * ResourceData.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.6.1-wso2v38  Built on : Sep 02, 2019 (07:15:19 UTC)
 */

            
                package org.wso2.carbon.rest.api.stub.types.carbon;
            

            /**
            *  ResourceData bean class
            */
            @SuppressWarnings({"unchecked","unused"})
        
        public  class ResourceData
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = ResourceData
                Namespace URI = http://api.rest.carbon.wso2.org/xsd
                Namespace Prefix = ns1
                */
            

                        /**
                        * field for ContentType
                        */

                        
                                    protected java.lang.String localContentType ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localContentTypeTracker = false ;

                           public boolean isContentTypeSpecified(){
                               return localContentTypeTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getContentType(){
                               return localContentType;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param ContentType
                               */
                               public void setContentType(java.lang.String param){
                            localContentTypeTracker = true;
                                   
                                            this.localContentType=param;
                                    

                               }
                            

                        /**
                        * field for FaultSeqXml
                        */

                        
                                    protected java.lang.String localFaultSeqXml ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localFaultSeqXmlTracker = false ;

                           public boolean isFaultSeqXmlSpecified(){
                               return localFaultSeqXmlTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getFaultSeqXml(){
                               return localFaultSeqXml;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param FaultSeqXml
                               */
                               public void setFaultSeqXml(java.lang.String param){
                            localFaultSeqXmlTracker = true;
                                   
                                            this.localFaultSeqXml=param;
                                    

                               }
                            

                        /**
                        * field for FaultSequenceKey
                        */

                        
                                    protected java.lang.String localFaultSequenceKey ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localFaultSequenceKeyTracker = false ;

                           public boolean isFaultSequenceKeySpecified(){
                               return localFaultSequenceKeyTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getFaultSequenceKey(){
                               return localFaultSequenceKey;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param FaultSequenceKey
                               */
                               public void setFaultSequenceKey(java.lang.String param){
                            localFaultSequenceKeyTracker = true;
                                   
                                            this.localFaultSequenceKey=param;
                                    

                               }
                            

                        /**
                        * field for InSeqXml
                        */

                        
                                    protected java.lang.String localInSeqXml ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localInSeqXmlTracker = false ;

                           public boolean isInSeqXmlSpecified(){
                               return localInSeqXmlTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getInSeqXml(){
                               return localInSeqXml;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param InSeqXml
                               */
                               public void setInSeqXml(java.lang.String param){
                            localInSeqXmlTracker = true;
                                   
                                            this.localInSeqXml=param;
                                    

                               }
                            

                        /**
                        * field for InSequenceKey
                        */

                        
                                    protected java.lang.String localInSequenceKey ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localInSequenceKeyTracker = false ;

                           public boolean isInSequenceKeySpecified(){
                               return localInSequenceKeyTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getInSequenceKey(){
                               return localInSequenceKey;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param InSequenceKey
                               */
                               public void setInSequenceKey(java.lang.String param){
                            localInSequenceKeyTracker = true;
                                   
                                            this.localInSequenceKey=param;
                                    

                               }
                            

                        /**
                        * field for Methods
                        * This was an Array!
                        */

                        
                                    protected java.lang.String[] localMethods ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localMethodsTracker = false ;

                           public boolean isMethodsSpecified(){
                               return localMethodsTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String[]
                           */
                           public  java.lang.String[] getMethods(){
                               return localMethods;
                           }

                           
                        


                               
                              /**
                               * validate the array for Methods
                               */
                              protected void validateMethods(java.lang.String[] param){
                             
                              }


                             /**
                              * Auto generated setter method
                              * @param param Methods
                              */
                              public void setMethods(java.lang.String[] param){
                              
                                   validateMethods(param);

                               localMethodsTracker = true;
                                      
                                      this.localMethods=param;
                              }

                               
                             
                             /**
                             * Auto generated add method for the array for convenience
                             * @param param java.lang.String
                             */
                             public void addMethods(java.lang.String param){
                                   if (localMethods == null){
                                   localMethods = new java.lang.String[]{};
                                   }

                            
                                 //update the setting tracker
                                localMethodsTracker = true;
                            

                               java.util.List list =
                            org.apache.axis2.databinding.utils.ConverterUtil.toList(localMethods);
                               list.add(param);
                               this.localMethods =
                             (java.lang.String[])list.toArray(
                            new java.lang.String[list.size()]);

                             }
                             

                        /**
                        * field for OutSeqXml
                        */

                        
                                    protected java.lang.String localOutSeqXml ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localOutSeqXmlTracker = false ;

                           public boolean isOutSeqXmlSpecified(){
                               return localOutSeqXmlTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getOutSeqXml(){
                               return localOutSeqXml;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param OutSeqXml
                               */
                               public void setOutSeqXml(java.lang.String param){
                            localOutSeqXmlTracker = true;
                                   
                                            this.localOutSeqXml=param;
                                    

                               }
                            

                        /**
                        * field for OutSequenceKey
                        */

                        
                                    protected java.lang.String localOutSequenceKey ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localOutSequenceKeyTracker = false ;

                           public boolean isOutSequenceKeySpecified(){
                               return localOutSequenceKeyTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getOutSequenceKey(){
                               return localOutSequenceKey;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param OutSequenceKey
                               */
                               public void setOutSequenceKey(java.lang.String param){
                            localOutSequenceKeyTracker = true;
                                   
                                            this.localOutSequenceKey=param;
                                    

                               }
                            

                        /**
                        * field for Protocol
                        */

                        
                                    protected int localProtocol ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localProtocolTracker = false ;

                           public boolean isProtocolSpecified(){
                               return localProtocolTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return int
                           */
                           public  int getProtocol(){
                               return localProtocol;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param Protocol
                               */
                               public void setProtocol(int param){
                            
                                       // setting primitive attribute tracker to true
                                       localProtocolTracker =
                                       param != java.lang.Integer.MIN_VALUE;
                                   
                                            this.localProtocol=param;
                                    

                               }
                            

                        /**
                        * field for UriTemplate
                        */

                        
                                    protected java.lang.String localUriTemplate ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localUriTemplateTracker = false ;

                           public boolean isUriTemplateSpecified(){
                               return localUriTemplateTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getUriTemplate(){
                               return localUriTemplate;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param UriTemplate
                               */
                               public void setUriTemplate(java.lang.String param){
                            localUriTemplateTracker = true;
                                   
                                            this.localUriTemplate=param;
                                    

                               }
                            

                        /**
                        * field for UrlMapping
                        */

                        
                                    protected java.lang.String localUrlMapping ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localUrlMappingTracker = false ;

                           public boolean isUrlMappingSpecified(){
                               return localUrlMappingTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getUrlMapping(){
                               return localUrlMapping;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param UrlMapping
                               */
                               public void setUrlMapping(java.lang.String param){
                            localUrlMappingTracker = true;
                                   
                                            this.localUrlMapping=param;
                                    

                               }
                            

                        /**
                        * field for UserAgent
                        */

                        
                                    protected java.lang.String localUserAgent ;
                                
                           /*  This tracker boolean wil be used to detect whether the user called the set method
                          *   for this attribute. It will be used to determine whether to include this field
                           *   in the serialized XML
                           */
                           protected boolean localUserAgentTracker = false ;

                           public boolean isUserAgentSpecified(){
                               return localUserAgentTracker;
                           }

                           

                           /**
                           * Auto generated getter method
                           * @return java.lang.String
                           */
                           public  java.lang.String getUserAgent(){
                               return localUserAgent;
                           }

                           
                        
                            /**
                               * Auto generated setter method
                               * @param param UserAgent
                               */
                               public void setUserAgent(java.lang.String param){
                            localUserAgentTracker = true;
                                   
                                            this.localUserAgent=param;
                                    

                               }
                            

     
     
        /**
        *
        * @param parentQName
        * @param factory
        * @return org.apache.axiom.om.OMElement
        */
       public org.apache.axiom.om.OMElement getOMElement (
               final javax.xml.namespace.QName parentQName,
               final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{


        
               org.apache.axiom.om.OMDataSource dataSource =
                       new org.apache.axis2.databinding.ADBDataSource(this,parentQName);
               return factory.createOMElement(dataSource,parentQName);
            
        }

         public void serialize(final javax.xml.namespace.QName parentQName,
                                       javax.xml.stream.XMLStreamWriter xmlWriter)
                                throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{
                           serialize(parentQName,xmlWriter,false);
         }

         public void serialize(final javax.xml.namespace.QName parentQName,
                               javax.xml.stream.XMLStreamWriter xmlWriter,
                               boolean serializeType)
            throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{
            
                


                java.lang.String prefix = null;
                java.lang.String namespace = null;
                

                    prefix = parentQName.getPrefix();
                    namespace = parentQName.getNamespaceURI();
                    writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter);
                
                  if (serializeType){
               

                   java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://api.rest.carbon.wso2.org/xsd");
                   if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){
                       writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type",
                           namespacePrefix+":ResourceData",
                           xmlWriter);
                   } else {
                       writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type",
                           "ResourceData",
                           xmlWriter);
                   }

               
                   }
                if (localContentTypeTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "contentType", xmlWriter);
                             

                                          if (localContentType==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localContentType);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localFaultSeqXmlTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "faultSeqXml", xmlWriter);
                             

                                          if (localFaultSeqXml==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localFaultSeqXml);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localFaultSequenceKeyTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "faultSequenceKey", xmlWriter);
                             

                                          if (localFaultSequenceKey==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localFaultSequenceKey);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localInSeqXmlTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "inSeqXml", xmlWriter);
                             

                                          if (localInSeqXml==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localInSeqXml);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localInSequenceKeyTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "inSequenceKey", xmlWriter);
                             

                                          if (localInSequenceKey==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localInSequenceKey);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localMethodsTracker){
                             if (localMethods!=null) {
                                   namespace = "http://api.rest.carbon.wso2.org/xsd";
                                   for (int i = 0;i < localMethods.length;i++){
                                        
                                            if (localMethods[i] != null){
                                        
                                                writeStartElement(null, namespace, "methods", xmlWriter);

                                            
                                                        xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMethods[i]));
                                                    
                                                xmlWriter.writeEndElement();
                                              
                                                } else {
                                                   
                                                           // write null attribute
                                                            namespace = "http://api.rest.carbon.wso2.org/xsd";
                                                            writeStartElement(null, namespace, "methods", xmlWriter);
                                                            writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                            xmlWriter.writeEndElement();
                                                       
                                                }

                                   }
                             } else {
                                 
                                         // write the null attribute
                                        // write null attribute
                                           writeStartElement(null, "http://api.rest.carbon.wso2.org/xsd", "methods", xmlWriter);

                                           // write the nil attribute
                                           writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                           xmlWriter.writeEndElement();
                                    
                             }

                        } if (localOutSeqXmlTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "outSeqXml", xmlWriter);
                             

                                          if (localOutSeqXml==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localOutSeqXml);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localOutSequenceKeyTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "outSequenceKey", xmlWriter);
                             

                                          if (localOutSequenceKey==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localOutSequenceKey);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localProtocolTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "protocol", xmlWriter);
                             
                                               if (localProtocol==java.lang.Integer.MIN_VALUE) {
                                           
                                                         throw new org.apache.axis2.databinding.ADBException("protocol cannot be null!!");
                                                      
                                               } else {
                                                    xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtocol));
                                               }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localUriTemplateTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "uriTemplate", xmlWriter);
                             

                                          if (localUriTemplate==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localUriTemplate);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localUrlMappingTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "urlMapping", xmlWriter);
                             

                                          if (localUrlMapping==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localUrlMapping);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             } if (localUserAgentTracker){
                                    namespace = "http://api.rest.carbon.wso2.org/xsd";
                                    writeStartElement(null, namespace, "userAgent", xmlWriter);
                             

                                          if (localUserAgent==null){
                                              // write the nil attribute
                                              
                                                     writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","nil","1",xmlWriter);
                                                  
                                          }else{

                                        
                                                   xmlWriter.writeCharacters(localUserAgent);
                                            
                                          }
                                    
                                   xmlWriter.writeEndElement();
                             }
                    xmlWriter.writeEndElement();
               

        }

        private static java.lang.String generatePrefix(java.lang.String namespace) {
            if(namespace.equals("http://api.rest.carbon.wso2.org/xsd")){
                return "ns1";
            }
            return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
        }

        /**
         * Utility method to write an element start tag.
         */
        private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart,
                                       javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
            java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
            if (writerPrefix != null) {
                xmlWriter.writeStartElement(namespace, localPart);
            } else {
                if (namespace.length() == 0) {
                    prefix = "";
                } else if (prefix == null) {
                    prefix = generatePrefix(namespace);
                }

                xmlWriter.writeStartElement(prefix, localPart, namespace);
                xmlWriter.writeNamespace(prefix, namespace);
                xmlWriter.setPrefix(prefix, namespace);
            }
        }
        
        /**
         * Util method to write an attribute with the ns prefix
         */
        private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,
                                    java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{
            if (xmlWriter.getPrefix(namespace) == null) {
                xmlWriter.writeNamespace(prefix, namespace);
                xmlWriter.setPrefix(prefix, namespace);
            }
            xmlWriter.writeAttribute(namespace,attName,attValue);
        }

        /**
         * Util method to write an attribute without the ns prefix
         */
        private void writeAttribute(java.lang.String namespace,java.lang.String attName,
                                    java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{
            if (namespace.equals("")) {
                xmlWriter.writeAttribute(attName,attValue);
            } else {
                registerPrefix(xmlWriter, namespace);
                xmlWriter.writeAttribute(namespace,attName,attValue);
            }
        }


           /**
             * Util method to write an attribute without the ns prefix
             */
            private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName,
                                             javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {

                java.lang.String attributeNamespace = qname.getNamespaceURI();
                java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
                if (attributePrefix == null) {
                    attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
                }
                java.lang.String attributeValue;
                if (attributePrefix.trim().length() > 0) {
                    attributeValue = attributePrefix + ":" + qname.getLocalPart();
                } else {
                    attributeValue = qname.getLocalPart();
                }

                if (namespace.equals("")) {
                    xmlWriter.writeAttribute(attName, attributeValue);
                } else {
                    registerPrefix(xmlWriter, namespace);
                    xmlWriter.writeAttribute(namespace, attName, attributeValue);
                }
            }
        /**
         *  method to handle Qnames
         */

        private void writeQName(javax.xml.namespace.QName qname,
                                javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
            java.lang.String namespaceURI = qname.getNamespaceURI();
            if (namespaceURI != null) {
                java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
                if (prefix == null) {
                    prefix = generatePrefix(namespaceURI);
                    xmlWriter.writeNamespace(prefix, namespaceURI);
                    xmlWriter.setPrefix(prefix,namespaceURI);
                }

                if (prefix.trim().length() > 0){
                    xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
                } else {
                    // i.e this is the default namespace
                    xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
                }

            } else {
                xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
            }
        }

        private void writeQNames(javax.xml.namespace.QName[] qnames,
                                 javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {

            if (qnames != null) {
                // we have to store this data until last moment since it is not possible to write any
                // namespace data after writing the charactor data
                java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
                java.lang.String namespaceURI = null;
                java.lang.String prefix = null;

                for (int i = 0; i < qnames.length; i++) {
                    if (i > 0) {
                        stringToWrite.append(" ");
                    }
                    namespaceURI = qnames[i].getNamespaceURI();
                    if (namespaceURI != null) {
                        prefix = xmlWriter.getPrefix(namespaceURI);
                        if ((prefix == null) || (prefix.length() == 0)) {
                            prefix = generatePrefix(namespaceURI);
                            xmlWriter.writeNamespace(prefix, namespaceURI);
                            xmlWriter.setPrefix(prefix,namespaceURI);
                        }

                        if (prefix.trim().length() > 0){
                            stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                        } else {
                            stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                        }
                    } else {
                        stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
                    }
                }
                xmlWriter.writeCharacters(stringToWrite.toString());
            }

        }


        /**
         * Register a namespace prefix
         */
        private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException {
            java.lang.String prefix = xmlWriter.getPrefix(namespace);
            if (prefix == null) {
                prefix = generatePrefix(namespace);
                while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
                    prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
                }
                xmlWriter.writeNamespace(prefix, namespace);
                xmlWriter.setPrefix(prefix, namespace);
            }
            return prefix;
        }


  
        /**
        * databinding method to get an XML representation of this object
        *
        */
        public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)
                    throws org.apache.axis2.databinding.ADBException{


        
                 java.util.ArrayList elementList = new java.util.ArrayList();
                 java.util.ArrayList attribList = new java.util.ArrayList();

                 if (localContentTypeTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "contentType"));
                                 
                                         elementList.add(localContentType==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentType));
                                    } if (localFaultSeqXmlTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "faultSeqXml"));
                                 
                                         elementList.add(localFaultSeqXml==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultSeqXml));
                                    } if (localFaultSequenceKeyTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "faultSequenceKey"));
                                 
                                         elementList.add(localFaultSequenceKey==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultSequenceKey));
                                    } if (localInSeqXmlTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "inSeqXml"));
                                 
                                         elementList.add(localInSeqXml==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInSeqXml));
                                    } if (localInSequenceKeyTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "inSequenceKey"));
                                 
                                         elementList.add(localInSequenceKey==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInSequenceKey));
                                    } if (localMethodsTracker){
                            if (localMethods!=null){
                                  for (int i = 0;i < localMethods.length;i++){
                                      
                                         if (localMethods[i] != null){
                                          elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                              "methods"));
                                          elementList.add(
                                          org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMethods[i]));
                                          } else {
                                             
                                                    elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                              "methods"));
                                                    elementList.add(null);
                                                
                                          }
                                      

                                  }
                            } else {
                              
                                    elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                              "methods"));
                                    elementList.add(null);
                                
                            }

                        } if (localOutSeqXmlTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "outSeqXml"));
                                 
                                         elementList.add(localOutSeqXml==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOutSeqXml));
                                    } if (localOutSequenceKeyTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "outSequenceKey"));
                                 
                                         elementList.add(localOutSequenceKey==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOutSequenceKey));
                                    } if (localProtocolTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "protocol"));
                                 
                                elementList.add(
                                   org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtocol));
                            } if (localUriTemplateTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "uriTemplate"));
                                 
                                         elementList.add(localUriTemplate==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUriTemplate));
                                    } if (localUrlMappingTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "urlMapping"));
                                 
                                         elementList.add(localUrlMapping==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUrlMapping));
                                    } if (localUserAgentTracker){
                                      elementList.add(new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd",
                                                                      "userAgent"));
                                 
                                         elementList.add(localUserAgent==null?null:
                                         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUserAgent));
                                    }

                return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());
            
            

        }

  

     /**
      *  Factory class that keeps the parse method
      */
    public static class Factory{

        
        

        /**
        * static method to create the object
        * Precondition:  If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable
        *                If this object is not an element, it is a complex type and the reader is at the event just after the outer start element
        * Postcondition: If this object is an element, the reader is positioned at its end element
        *                If this object is a complex type, the reader is positioned at the end element of its outer element
        */
        public static ResourceData parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
            ResourceData object =
                new ResourceData();

            int event;
            java.lang.String nillableValue = null;
            java.lang.String prefix ="";
            java.lang.String namespaceuri ="";
            try {
                
                while (!reader.isStartElement() && !reader.isEndElement())
                    reader.next();

                
                if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
                  java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
                        "type");
                  if (fullTypeName!=null){
                    java.lang.String nsPrefix = null;
                    if (fullTypeName.indexOf(":") > -1){
                        nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":"));
                    }
                    nsPrefix = nsPrefix==null?"":nsPrefix;

                    java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1);
                    
                            if (!"ResourceData".equals(type)){
                                //find namespace for the prefix
                                java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
                                return (ResourceData)org.wso2.carbon.rest.api.stub.types.axis2.ExtensionMapper.getTypeObject(
                                     nsUri,type,reader);
                              }
                        

                  }
                

                }

                

                
                // Note all attributes that were handled. Used to differ normal attributes
                // from anyAttributes.
                java.util.Vector handledAttributes = new java.util.Vector();
                

                
                    
                    reader.next();
                
                        java.util.ArrayList list6 = new java.util.ArrayList();
                    
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","contentType").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setContentType(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","faultSeqXml").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setFaultSeqXml(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","faultSequenceKey").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setFaultSequenceKey(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","inSeqXml").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setInSeqXml(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","inSequenceKey").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setInSequenceKey(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","methods").equals(reader.getName())){
                                
                                    
                                    
                                    // Process the array and step past its final element's end.
                                    
                                              nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                              if ("true".equals(nillableValue) || "1".equals(nillableValue)){
                                                  list6.add(null);
                                                       
                                                  reader.next();
                                              } else {
                                            list6.add(reader.getElementText());
                                            }
                                            //loop until we find a start element that is not part of this array
                                            boolean loopDone6 = false;
                                            while(!loopDone6){
                                                // Ensure we are at the EndElement
                                                while (!reader.isEndElement()){
                                                    reader.next();
                                                }
                                                // Step out of this element
                                                reader.next();
                                                // Step to next element event.
                                                while (!reader.isStartElement() && !reader.isEndElement())
                                                    reader.next();
                                                if (reader.isEndElement()){
                                                    //two continuous end elements means we are exiting the xml structure
                                                    loopDone6 = true;
                                                } else {
                                                    if (new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","methods").equals(reader.getName())){
                                                         
                                                          nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                                          if ("true".equals(nillableValue) || "1".equals(nillableValue)){
                                                              list6.add(null);
                                                                   
                                                              reader.next();
                                                          } else {
                                                        list6.add(reader.getElementText());
                                                        }
                                                    }else{
                                                        loopDone6 = true;
                                                    }
                                                }
                                            }
                                            // call the converter utility  to convert and set the array
                                            
                                                    object.setMethods((java.lang.String[])
                                                        list6.toArray(new java.lang.String[list6.size()]));
                                                
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","outSeqXml").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setOutSeqXml(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","outSequenceKey").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setOutSequenceKey(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","protocol").equals(reader.getName())){
                                
                                    nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                    if ("true".equals(nillableValue) || "1".equals(nillableValue)){
                                        throw new org.apache.axis2.databinding.ADBException("The element: "+"protocol" +"  cannot be null");
                                    }
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setProtocol(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));
                                              
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                               object.setProtocol(java.lang.Integer.MIN_VALUE);
                                           
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","uriTemplate").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setUriTemplate(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","urlMapping").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setUrlMapping(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                
                                    
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                                
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://api.rest.carbon.wso2.org/xsd","userAgent").equals(reader.getName())){
                                
                                       nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
                                       if (!"true".equals(nillableValue) && !"1".equals(nillableValue)){
                                    

                                    java.lang.String content = reader.getElementText();
                                    
                                              object.setUserAgent(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                            
                                       } else {
                                           
                                           
                                           reader.getElementText(); // throw away text nodes if any.
                                       }
                                      
                                        reader.next();
                                    
                              }  // End of if for expected property start element
                                
                                    else {
                                        
                                    }
                                  
                            while (!reader.isStartElement() && !reader.isEndElement())
                                reader.next();
                            
                                if (reader.isStartElement())
                                // A start element we are not expecting indicates a trailing invalid property
                                throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName());
                            



            } catch (javax.xml.stream.XMLStreamException e) {
                throw new java.lang.Exception(e);
            }

            return object;
        }

        }//end of factory class

        

        }
           
    