/** * EFetchSnpServiceStub.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.6.2 Built on : Apr 17, 2012 (05:33:49 IST) */ package gov.nih.nlm.ncbi.www.soap.eutils; /* * EFetchSnpServiceStub java implementation */ public class EFetchSnpServiceStub extends org.apache.axis2.client.Stub { protected org.apache.axis2.description.AxisOperation[] _operations; //hashmaps to keep the fault mapping private java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); private java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); private java.util.HashMap faultMessageMap = new java.util.HashMap(); private static int counter = 0; private static synchronized java.lang.String getUniqueSuffix(){ // reset the counter if it is greater than 99999 if (counter > 99999){ counter = 0; } counter = counter + 1; return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter; } private void populateAxisService() throws org.apache.axis2.AxisFault { //creating the Service with a unique name _service = new org.apache.axis2.description.AxisService("EFetchSnpService" + getUniqueSuffix()); addAnonymousOperations(); //creating the operations org.apache.axis2.description.AxisOperation __operation; _operations = new org.apache.axis2.description.AxisOperation[1]; __operation = new org.apache.axis2.description.OutInAxisOperation(); __operation.setName(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/", "run_eFetch")); _service.addOperation(__operation); _operations[0]=__operation; } //populates the faults private void populateFaults(){ } /** *Constructor that takes in a configContext */ public EFetchSnpServiceStub(org.apache.axis2.context.ConfigurationContext configurationContext, java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { this(configurationContext,targetEndpoint,false); } /** * Constructor that takes in a configContext and useseperate listner */ public EFetchSnpServiceStub(org.apache.axis2.context.ConfigurationContext configurationContext, java.lang.String targetEndpoint, boolean useSeparateListener) throws org.apache.axis2.AxisFault { //To populate AxisService populateAxisService(); populateFaults(); _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service); _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference( targetEndpoint)); _serviceClient.getOptions().setUseSeparateListener(useSeparateListener); } /** * Default Constructor */ public EFetchSnpServiceStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { this(configurationContext,"http://eutils.ncbi.nlm.nih.gov/soap/v2.0/soap_adapter_2_0.cgi?db=snp" ); } /** * Default Constructor */ public EFetchSnpServiceStub() throws org.apache.axis2.AxisFault { this("http://eutils.ncbi.nlm.nih.gov/soap/v2.0/soap_adapter_2_0.cgi?db=snp" ); } /** * Constructor taking the target endpoint */ public EFetchSnpServiceStub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { this(null,targetEndpoint); } /** * Auto generated method signature * * @see gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpService#run_eFetch * @param eFetchRequest0 */ public gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult run_eFetch( gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest eFetchRequest0) throws java.rmi.RemoteException { org.apache.axis2.context.MessageContext _messageContext = null; try{ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); _operationClient.getOptions().setAction("efetch"); _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); // create a message context _messageContext = new org.apache.axis2.context.MessageContext(); // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), eFetchRequest0, optimizeContent(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/", "run_eFetch")), new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/", "run_eFetch")); //adding SOAP soap_headers _serviceClient.addHeadersToEnvelope(env); // set the message context with that soap envelope _messageContext.setEnvelope(env); // add the message contxt to the operation client _operationClient.addMessageContext(_messageContext); //execute the operation client _operationClient.execute(true); org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); java.lang.Object object = fromOM( _returnEnv.getBody().getFirstElement() , gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult.class, getEnvelopeNamespaces(_returnEnv)); return (gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult)object; }catch(org.apache.axis2.AxisFault f){ org.apache.axiom.om.OMElement faultElt = f.getDetail(); if (faultElt!=null){ if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch"))){ //make the fault by reflection try{ java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch")); java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class); java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage()); //message class java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch")); java.lang.Class messageClass = java.lang.Class.forName(messageClassName); java.lang.Object messageObject = fromOM(faultElt,messageClass,null); java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[]{messageClass}); m.invoke(ex,new java.lang.Object[]{messageObject}); throw new java.rmi.RemoteException(ex.getMessage(), ex); }catch(java.lang.ClassCastException e){ // we cannot intantiate the class - throw the original Axis fault throw f; } catch (java.lang.ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; }catch (java.lang.NoSuchMethodException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } catch (java.lang.reflect.InvocationTargetException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } catch (java.lang.IllegalAccessException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } catch (java.lang.InstantiationException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } }else{ throw f; } }else{ throw f; } } finally { if (_messageContext.getTransportOut() != null) { _messageContext.getTransportOut().getSender().cleanup(_messageContext); } } } /** * Auto generated method signature for Asynchronous Invocations * * @see gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpService#startrun_eFetch * @param eFetchRequest0 */ public void startrun_eFetch( gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest eFetchRequest0, final gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceCallbackHandler callback) throws java.rmi.RemoteException{ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); _operationClient.getOptions().setAction("efetch"); _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&"); // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env=null; final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); //Style is Doc. env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), eFetchRequest0, optimizeContent(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/", "run_eFetch")), new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/", "run_eFetch")); // adding SOAP soap_headers _serviceClient.addHeadersToEnvelope(env); // create message context with that soap envelope _messageContext.setEnvelope(env); // add the message context to the operation client _operationClient.addMessageContext(_messageContext); _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { public void onMessage(org.apache.axis2.context.MessageContext resultContext) { try { org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult.class, getEnvelopeNamespaces(resultEnv)); callback.receiveResultrun_eFetch( (gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult)object); } catch (org.apache.axis2.AxisFault e) { callback.receiveErrorrun_eFetch(e); } } public void onError(java.lang.Exception error) { if (error instanceof org.apache.axis2.AxisFault) { org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; org.apache.axiom.om.OMElement faultElt = f.getDetail(); if (faultElt!=null){ if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch"))){ //make the fault by reflection try{ java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch")); java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class); java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage()); //message class java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),"run_eFetch")); java.lang.Class messageClass = java.lang.Class.forName(messageClassName); java.lang.Object messageObject = fromOM(faultElt,messageClass,null); java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[]{messageClass}); m.invoke(ex,new java.lang.Object[]{messageObject}); callback.receiveErrorrun_eFetch(new java.rmi.RemoteException(ex.getMessage(), ex)); } catch(java.lang.ClassCastException e){ // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (java.lang.ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (java.lang.NoSuchMethodException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (java.lang.reflect.InvocationTargetException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (java.lang.IllegalAccessException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (java.lang.InstantiationException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } catch (org.apache.axis2.AxisFault e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrorrun_eFetch(f); } } else { callback.receiveErrorrun_eFetch(f); } } else { callback.receiveErrorrun_eFetch(f); } } else { callback.receiveErrorrun_eFetch(error); } } public void onFault(org.apache.axis2.context.MessageContext faultContext) { org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); onError(fault); } public void onComplete() { try { _messageContext.getTransportOut().getSender().cleanup(_messageContext); } catch (org.apache.axis2.AxisFault axisFault) { callback.receiveErrorrun_eFetch(axisFault); } } }); org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; if ( _operations[0].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) { _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); _operations[0].setMessageReceiver( _callbackReceiver); } //execute the operation client _operationClient.execute(false); } /** * A utility method that copies the namepaces from the SOAPEnvelope */ private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ java.util.Map returnMap = new java.util.HashMap(); java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); } return returnMap; } private javax.xml.namespace.QName[] opNameArray = null; private boolean optimizeContent(javax.xml.namespace.QName opName) { if (opNameArray == null) { return false; } for (int i = 0; i < opNameArray.length; i++) { if (opName.equals(opNameArray[i])) { return true; } } return false; } //http://eutils.ncbi.nlm.nih.gov/soap/v2.0/soap_adapter_2_0.cgi?db=snp public static class SnpStat_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = SnpStat_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for MapWeight * This was an Attribute! */ protected MapWeight_type0 localMapWeight ; /** * Auto generated getter method * @return MapWeight_type0 */ public MapWeight_type0 getMapWeight(){ return localMapWeight; } /** * Auto generated setter method * @param param MapWeight */ public void setMapWeight(MapWeight_type0 param){ this.localMapWeight=param; } /** * field for ChromCount * This was an Attribute! */ protected int localChromCount ; /** * Auto generated getter method * @return int */ public int getChromCount(){ return localChromCount; } /** * Auto generated setter method * @param param ChromCount */ public void setChromCount(int param){ this.localChromCount=param; } /** * field for PlacedContigCount * This was an Attribute! */ protected int localPlacedContigCount ; /** * Auto generated getter method * @return int */ public int getPlacedContigCount(){ return localPlacedContigCount; } /** * Auto generated setter method * @param param PlacedContigCount */ public void setPlacedContigCount(int param){ this.localPlacedContigCount=param; } /** * field for UnplacedContigCount * This was an Attribute! */ protected int localUnplacedContigCount ; /** * Auto generated getter method * @return int */ public int getUnplacedContigCount(){ return localUnplacedContigCount; } /** * Auto generated setter method * @param param UnplacedContigCount */ public void setUnplacedContigCount(int param){ this.localUnplacedContigCount=param; } /** * field for SeqlocCount * This was an Attribute! */ protected int localSeqlocCount ; /** * Auto generated getter method * @return int */ public int getSeqlocCount(){ return localSeqlocCount; } /** * Auto generated setter method * @param param SeqlocCount */ public void setSeqlocCount(int param){ this.localSeqlocCount=param; } /** * field for HapCount * This was an Attribute! */ protected int localHapCount ; /** * Auto generated getter method * @return int */ public int getHapCount(){ return localHapCount; } /** * Auto generated setter method * @param param HapCount */ public void setHapCount(int param){ this.localHapCount=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":SnpStat_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "SnpStat_type0", xmlWriter); } } if (localMapWeight != null){ writeAttribute("", "mapWeight", localMapWeight.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localMapWeight is null"); } if (localChromCount!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "chromCount", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localChromCount), xmlWriter); } if (localPlacedContigCount!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "placedContigCount", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPlacedContigCount), xmlWriter); } if (localUnplacedContigCount!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "unplacedContigCount", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUnplacedContigCount), xmlWriter); } if (localSeqlocCount!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "seqlocCount", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeqlocCount), xmlWriter); } if (localHapCount!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "hapCount", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHapCount), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","mapWeight")); attribList.add(localMapWeight.toString()); attribList.add( new javax.xml.namespace.QName("","chromCount")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localChromCount)); attribList.add( new javax.xml.namespace.QName("","placedContigCount")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPlacedContigCount)); attribList.add( new javax.xml.namespace.QName("","unplacedContigCount")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUnplacedContigCount)); attribList.add( new javax.xml.namespace.QName("","seqlocCount")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeqlocCount)); attribList.add( new javax.xml.namespace.QName("","hapCount")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHapCount)); 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 SnpStat_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ SnpStat_type0 object = new SnpStat_type0(); 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 (!"SnpStat_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (SnpStat_type0)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(); // handle attribute "mapWeight" java.lang.String tempAttribMapWeight = reader.getAttributeValue(null,"mapWeight"); if (tempAttribMapWeight!=null){ java.lang.String content = tempAttribMapWeight; object.setMapWeight( MapWeight_type0.Factory.fromString(reader,tempAttribMapWeight)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute mapWeight is missing"); } handledAttributes.add("mapWeight"); // handle attribute "chromCount" java.lang.String tempAttribChromCount = reader.getAttributeValue(null,"chromCount"); if (tempAttribChromCount!=null){ java.lang.String content = tempAttribChromCount; object.setChromCount( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribChromCount)); } else { object.setChromCount(java.lang.Integer.MIN_VALUE); } handledAttributes.add("chromCount"); // handle attribute "placedContigCount" java.lang.String tempAttribPlacedContigCount = reader.getAttributeValue(null,"placedContigCount"); if (tempAttribPlacedContigCount!=null){ java.lang.String content = tempAttribPlacedContigCount; object.setPlacedContigCount( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribPlacedContigCount)); } else { object.setPlacedContigCount(java.lang.Integer.MIN_VALUE); } handledAttributes.add("placedContigCount"); // handle attribute "unplacedContigCount" java.lang.String tempAttribUnplacedContigCount = reader.getAttributeValue(null,"unplacedContigCount"); if (tempAttribUnplacedContigCount!=null){ java.lang.String content = tempAttribUnplacedContigCount; object.setUnplacedContigCount( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribUnplacedContigCount)); } else { object.setUnplacedContigCount(java.lang.Integer.MIN_VALUE); } handledAttributes.add("unplacedContigCount"); // handle attribute "seqlocCount" java.lang.String tempAttribSeqlocCount = reader.getAttributeValue(null,"seqlocCount"); if (tempAttribSeqlocCount!=null){ java.lang.String content = tempAttribSeqlocCount; object.setSeqlocCount( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribSeqlocCount)); } else { object.setSeqlocCount(java.lang.Integer.MIN_VALUE); } handledAttributes.add("seqlocCount"); // handle attribute "hapCount" java.lang.String tempAttribHapCount = reader.getAttributeValue(null,"hapCount"); if (tempAttribHapCount!=null){ java.lang.String content = tempAttribHapCount; object.setHapCount( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribHapCount)); } else { object.setHapCount(java.lang.Integer.MIN_VALUE); } handledAttributes.add("hapCount"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class BaseURL_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = BaseURL_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for String */ protected java.lang.String localString ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getString(){ return localString; } /** * Auto generated setter method * @param param String */ public void setString(java.lang.String param){ this.localString=param; } public java.lang.String toString(){ return localString.toString(); } /** * field for UrlId * This was an Attribute! */ protected int localUrlId ; /** * Auto generated getter method * @return int */ public int getUrlId(){ return localUrlId; } /** * Auto generated setter method * @param param UrlId */ public void setUrlId(int param){ this.localUrlId=param; } /** * field for ResourceName * This was an Attribute! */ protected java.lang.String localResourceName ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getResourceName(){ return localResourceName; } /** * Auto generated setter method * @param param ResourceName */ public void setResourceName(java.lang.String param){ this.localResourceName=param; } /** * field for ResourceId * This was an Attribute! */ protected java.lang.String localResourceId ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getResourceId(){ return localResourceId; } /** * Auto generated setter method * @param param ResourceId */ public void setResourceId(java.lang.String param){ this.localResourceId=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":BaseURL_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "BaseURL_type0", xmlWriter); } } if (localUrlId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "urlId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUrlId), xmlWriter); } if (localResourceName != null){ writeAttribute("", "resourceName", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceName), xmlWriter); } if (localResourceId != null){ writeAttribute("", "resourceId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceId), xmlWriter); } if (localString==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); }else{ xmlWriter.writeCharacters(localString); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT); if (localString != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localString)); } else { throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); } attribList.add( new javax.xml.namespace.QName("","urlId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localUrlId)); attribList.add( new javax.xml.namespace.QName("","resourceName")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceName)); attribList.add( new javax.xml.namespace.QName("","resourceId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceId)); 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{ public static BaseURL_type0 fromString(java.lang.String value, java.lang.String namespaceURI){ BaseURL_type0 returnValue = new BaseURL_type0(); returnValue.setString( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); return returnValue; } public static BaseURL_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return BaseURL_type0.Factory.fromString(content,namespaceUri); } else { return BaseURL_type0.Factory.fromString(content,""); } } /** * 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 BaseURL_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ BaseURL_type0 object = new BaseURL_type0(); 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 (!"BaseURL_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (BaseURL_type0)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(); // handle attribute "urlId" java.lang.String tempAttribUrlId = reader.getAttributeValue(null,"urlId"); if (tempAttribUrlId!=null){ java.lang.String content = tempAttribUrlId; object.setUrlId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribUrlId)); } else { object.setUrlId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("urlId"); // handle attribute "resourceName" java.lang.String tempAttribResourceName = reader.getAttributeValue(null,"resourceName"); if (tempAttribResourceName!=null){ java.lang.String content = tempAttribResourceName; object.setResourceName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribResourceName)); } else { } handledAttributes.add("resourceName"); // handle attribute "resourceId" java.lang.String tempAttribResourceId = reader.getAttributeValue(null,"resourceId"); if (tempAttribResourceId!=null){ java.lang.String content = tempAttribResourceId; object.setResourceId( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribResourceId)); } else { } handledAttributes.add("resourceId"); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ if (reader.isStartElement() || reader.hasText()){ 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: "+"string" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setString( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Frequency_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Frequency_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Freq * This was an Attribute! */ protected double localFreq ; /** * Auto generated getter method * @return double */ public double getFreq(){ return localFreq; } /** * Auto generated setter method * @param param Freq */ public void setFreq(double param){ this.localFreq=param; } /** * field for Allele * This was an Attribute! */ protected java.lang.String localAllele ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAllele(){ return localAllele; } /** * Auto generated setter method * @param param Allele */ public void setAllele(java.lang.String param){ this.localAllele=param; } /** * field for PopId * This was an Attribute! */ protected java.math.BigInteger localPopId ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getPopId(){ return localPopId; } /** * Auto generated setter method * @param param PopId */ public void setPopId(java.math.BigInteger param){ this.localPopId=param; } /** * field for SampleSize * This was an Attribute! */ protected java.math.BigInteger localSampleSize ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getSampleSize(){ return localSampleSize; } /** * Auto generated setter method * @param param SampleSize */ public void setSampleSize(java.math.BigInteger param){ this.localSampleSize=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Frequency_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Frequency_type0", xmlWriter); } } if (!java.lang.Double.isNaN(localFreq)) { writeAttribute("", "freq", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFreq), xmlWriter); } if (localAllele != null){ writeAttribute("", "allele", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele), xmlWriter); } if (localPopId != null){ writeAttribute("", "popId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPopId), xmlWriter); } if (localSampleSize != null){ writeAttribute("", "sampleSize", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSampleSize), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","freq")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFreq)); attribList.add( new javax.xml.namespace.QName("","allele")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele)); attribList.add( new javax.xml.namespace.QName("","popId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPopId)); attribList.add( new javax.xml.namespace.QName("","sampleSize")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSampleSize)); 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 Frequency_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Frequency_type0 object = new Frequency_type0(); 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 (!"Frequency_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Frequency_type0)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(); // handle attribute "freq" java.lang.String tempAttribFreq = reader.getAttributeValue(null,"freq"); if (tempAttribFreq!=null){ java.lang.String content = tempAttribFreq; object.setFreq( org.apache.axis2.databinding.utils.ConverterUtil.convertToDouble(tempAttribFreq)); } else { object.setFreq(java.lang.Double.NaN); } handledAttributes.add("freq"); // handle attribute "allele" java.lang.String tempAttribAllele = reader.getAttributeValue(null,"allele"); if (tempAttribAllele!=null){ java.lang.String content = tempAttribAllele; object.setAllele( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAllele)); } else { } handledAttributes.add("allele"); // handle attribute "popId" java.lang.String tempAttribPopId = reader.getAttributeValue(null,"popId"); if (tempAttribPopId!=null){ java.lang.String content = tempAttribPopId; object.setPopId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribPopId)); } else { } handledAttributes.add("popId"); // handle attribute "sampleSize" java.lang.String tempAttribSampleSize = reader.getAttributeValue(null,"sampleSize"); if (tempAttribSampleSize!=null){ java.lang.String content = tempAttribSampleSize; object.setSampleSize( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribSampleSize)); } else { } handledAttributes.add("sampleSize"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Ss implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Ss", "ns1"); /** * field for Ss */ protected Ss_type0 localSs ; /** * Auto generated getter method * @return Ss_type0 */ public Ss_type0 getSs(){ return localSs; } /** * Auto generated setter method * @param param Ss */ public void setSs(Ss_type0 param){ this.localSs=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localSs==null){ throw new org.apache.axis2.databinding.ADBException("Ss cannot be null!"); } localSs.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localSs.getPullParser(MY_QNAME); } /** * 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 Ss parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Ss object = new Ss(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Ss").equals(reader.getName())){ object.setSs(Ss_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class ComponentType_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "componentType_type0", "ns1"); /** * field for ComponentType_type0 */ protected java.lang.String localComponentType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected ComponentType_type0(java.lang.String value, boolean isRegisterValue) { localComponentType_type0 = value; if (isRegisterValue){ _table_.put(localComponentType_type0, this); } } public static final java.lang.String _contig = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("contig"); public static final java.lang.String _mrna = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mrna"); public static final ComponentType_type0 contig = new ComponentType_type0(_contig,true); public static final ComponentType_type0 mrna = new ComponentType_type0(_mrna,true); public java.lang.String getValue() { return localComponentType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localComponentType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":componentType_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "componentType_type0", xmlWriter); } } if (localComponentType_type0==null){ throw new org.apache.axis2.databinding.ADBException("componentType_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localComponentType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localComponentType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static ComponentType_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { ComponentType_type0 enumeration = (ComponentType_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static ComponentType_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static ComponentType_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return ComponentType_type0.Factory.fromString(content,namespaceUri); } else { return ComponentType_type0.Factory.fromString(content,""); } } /** * 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 ComponentType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ ComponentType_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"componentType_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = ComponentType_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = ComponentType_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Ss_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Ss_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Sequence */ protected Sequence_type1 localSequence ; /** * Auto generated getter method * @return Sequence_type1 */ public Sequence_type1 getSequence(){ return localSequence; } /** * Auto generated setter method * @param param Sequence */ public void setSequence(Sequence_type1 param){ this.localSequence=param; } /** * field for SsId * This was an Attribute! */ protected int localSsId ; /** * Auto generated getter method * @return int */ public int getSsId(){ return localSsId; } /** * Auto generated setter method * @param param SsId */ public void setSsId(int param){ this.localSsId=param; } /** * field for Handle * This was an Attribute! */ protected java.lang.String localHandle ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getHandle(){ return localHandle; } /** * Auto generated setter method * @param param Handle */ public void setHandle(java.lang.String param){ this.localHandle=param; } /** * field for BatchId * This was an Attribute! */ protected int localBatchId ; /** * Auto generated getter method * @return int */ public int getBatchId(){ return localBatchId; } /** * Auto generated setter method * @param param BatchId */ public void setBatchId(int param){ this.localBatchId=param; } /** * field for LocSnpId * This was an Attribute! */ protected java.lang.String localLocSnpId ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getLocSnpId(){ return localLocSnpId; } /** * Auto generated setter method * @param param LocSnpId */ public void setLocSnpId(java.lang.String param){ this.localLocSnpId=param; } /** * field for SubSnpClass * This was an Attribute! */ protected SubSnpClass_type0 localSubSnpClass ; /** * Auto generated getter method * @return SubSnpClass_type0 */ public SubSnpClass_type0 getSubSnpClass(){ return localSubSnpClass; } /** * Auto generated setter method * @param param SubSnpClass */ public void setSubSnpClass(SubSnpClass_type0 param){ this.localSubSnpClass=param; } /** * field for Orient * This was an Attribute! */ protected Orient_type0 localOrient ; /** * Auto generated getter method * @return Orient_type0 */ public Orient_type0 getOrient(){ return localOrient; } /** * Auto generated setter method * @param param Orient */ public void setOrient(Orient_type0 param){ this.localOrient=param; } /** * field for Strand * This was an Attribute! */ protected Strand_type0 localStrand ; /** * Auto generated getter method * @return Strand_type0 */ public Strand_type0 getStrand(){ return localStrand; } /** * Auto generated setter method * @param param Strand */ public void setStrand(Strand_type0 param){ this.localStrand=param; } /** * field for MolType * This was an Attribute! */ protected MolType_type0 localMolType ; /** * Auto generated getter method * @return MolType_type0 */ public MolType_type0 getMolType(){ return localMolType; } /** * Auto generated setter method * @param param MolType */ public void setMolType(MolType_type0 param){ this.localMolType=param; } /** * field for BuildId * This was an Attribute! */ protected int localBuildId ; /** * Auto generated getter method * @return int */ public int getBuildId(){ return localBuildId; } /** * Auto generated setter method * @param param BuildId */ public void setBuildId(int param){ this.localBuildId=param; } /** * field for MethodClass * This was an Attribute! */ protected MethodClass_type0 localMethodClass ; /** * Auto generated getter method * @return MethodClass_type0 */ public MethodClass_type0 getMethodClass(){ return localMethodClass; } /** * Auto generated setter method * @param param MethodClass */ public void setMethodClass(MethodClass_type0 param){ this.localMethodClass=param; } /** * field for Validated * This was an Attribute! */ protected Validated_type0 localValidated ; /** * Auto generated getter method * @return Validated_type0 */ public Validated_type0 getValidated(){ return localValidated; } /** * Auto generated setter method * @param param Validated */ public void setValidated(Validated_type0 param){ this.localValidated=param; } /** * field for LinkoutUrl * This was an Attribute! */ protected java.lang.String localLinkoutUrl ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getLinkoutUrl(){ return localLinkoutUrl; } /** * Auto generated setter method * @param param LinkoutUrl */ public void setLinkoutUrl(java.lang.String param){ this.localLinkoutUrl=param; } /** * field for SsAlias * This was an Attribute! */ protected java.lang.String localSsAlias ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSsAlias(){ return localSsAlias; } /** * Auto generated setter method * @param param SsAlias */ public void setSsAlias(java.lang.String param){ this.localSsAlias=param; } /** * field for AlleleOrigin * This was an Attribute! */ protected java.math.BigInteger localAlleleOrigin ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getAlleleOrigin(){ return localAlleleOrigin; } /** * Auto generated setter method * @param param AlleleOrigin */ public void setAlleleOrigin(java.math.BigInteger param){ this.localAlleleOrigin=param; } /** * field for ClinicalSignificance * This was an Attribute! */ protected java.lang.String localClinicalSignificance ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getClinicalSignificance(){ return localClinicalSignificance; } /** * Auto generated setter method * @param param ClinicalSignificance */ public void setClinicalSignificance(java.lang.String param){ this.localClinicalSignificance=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Ss_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Ss_type0", xmlWriter); } } if (localSsId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "ssId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSsId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localSsId is null"); } if (localHandle != null){ writeAttribute("", "handle", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHandle), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localHandle is null"); } if (localBatchId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "batchId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatchId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localBatchId is null"); } if (localLocSnpId != null){ writeAttribute("", "locSnpId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocSnpId), xmlWriter); } if (localSubSnpClass != null){ writeAttribute("", "subSnpClass", localSubSnpClass.toString(), xmlWriter); } if (localOrient != null){ writeAttribute("", "orient", localOrient.toString(), xmlWriter); } if (localStrand != null){ writeAttribute("", "strand", localStrand.toString(), xmlWriter); } if (localMolType != null){ writeAttribute("", "molType", localMolType.toString(), xmlWriter); } if (localBuildId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "buildId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuildId), xmlWriter); } if (localMethodClass != null){ writeAttribute("", "methodClass", localMethodClass.toString(), xmlWriter); } if (localValidated != null){ writeAttribute("", "validated", localValidated.toString(), xmlWriter); } if (localLinkoutUrl != null){ writeAttribute("", "linkoutUrl", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkoutUrl), xmlWriter); } if (localSsAlias != null){ writeAttribute("", "ssAlias", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSsAlias), xmlWriter); } if (localAlleleOrigin != null){ writeAttribute("", "alleleOrigin", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAlleleOrigin), xmlWriter); } if (localClinicalSignificance != null){ writeAttribute("", "clinicalSignificance", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localClinicalSignificance), xmlWriter); } if (localSequence==null){ throw new org.apache.axis2.databinding.ADBException("Sequence cannot be null!!"); } localSequence.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Sequence"), xmlWriter); xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Sequence")); if (localSequence==null){ throw new org.apache.axis2.databinding.ADBException("Sequence cannot be null!!"); } elementList.add(localSequence); attribList.add( new javax.xml.namespace.QName("","ssId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSsId)); attribList.add( new javax.xml.namespace.QName("","handle")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHandle)); attribList.add( new javax.xml.namespace.QName("","batchId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatchId)); attribList.add( new javax.xml.namespace.QName("","locSnpId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocSnpId)); attribList.add( new javax.xml.namespace.QName("","subSnpClass")); attribList.add(localSubSnpClass.toString()); attribList.add( new javax.xml.namespace.QName("","orient")); attribList.add(localOrient.toString()); attribList.add( new javax.xml.namespace.QName("","strand")); attribList.add(localStrand.toString()); attribList.add( new javax.xml.namespace.QName("","molType")); attribList.add(localMolType.toString()); attribList.add( new javax.xml.namespace.QName("","buildId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuildId)); attribList.add( new javax.xml.namespace.QName("","methodClass")); attribList.add(localMethodClass.toString()); attribList.add( new javax.xml.namespace.QName("","validated")); attribList.add(localValidated.toString()); attribList.add( new javax.xml.namespace.QName("","linkoutUrl")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkoutUrl)); attribList.add( new javax.xml.namespace.QName("","ssAlias")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSsAlias)); attribList.add( new javax.xml.namespace.QName("","alleleOrigin")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAlleleOrigin)); attribList.add( new javax.xml.namespace.QName("","clinicalSignificance")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localClinicalSignificance)); 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 Ss_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Ss_type0 object = new Ss_type0(); 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 (!"Ss_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Ss_type0)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(); // handle attribute "ssId" java.lang.String tempAttribSsId = reader.getAttributeValue(null,"ssId"); if (tempAttribSsId!=null){ java.lang.String content = tempAttribSsId; object.setSsId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribSsId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute ssId is missing"); } handledAttributes.add("ssId"); // handle attribute "handle" java.lang.String tempAttribHandle = reader.getAttributeValue(null,"handle"); if (tempAttribHandle!=null){ java.lang.String content = tempAttribHandle; object.setHandle( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribHandle)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute handle is missing"); } handledAttributes.add("handle"); // handle attribute "batchId" java.lang.String tempAttribBatchId = reader.getAttributeValue(null,"batchId"); if (tempAttribBatchId!=null){ java.lang.String content = tempAttribBatchId; object.setBatchId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBatchId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute batchId is missing"); } handledAttributes.add("batchId"); // handle attribute "locSnpId" java.lang.String tempAttribLocSnpId = reader.getAttributeValue(null,"locSnpId"); if (tempAttribLocSnpId!=null){ java.lang.String content = tempAttribLocSnpId; object.setLocSnpId( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribLocSnpId)); } else { } handledAttributes.add("locSnpId"); // handle attribute "subSnpClass" java.lang.String tempAttribSubSnpClass = reader.getAttributeValue(null,"subSnpClass"); if (tempAttribSubSnpClass!=null){ java.lang.String content = tempAttribSubSnpClass; object.setSubSnpClass( SubSnpClass_type0.Factory.fromString(reader,tempAttribSubSnpClass)); } else { } handledAttributes.add("subSnpClass"); // handle attribute "orient" java.lang.String tempAttribOrient = reader.getAttributeValue(null,"orient"); if (tempAttribOrient!=null){ java.lang.String content = tempAttribOrient; object.setOrient( Orient_type0.Factory.fromString(reader,tempAttribOrient)); } else { } handledAttributes.add("orient"); // handle attribute "strand" java.lang.String tempAttribStrand = reader.getAttributeValue(null,"strand"); if (tempAttribStrand!=null){ java.lang.String content = tempAttribStrand; object.setStrand( Strand_type0.Factory.fromString(reader,tempAttribStrand)); } else { } handledAttributes.add("strand"); // handle attribute "molType" java.lang.String tempAttribMolType = reader.getAttributeValue(null,"molType"); if (tempAttribMolType!=null){ java.lang.String content = tempAttribMolType; object.setMolType( MolType_type0.Factory.fromString(reader,tempAttribMolType)); } else { } handledAttributes.add("molType"); // handle attribute "buildId" java.lang.String tempAttribBuildId = reader.getAttributeValue(null,"buildId"); if (tempAttribBuildId!=null){ java.lang.String content = tempAttribBuildId; object.setBuildId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBuildId)); } else { object.setBuildId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("buildId"); // handle attribute "methodClass" java.lang.String tempAttribMethodClass = reader.getAttributeValue(null,"methodClass"); if (tempAttribMethodClass!=null){ java.lang.String content = tempAttribMethodClass; object.setMethodClass( MethodClass_type0.Factory.fromString(reader,tempAttribMethodClass)); } else { } handledAttributes.add("methodClass"); // handle attribute "validated" java.lang.String tempAttribValidated = reader.getAttributeValue(null,"validated"); if (tempAttribValidated!=null){ java.lang.String content = tempAttribValidated; object.setValidated( Validated_type0.Factory.fromString(reader,tempAttribValidated)); } else { } handledAttributes.add("validated"); // handle attribute "linkoutUrl" java.lang.String tempAttribLinkoutUrl = reader.getAttributeValue(null,"linkoutUrl"); if (tempAttribLinkoutUrl!=null){ java.lang.String content = tempAttribLinkoutUrl; object.setLinkoutUrl( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribLinkoutUrl)); } else { } handledAttributes.add("linkoutUrl"); // handle attribute "ssAlias" java.lang.String tempAttribSsAlias = reader.getAttributeValue(null,"ssAlias"); if (tempAttribSsAlias!=null){ java.lang.String content = tempAttribSsAlias; object.setSsAlias( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSsAlias)); } else { } handledAttributes.add("ssAlias"); // handle attribute "alleleOrigin" java.lang.String tempAttribAlleleOrigin = reader.getAttributeValue(null,"alleleOrigin"); if (tempAttribAlleleOrigin!=null){ java.lang.String content = tempAttribAlleleOrigin; object.setAlleleOrigin( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribAlleleOrigin)); } else { } handledAttributes.add("alleleOrigin"); // handle attribute "clinicalSignificance" java.lang.String tempAttribClinicalSignificance = reader.getAttributeValue(null,"clinicalSignificance"); if (tempAttribClinicalSignificance!=null){ java.lang.String content = tempAttribClinicalSignificance; object.setClinicalSignificance( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribClinicalSignificance)); } else { } handledAttributes.add("clinicalSignificance"); reader.next(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Sequence").equals(reader.getName())){ object.setSequence(Sequence_type1.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } 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 } public static class Method_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Method_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Exception */ protected java.lang.String localException ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getException(){ return localException; } /** * Auto generated setter method * @param param Exception */ public void setException(java.lang.String param){ this.localException=param; } /** * field for Name * This was an Attribute! */ protected java.lang.String localName ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getName(){ return localName; } /** * Auto generated setter method * @param param Name */ public void setName(java.lang.String param){ this.localName=param; } /** * field for Id * This was an Attribute! */ protected java.lang.String localId ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getId(){ return localId; } /** * Auto generated setter method * @param param Id */ public void setId(java.lang.String param){ this.localId=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Method_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Method_type0", xmlWriter); } } if (localName != null){ writeAttribute("", "name", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName), xmlWriter); } if (localId != null){ writeAttribute("", "Id", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId), xmlWriter); } namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Exception", xmlWriter); if (localException==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Exception cannot be null!!"); }else{ xmlWriter.writeCharacters(localException); } xmlWriter.writeEndElement(); xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Exception")); if (localException != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localException)); } else { throw new org.apache.axis2.databinding.ADBException("Exception cannot be null!!"); } attribList.add( new javax.xml.namespace.QName("","name")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); attribList.add( new javax.xml.namespace.QName("","Id")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId)); 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 Method_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Method_type0 object = new Method_type0(); 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 (!"Method_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Method_type0)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(); // handle attribute "name" java.lang.String tempAttribName = reader.getAttributeValue(null,"name"); if (tempAttribName!=null){ java.lang.String content = tempAttribName; object.setName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribName)); } else { } handledAttributes.add("name"); // handle attribute "Id" java.lang.String tempAttribId = reader.getAttributeValue(null,"Id"); if (tempAttribId!=null){ java.lang.String content = tempAttribId; object.setId( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribId)); } else { } handledAttributes.add("Id"); reader.next(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Exception").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: "+"Exception" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setException( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } 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 } public static class RsStruct_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = RsStruct_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for ProtAcc * This was an Attribute! */ protected java.lang.String localProtAcc ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getProtAcc(){ return localProtAcc; } /** * Auto generated setter method * @param param ProtAcc */ public void setProtAcc(java.lang.String param){ this.localProtAcc=param; } /** * field for ProtGi * This was an Attribute! */ protected int localProtGi ; /** * Auto generated getter method * @return int */ public int getProtGi(){ return localProtGi; } /** * Auto generated setter method * @param param ProtGi */ public void setProtGi(int param){ this.localProtGi=param; } /** * field for ProtLoc * This was an Attribute! */ protected int localProtLoc ; /** * Auto generated getter method * @return int */ public int getProtLoc(){ return localProtLoc; } /** * Auto generated setter method * @param param ProtLoc */ public void setProtLoc(int param){ this.localProtLoc=param; } /** * field for ProtResidue * This was an Attribute! */ protected java.lang.String localProtResidue ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getProtResidue(){ return localProtResidue; } /** * Auto generated setter method * @param param ProtResidue */ public void setProtResidue(java.lang.String param){ this.localProtResidue=param; } /** * field for RsResidue * This was an Attribute! */ protected java.lang.String localRsResidue ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getRsResidue(){ return localRsResidue; } /** * Auto generated setter method * @param param RsResidue */ public void setRsResidue(java.lang.String param){ this.localRsResidue=param; } /** * field for StructGi * This was an Attribute! */ protected int localStructGi ; /** * Auto generated getter method * @return int */ public int getStructGi(){ return localStructGi; } /** * Auto generated setter method * @param param StructGi */ public void setStructGi(int param){ this.localStructGi=param; } /** * field for StructLoc * This was an Attribute! */ protected int localStructLoc ; /** * Auto generated getter method * @return int */ public int getStructLoc(){ return localStructLoc; } /** * Auto generated setter method * @param param StructLoc */ public void setStructLoc(int param){ this.localStructLoc=param; } /** * field for StructResidue * This was an Attribute! */ protected java.lang.String localStructResidue ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getStructResidue(){ return localStructResidue; } /** * Auto generated setter method * @param param StructResidue */ public void setStructResidue(java.lang.String param){ this.localStructResidue=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":RsStruct_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "RsStruct_type0", xmlWriter); } } if (localProtAcc != null){ writeAttribute("", "protAcc", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtAcc), xmlWriter); } if (localProtGi!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "protGi", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtGi), xmlWriter); } if (localProtLoc!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "protLoc", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtLoc), xmlWriter); } if (localProtResidue != null){ writeAttribute("", "protResidue", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtResidue), xmlWriter); } if (localRsResidue != null){ writeAttribute("", "rsResidue", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsResidue), xmlWriter); } if (localStructGi!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "structGi", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructGi), xmlWriter); } if (localStructLoc!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "structLoc", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructLoc), xmlWriter); } if (localStructResidue != null){ writeAttribute("", "structResidue", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructResidue), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","protAcc")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtAcc)); attribList.add( new javax.xml.namespace.QName("","protGi")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtGi)); attribList.add( new javax.xml.namespace.QName("","protLoc")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtLoc)); attribList.add( new javax.xml.namespace.QName("","protResidue")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtResidue)); attribList.add( new javax.xml.namespace.QName("","rsResidue")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsResidue)); attribList.add( new javax.xml.namespace.QName("","structGi")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructGi)); attribList.add( new javax.xml.namespace.QName("","structLoc")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructLoc)); attribList.add( new javax.xml.namespace.QName("","structResidue")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStructResidue)); 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 RsStruct_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ RsStruct_type0 object = new RsStruct_type0(); 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 (!"RsStruct_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (RsStruct_type0)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(); // handle attribute "protAcc" java.lang.String tempAttribProtAcc = reader.getAttributeValue(null,"protAcc"); if (tempAttribProtAcc!=null){ java.lang.String content = tempAttribProtAcc; object.setProtAcc( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribProtAcc)); } else { } handledAttributes.add("protAcc"); // handle attribute "protGi" java.lang.String tempAttribProtGi = reader.getAttributeValue(null,"protGi"); if (tempAttribProtGi!=null){ java.lang.String content = tempAttribProtGi; object.setProtGi( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribProtGi)); } else { object.setProtGi(java.lang.Integer.MIN_VALUE); } handledAttributes.add("protGi"); // handle attribute "protLoc" java.lang.String tempAttribProtLoc = reader.getAttributeValue(null,"protLoc"); if (tempAttribProtLoc!=null){ java.lang.String content = tempAttribProtLoc; object.setProtLoc( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribProtLoc)); } else { object.setProtLoc(java.lang.Integer.MIN_VALUE); } handledAttributes.add("protLoc"); // handle attribute "protResidue" java.lang.String tempAttribProtResidue = reader.getAttributeValue(null,"protResidue"); if (tempAttribProtResidue!=null){ java.lang.String content = tempAttribProtResidue; object.setProtResidue( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribProtResidue)); } else { } handledAttributes.add("protResidue"); // handle attribute "rsResidue" java.lang.String tempAttribRsResidue = reader.getAttributeValue(null,"rsResidue"); if (tempAttribRsResidue!=null){ java.lang.String content = tempAttribRsResidue; object.setRsResidue( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribRsResidue)); } else { } handledAttributes.add("rsResidue"); // handle attribute "structGi" java.lang.String tempAttribStructGi = reader.getAttributeValue(null,"structGi"); if (tempAttribStructGi!=null){ java.lang.String content = tempAttribStructGi; object.setStructGi( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribStructGi)); } else { object.setStructGi(java.lang.Integer.MIN_VALUE); } handledAttributes.add("structGi"); // handle attribute "structLoc" java.lang.String tempAttribStructLoc = reader.getAttributeValue(null,"structLoc"); if (tempAttribStructLoc!=null){ java.lang.String content = tempAttribStructLoc; object.setStructLoc( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribStructLoc)); } else { object.setStructLoc(java.lang.Integer.MIN_VALUE); } handledAttributes.add("structLoc"); // handle attribute "structResidue" java.lang.String tempAttribStructResidue = reader.getAttributeValue(null,"structResidue"); if (tempAttribStructResidue!=null){ java.lang.String content = tempAttribStructResidue; object.setStructResidue( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribStructResidue)); } else { } handledAttributes.add("structResidue"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class PhenotypeSequence implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = PhenotypeSequence Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for ClinicalSignificance */ protected java.lang.String localClinicalSignificance ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getClinicalSignificance(){ return localClinicalSignificance; } /** * Auto generated setter method * @param param ClinicalSignificance */ public void setClinicalSignificance(java.lang.String param){ this.localClinicalSignificance=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; if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":PhenotypeSequence", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "PhenotypeSequence", xmlWriter); } } namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "ClinicalSignificance", xmlWriter); if (localClinicalSignificance==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("ClinicalSignificance cannot be null!!"); }else{ xmlWriter.writeCharacters(localClinicalSignificance); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "ClinicalSignificance")); if (localClinicalSignificance != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localClinicalSignificance)); } else { throw new org.apache.axis2.databinding.ADBException("ClinicalSignificance cannot be null!!"); } 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 PhenotypeSequence parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ PhenotypeSequence object = new PhenotypeSequence(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","ClinicalSignificance").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: "+"ClinicalSignificance" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setClinicalSignificance( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class SnpClass_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "snpClass_type0", "ns1"); /** * field for SnpClass_type0 */ protected java.lang.String localSnpClass_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected SnpClass_type0(java.lang.String value, boolean isRegisterValue) { localSnpClass_type0 = value; if (isRegisterValue){ _table_.put(localSnpClass_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("snp"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("in-del"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("heterozygous"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("microsatellite"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("named-locus"); public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("no-variation"); public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mixed"); public static final java.lang.String _value8 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("multinucleotide-polymorphism"); public static final SnpClass_type0 value1 = new SnpClass_type0(_value1,true); public static final SnpClass_type0 value2 = new SnpClass_type0(_value2,true); public static final SnpClass_type0 value3 = new SnpClass_type0(_value3,true); public static final SnpClass_type0 value4 = new SnpClass_type0(_value4,true); public static final SnpClass_type0 value5 = new SnpClass_type0(_value5,true); public static final SnpClass_type0 value6 = new SnpClass_type0(_value6,true); public static final SnpClass_type0 value7 = new SnpClass_type0(_value7,true); public static final SnpClass_type0 value8 = new SnpClass_type0(_value8,true); public java.lang.String getValue() { return localSnpClass_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localSnpClass_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":snpClass_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "snpClass_type0", xmlWriter); } } if (localSnpClass_type0==null){ throw new org.apache.axis2.databinding.ADBException("snpClass_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localSnpClass_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSnpClass_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static SnpClass_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { SnpClass_type0 enumeration = (SnpClass_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static SnpClass_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static SnpClass_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return SnpClass_type0.Factory.fromString(content,namespaceUri); } else { return SnpClass_type0.Factory.fromString(content,""); } } /** * 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 SnpClass_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ SnpClass_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"snpClass_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = SnpClass_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = SnpClass_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class ExtensionMapper{ public static java.lang.Object getTypeObject(java.lang.String namespaceURI, java.lang.String typeName, javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "SnpStat_type0".equals(typeName)){ return SnpStat_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "BaseURL_type0".equals(typeName)){ return BaseURL_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Frequency_type0".equals(typeName)){ return Frequency_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Ss_type0".equals(typeName)){ return Ss_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Method_type0".equals(typeName)){ return Method_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "RsStruct_type0".equals(typeName)){ return RsStruct_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "MapLoc_type0".equals(typeName)){ return MapLoc_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "RsLinkout_type0".equals(typeName)){ return RsLinkout_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "batchType_type0".equals(typeName)){ return BatchType_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "ExchangeSet_type0".equals(typeName)){ return ExchangeSet_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Update_type0".equals(typeName)){ return Update_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "methodClass_type0".equals(typeName)){ return MethodClass_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "SourceDatabase_type0".equals(typeName)){ return SourceDatabase_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "orientation_type0".equals(typeName)){ return Orientation_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Het_type0".equals(typeName)){ return Het_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Taxonomy_type0".equals(typeName)){ return Taxonomy_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "PrimarySequence_type0".equals(typeName)){ return PrimarySequence_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "FxnSet_type0".equals(typeName)){ return FxnSet_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "molType_type1".equals(typeName)){ return MolType_type1.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "molType_type2".equals(typeName)){ return MolType_type2.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "molType_type0".equals(typeName)){ return MolType_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "mapWeight_type0".equals(typeName)){ return MapWeight_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "validated_type0".equals(typeName)){ return Validated_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "snpType_type0".equals(typeName)){ return SnpType_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Query_type0".equals(typeName)){ return Query_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "orient_type1".equals(typeName)){ return Orient_type1.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "orient_type0".equals(typeName)){ return Orient_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "BioSource_type0".equals(typeName)){ return BioSource_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Sequence_type1".equals(typeName)){ return Sequence_type1.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Sequence_type0".equals(typeName)){ return Sequence_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Validation_type0".equals(typeName)){ return Validation_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Assembly_type0".equals(typeName)){ return Assembly_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Rs_type0".equals(typeName)){ return Rs_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "locType_type0".equals(typeName)){ return LocType_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "type_type0".equals(typeName)){ return Type_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Component_type0".equals(typeName)){ return Component_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Assay_type0".equals(typeName)){ return Assay_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "snpClass_type0".equals(typeName)){ return SnpClass_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Create_type0".equals(typeName)){ return Create_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "componentType_type0".equals(typeName)){ return ComponentType_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "fxnClass_type0".equals(typeName)){ return FxnClass_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "AlleleOrigin_type0".equals(typeName)){ return AlleleOrigin_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Phenotype_type0".equals(typeName)){ return Phenotype_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "IdListType".equals(typeName)){ return IdListType.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "source_type0".equals(typeName)){ return Source_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "Summary_type0".equals(typeName)){ return Summary_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "MergeHistory_type0".equals(typeName)){ return MergeHistory_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "strand_type0".equals(typeName)){ return Strand_type0.Factory.parse(reader); } if ( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp".equals(namespaceURI) && "subSnpClass_type0".equals(typeName)){ return SubSnpClass_type0.Factory.parse(reader); } throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); } } public static class BaseURL implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "BaseURL", "ns1"); /** * field for BaseURL */ protected BaseURL_type0 localBaseURL ; /** * Auto generated getter method * @return BaseURL_type0 */ public BaseURL_type0 getBaseURL(){ return localBaseURL; } /** * Auto generated setter method * @param param BaseURL */ public void setBaseURL(BaseURL_type0 param){ this.localBaseURL=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localBaseURL==null){ throw new org.apache.axis2.databinding.ADBException("BaseURL cannot be null!"); } localBaseURL.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localBaseURL.getPullParser(MY_QNAME); } /** * 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 BaseURL parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ BaseURL object = new BaseURL(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL").equals(reader.getName())){ object.setBaseURL(BaseURL_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class RsLinkout_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = RsLinkout_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for ResourceId * This was an Attribute! */ protected java.lang.String localResourceId ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getResourceId(){ return localResourceId; } /** * Auto generated setter method * @param param ResourceId */ public void setResourceId(java.lang.String param){ this.localResourceId=param; } /** * field for LinkValue * This was an Attribute! */ protected java.lang.String localLinkValue ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getLinkValue(){ return localLinkValue; } /** * Auto generated setter method * @param param LinkValue */ public void setLinkValue(java.lang.String param){ this.localLinkValue=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":RsLinkout_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "RsLinkout_type0", xmlWriter); } } if (localResourceId != null){ writeAttribute("", "resourceId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localResourceId is null"); } if (localLinkValue != null){ writeAttribute("", "linkValue", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkValue), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localLinkValue is null"); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","resourceId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResourceId)); attribList.add( new javax.xml.namespace.QName("","linkValue")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkValue)); 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 RsLinkout_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ RsLinkout_type0 object = new RsLinkout_type0(); 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 (!"RsLinkout_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (RsLinkout_type0)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(); // handle attribute "resourceId" java.lang.String tempAttribResourceId = reader.getAttributeValue(null,"resourceId"); if (tempAttribResourceId!=null){ java.lang.String content = tempAttribResourceId; object.setResourceId( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribResourceId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute resourceId is missing"); } handledAttributes.add("resourceId"); // handle attribute "linkValue" java.lang.String tempAttribLinkValue = reader.getAttributeValue(null,"linkValue"); if (tempAttribLinkValue!=null){ java.lang.String content = tempAttribLinkValue; object.setLinkValue( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribLinkValue)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute linkValue is missing"); } handledAttributes.add("linkValue"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MapLoc_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = MapLoc_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for FxnSet * This was an Array! */ protected FxnSet_type0[] localFxnSet ; /* 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 localFxnSetTracker = false ; public boolean isFxnSetSpecified(){ return localFxnSetTracker; } /** * Auto generated getter method * @return FxnSet_type0[] */ public FxnSet_type0[] getFxnSet(){ return localFxnSet; } /** * validate the array for FxnSet */ protected void validateFxnSet(FxnSet_type0[] param){ } /** * Auto generated setter method * @param param FxnSet */ public void setFxnSet(FxnSet_type0[] param){ validateFxnSet(param); localFxnSetTracker = param != null; this.localFxnSet=param; } /** * Auto generated add method for the array for convenience * @param param FxnSet_type0 */ public void addFxnSet(FxnSet_type0 param){ if (localFxnSet == null){ localFxnSet = new FxnSet_type0[]{}; } //update the setting tracker localFxnSetTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localFxnSet); list.add(param); this.localFxnSet = (FxnSet_type0[])list.toArray( new FxnSet_type0[list.size()]); } /** * field for AsnFrom * This was an Attribute! */ protected java.math.BigInteger localAsnFrom ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getAsnFrom(){ return localAsnFrom; } /** * Auto generated setter method * @param param AsnFrom */ public void setAsnFrom(java.math.BigInteger param){ this.localAsnFrom=param; } /** * field for AsnTo * This was an Attribute! */ protected java.math.BigInteger localAsnTo ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getAsnTo(){ return localAsnTo; } /** * Auto generated setter method * @param param AsnTo */ public void setAsnTo(java.math.BigInteger param){ this.localAsnTo=param; } /** * field for LocType * This was an Attribute! */ protected LocType_type0 localLocType ; /** * Auto generated getter method * @return LocType_type0 */ public LocType_type0 getLocType(){ return localLocType; } /** * Auto generated setter method * @param param LocType */ public void setLocType(LocType_type0 param){ this.localLocType=param; } /** * field for AlnQuality * This was an Attribute! */ protected double localAlnQuality ; /** * Auto generated getter method * @return double */ public double getAlnQuality(){ return localAlnQuality; } /** * Auto generated setter method * @param param AlnQuality */ public void setAlnQuality(double param){ this.localAlnQuality=param; } /** * field for Orient * This was an Attribute! */ protected Orient_type1 localOrient ; /** * Auto generated getter method * @return Orient_type1 */ public Orient_type1 getOrient(){ return localOrient; } /** * Auto generated setter method * @param param Orient */ public void setOrient(Orient_type1 param){ this.localOrient=param; } /** * field for PhysMapInt * This was an Attribute! */ protected int localPhysMapInt ; /** * Auto generated getter method * @return int */ public int getPhysMapInt(){ return localPhysMapInt; } /** * Auto generated setter method * @param param PhysMapInt */ public void setPhysMapInt(int param){ this.localPhysMapInt=param; } /** * field for LeftFlankNeighborPos * This was an Attribute! */ protected int localLeftFlankNeighborPos ; /** * Auto generated getter method * @return int */ public int getLeftFlankNeighborPos(){ return localLeftFlankNeighborPos; } /** * Auto generated setter method * @param param LeftFlankNeighborPos */ public void setLeftFlankNeighborPos(int param){ this.localLeftFlankNeighborPos=param; } /** * field for RightFlankNeighborPos * This was an Attribute! */ protected int localRightFlankNeighborPos ; /** * Auto generated getter method * @return int */ public int getRightFlankNeighborPos(){ return localRightFlankNeighborPos; } /** * Auto generated setter method * @param param RightFlankNeighborPos */ public void setRightFlankNeighborPos(int param){ this.localRightFlankNeighborPos=param; } /** * field for LeftContigNeighborPos * This was an Attribute! */ protected int localLeftContigNeighborPos ; /** * Auto generated getter method * @return int */ public int getLeftContigNeighborPos(){ return localLeftContigNeighborPos; } /** * Auto generated setter method * @param param LeftContigNeighborPos */ public void setLeftContigNeighborPos(int param){ this.localLeftContigNeighborPos=param; } /** * field for RightContigNeighborPos * This was an Attribute! */ protected int localRightContigNeighborPos ; /** * Auto generated getter method * @return int */ public int getRightContigNeighborPos(){ return localRightContigNeighborPos; } /** * Auto generated setter method * @param param RightContigNeighborPos */ public void setRightContigNeighborPos(int param){ this.localRightContigNeighborPos=param; } /** * field for NumberOfMismatches * This was an Attribute! */ protected int localNumberOfMismatches ; /** * Auto generated getter method * @return int */ public int getNumberOfMismatches(){ return localNumberOfMismatches; } /** * Auto generated setter method * @param param NumberOfMismatches */ public void setNumberOfMismatches(int param){ this.localNumberOfMismatches=param; } /** * field for NumberOfDeletions * This was an Attribute! */ protected int localNumberOfDeletions ; /** * Auto generated getter method * @return int */ public int getNumberOfDeletions(){ return localNumberOfDeletions; } /** * Auto generated setter method * @param param NumberOfDeletions */ public void setNumberOfDeletions(int param){ this.localNumberOfDeletions=param; } /** * field for NumberOfInsertions * This was an Attribute! */ protected int localNumberOfInsertions ; /** * Auto generated getter method * @return int */ public int getNumberOfInsertions(){ return localNumberOfInsertions; } /** * Auto generated setter method * @param param NumberOfInsertions */ public void setNumberOfInsertions(int param){ this.localNumberOfInsertions=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":MapLoc_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "MapLoc_type0", xmlWriter); } } if (localAsnFrom != null){ writeAttribute("", "asnFrom", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAsnFrom), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localAsnFrom is null"); } if (localAsnTo != null){ writeAttribute("", "asnTo", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAsnTo), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localAsnTo is null"); } if (localLocType != null){ writeAttribute("", "locType", localLocType.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localLocType is null"); } if (!java.lang.Double.isNaN(localAlnQuality)) { writeAttribute("", "alnQuality", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAlnQuality), xmlWriter); } if (localOrient != null){ writeAttribute("", "orient", localOrient.toString(), xmlWriter); } if (localPhysMapInt!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "physMapInt", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPhysMapInt), xmlWriter); } if (localLeftFlankNeighborPos!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "leftFlankNeighborPos", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLeftFlankNeighborPos), xmlWriter); } if (localRightFlankNeighborPos!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "rightFlankNeighborPos", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRightFlankNeighborPos), xmlWriter); } if (localLeftContigNeighborPos!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "leftContigNeighborPos", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLeftContigNeighborPos), xmlWriter); } if (localRightContigNeighborPos!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "rightContigNeighborPos", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRightContigNeighborPos), xmlWriter); } if (localNumberOfMismatches!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "numberOfMismatches", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfMismatches), xmlWriter); } if (localNumberOfDeletions!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "numberOfDeletions", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfDeletions), xmlWriter); } if (localNumberOfInsertions!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "numberOfInsertions", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfInsertions), xmlWriter); } if (localFxnSetTracker){ if (localFxnSet!=null){ for (int i = 0;i < localFxnSet.length;i++){ if (localFxnSet[i] != null){ localFxnSet[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FxnSet"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("FxnSet cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localFxnSetTracker){ if (localFxnSet!=null) { for (int i = 0;i < localFxnSet.length;i++){ if (localFxnSet[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "FxnSet")); elementList.add(localFxnSet[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("FxnSet cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","asnFrom")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAsnFrom)); attribList.add( new javax.xml.namespace.QName("","asnTo")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAsnTo)); attribList.add( new javax.xml.namespace.QName("","locType")); attribList.add(localLocType.toString()); attribList.add( new javax.xml.namespace.QName("","alnQuality")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAlnQuality)); attribList.add( new javax.xml.namespace.QName("","orient")); attribList.add(localOrient.toString()); attribList.add( new javax.xml.namespace.QName("","physMapInt")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPhysMapInt)); attribList.add( new javax.xml.namespace.QName("","leftFlankNeighborPos")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLeftFlankNeighborPos)); attribList.add( new javax.xml.namespace.QName("","rightFlankNeighborPos")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRightFlankNeighborPos)); attribList.add( new javax.xml.namespace.QName("","leftContigNeighborPos")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLeftContigNeighborPos)); attribList.add( new javax.xml.namespace.QName("","rightContigNeighborPos")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRightContigNeighborPos)); attribList.add( new javax.xml.namespace.QName("","numberOfMismatches")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfMismatches)); attribList.add( new javax.xml.namespace.QName("","numberOfDeletions")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfDeletions)); attribList.add( new javax.xml.namespace.QName("","numberOfInsertions")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumberOfInsertions)); 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 MapLoc_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MapLoc_type0 object = new MapLoc_type0(); 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 (!"MapLoc_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (MapLoc_type0)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(); // handle attribute "asnFrom" java.lang.String tempAttribAsnFrom = reader.getAttributeValue(null,"asnFrom"); if (tempAttribAsnFrom!=null){ java.lang.String content = tempAttribAsnFrom; object.setAsnFrom( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribAsnFrom)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute asnFrom is missing"); } handledAttributes.add("asnFrom"); // handle attribute "asnTo" java.lang.String tempAttribAsnTo = reader.getAttributeValue(null,"asnTo"); if (tempAttribAsnTo!=null){ java.lang.String content = tempAttribAsnTo; object.setAsnTo( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribAsnTo)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute asnTo is missing"); } handledAttributes.add("asnTo"); // handle attribute "locType" java.lang.String tempAttribLocType = reader.getAttributeValue(null,"locType"); if (tempAttribLocType!=null){ java.lang.String content = tempAttribLocType; object.setLocType( LocType_type0.Factory.fromString(reader,tempAttribLocType)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute locType is missing"); } handledAttributes.add("locType"); // handle attribute "alnQuality" java.lang.String tempAttribAlnQuality = reader.getAttributeValue(null,"alnQuality"); if (tempAttribAlnQuality!=null){ java.lang.String content = tempAttribAlnQuality; object.setAlnQuality( org.apache.axis2.databinding.utils.ConverterUtil.convertToDouble(tempAttribAlnQuality)); } else { object.setAlnQuality(java.lang.Double.NaN); } handledAttributes.add("alnQuality"); // handle attribute "orient" java.lang.String tempAttribOrient = reader.getAttributeValue(null,"orient"); if (tempAttribOrient!=null){ java.lang.String content = tempAttribOrient; object.setOrient( Orient_type1.Factory.fromString(reader,tempAttribOrient)); } else { } handledAttributes.add("orient"); // handle attribute "physMapInt" java.lang.String tempAttribPhysMapInt = reader.getAttributeValue(null,"physMapInt"); if (tempAttribPhysMapInt!=null){ java.lang.String content = tempAttribPhysMapInt; object.setPhysMapInt( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribPhysMapInt)); } else { object.setPhysMapInt(java.lang.Integer.MIN_VALUE); } handledAttributes.add("physMapInt"); // handle attribute "leftFlankNeighborPos" java.lang.String tempAttribLeftFlankNeighborPos = reader.getAttributeValue(null,"leftFlankNeighborPos"); if (tempAttribLeftFlankNeighborPos!=null){ java.lang.String content = tempAttribLeftFlankNeighborPos; object.setLeftFlankNeighborPos( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribLeftFlankNeighborPos)); } else { object.setLeftFlankNeighborPos(java.lang.Integer.MIN_VALUE); } handledAttributes.add("leftFlankNeighborPos"); // handle attribute "rightFlankNeighborPos" java.lang.String tempAttribRightFlankNeighborPos = reader.getAttributeValue(null,"rightFlankNeighborPos"); if (tempAttribRightFlankNeighborPos!=null){ java.lang.String content = tempAttribRightFlankNeighborPos; object.setRightFlankNeighborPos( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribRightFlankNeighborPos)); } else { object.setRightFlankNeighborPos(java.lang.Integer.MIN_VALUE); } handledAttributes.add("rightFlankNeighborPos"); // handle attribute "leftContigNeighborPos" java.lang.String tempAttribLeftContigNeighborPos = reader.getAttributeValue(null,"leftContigNeighborPos"); if (tempAttribLeftContigNeighborPos!=null){ java.lang.String content = tempAttribLeftContigNeighborPos; object.setLeftContigNeighborPos( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribLeftContigNeighborPos)); } else { object.setLeftContigNeighborPos(java.lang.Integer.MIN_VALUE); } handledAttributes.add("leftContigNeighborPos"); // handle attribute "rightContigNeighborPos" java.lang.String tempAttribRightContigNeighborPos = reader.getAttributeValue(null,"rightContigNeighborPos"); if (tempAttribRightContigNeighborPos!=null){ java.lang.String content = tempAttribRightContigNeighborPos; object.setRightContigNeighborPos( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribRightContigNeighborPos)); } else { object.setRightContigNeighborPos(java.lang.Integer.MIN_VALUE); } handledAttributes.add("rightContigNeighborPos"); // handle attribute "numberOfMismatches" java.lang.String tempAttribNumberOfMismatches = reader.getAttributeValue(null,"numberOfMismatches"); if (tempAttribNumberOfMismatches!=null){ java.lang.String content = tempAttribNumberOfMismatches; object.setNumberOfMismatches( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribNumberOfMismatches)); } else { object.setNumberOfMismatches(java.lang.Integer.MIN_VALUE); } handledAttributes.add("numberOfMismatches"); // handle attribute "numberOfDeletions" java.lang.String tempAttribNumberOfDeletions = reader.getAttributeValue(null,"numberOfDeletions"); if (tempAttribNumberOfDeletions!=null){ java.lang.String content = tempAttribNumberOfDeletions; object.setNumberOfDeletions( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribNumberOfDeletions)); } else { object.setNumberOfDeletions(java.lang.Integer.MIN_VALUE); } handledAttributes.add("numberOfDeletions"); // handle attribute "numberOfInsertions" java.lang.String tempAttribNumberOfInsertions = reader.getAttributeValue(null,"numberOfInsertions"); if (tempAttribNumberOfInsertions!=null){ java.lang.String content = tempAttribNumberOfInsertions; object.setNumberOfInsertions( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribNumberOfInsertions)); } else { object.setNumberOfInsertions(java.lang.Integer.MIN_VALUE); } handledAttributes.add("numberOfInsertions"); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FxnSet").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(FxnSet_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // We should be at the end element, but make sure 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FxnSet").equals(reader.getName())){ list1.add(FxnSet_type0.Factory.parse(reader)); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setFxnSet((FxnSet_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( FxnSet_type0.class, list1)); } // 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 } public static class MolType_type2 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "molType_type2", "ns1"); /** * field for MolType_type2 */ protected java.lang.String localMolType_type2 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected MolType_type2(java.lang.String value, boolean isRegisterValue) { localMolType_type2 = value; if (isRegisterValue){ _table_.put(localMolType_type2, this); } } public static final java.lang.String _genomic = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("genomic"); public static final java.lang.String _cDNA = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cDNA"); public static final java.lang.String _mito = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mito"); public static final java.lang.String _chloro = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("chloro"); public static final MolType_type2 genomic = new MolType_type2(_genomic,true); public static final MolType_type2 cDNA = new MolType_type2(_cDNA,true); public static final MolType_type2 mito = new MolType_type2(_mito,true); public static final MolType_type2 chloro = new MolType_type2(_chloro,true); public java.lang.String getValue() { return localMolType_type2;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localMolType_type2.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":molType_type2", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "molType_type2", xmlWriter); } } if (localMolType_type2==null){ throw new org.apache.axis2.databinding.ADBException("molType_type2 cannot be null !!"); }else{ xmlWriter.writeCharacters(localMolType_type2); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMolType_type2) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static MolType_type2 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { MolType_type2 enumeration = (MolType_type2) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static MolType_type2 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static MolType_type2 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return MolType_type2.Factory.fromString(content,namespaceUri); } else { return MolType_type2.Factory.fromString(content,""); } } /** * 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 MolType_type2 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MolType_type2 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"molType_type2" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = MolType_type2.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = MolType_type2.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Type_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "type_type0", "ns1"); /** * field for Type_type0 */ protected java.lang.String localType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Type_type0(java.lang.String value, boolean isRegisterValue) { localType_type0 = value; if (isRegisterValue){ _table_.put(localType_type0, this); } } public static final java.lang.String _est = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("est"); public static final java.lang.String _obs = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("obs"); public static final Type_type0 est = new Type_type0(_est,true); public static final Type_type0 obs = new Type_type0(_obs,true); public java.lang.String getValue() { return localType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":type_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "type_type0", xmlWriter); } } if (localType_type0==null){ throw new org.apache.axis2.databinding.ADBException("type_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Type_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Type_type0 enumeration = (Type_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Type_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Type_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Type_type0.Factory.fromString(content,namespaceUri); } else { return Type_type0.Factory.fromString(content,""); } } /** * 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 Type_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Type_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"type_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Type_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Type_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MolType_type1 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "molType_type1", "ns1"); /** * field for MolType_type1 */ protected java.lang.String localMolType_type1 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected MolType_type1(java.lang.String value, boolean isRegisterValue) { localMolType_type1 = value; if (isRegisterValue){ _table_.put(localMolType_type1, this); } } public static final java.lang.String _genomic = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("genomic"); public static final java.lang.String _cDNA = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cDNA"); public static final java.lang.String _mito = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mito"); public static final java.lang.String _chloro = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("chloro"); public static final java.lang.String _unknown = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unknown"); public static final MolType_type1 genomic = new MolType_type1(_genomic,true); public static final MolType_type1 cDNA = new MolType_type1(_cDNA,true); public static final MolType_type1 mito = new MolType_type1(_mito,true); public static final MolType_type1 chloro = new MolType_type1(_chloro,true); public static final MolType_type1 unknown = new MolType_type1(_unknown,true); public java.lang.String getValue() { return localMolType_type1;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localMolType_type1.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":molType_type1", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "molType_type1", xmlWriter); } } if (localMolType_type1==null){ throw new org.apache.axis2.databinding.ADBException("molType_type1 cannot be null !!"); }else{ xmlWriter.writeCharacters(localMolType_type1); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMolType_type1) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static MolType_type1 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { MolType_type1 enumeration = (MolType_type1) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static MolType_type1 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static MolType_type1 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return MolType_type1.Factory.fromString(content,namespaceUri); } else { return MolType_type1.Factory.fromString(content,""); } } /** * 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 MolType_type1 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MolType_type1 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"molType_type1" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = MolType_type1.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = MolType_type1.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MolType_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "molType_type0", "ns1"); /** * field for MolType_type0 */ protected java.lang.String localMolType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected MolType_type0(java.lang.String value, boolean isRegisterValue) { localMolType_type0 = value; if (isRegisterValue){ _table_.put(localMolType_type0, this); } } public static final java.lang.String _genomic = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("genomic"); public static final java.lang.String _cDNA = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cDNA"); public static final java.lang.String _mito = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mito"); public static final java.lang.String _chloro = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("chloro"); public static final java.lang.String _unknown = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unknown"); public static final MolType_type0 genomic = new MolType_type0(_genomic,true); public static final MolType_type0 cDNA = new MolType_type0(_cDNA,true); public static final MolType_type0 mito = new MolType_type0(_mito,true); public static final MolType_type0 chloro = new MolType_type0(_chloro,true); public static final MolType_type0 unknown = new MolType_type0(_unknown,true); public java.lang.String getValue() { return localMolType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localMolType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":molType_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "molType_type0", xmlWriter); } } if (localMolType_type0==null){ throw new org.apache.axis2.databinding.ADBException("molType_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localMolType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMolType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static MolType_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { MolType_type0 enumeration = (MolType_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static MolType_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static MolType_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return MolType_type0.Factory.fromString(content,namespaceUri); } else { return MolType_type0.Factory.fromString(content,""); } } /** * 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 MolType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MolType_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"molType_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = MolType_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = MolType_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class ExchangeSet_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = ExchangeSet_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for SourceDatabase */ protected SourceDatabase_type0 localSourceDatabase ; /* 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 localSourceDatabaseTracker = false ; public boolean isSourceDatabaseSpecified(){ return localSourceDatabaseTracker; } /** * Auto generated getter method * @return SourceDatabase_type0 */ public SourceDatabase_type0 getSourceDatabase(){ return localSourceDatabase; } /** * Auto generated setter method * @param param SourceDatabase */ public void setSourceDatabase(SourceDatabase_type0 param){ localSourceDatabaseTracker = param != null; this.localSourceDatabase=param; } /** * field for Rs * This was an Array! */ protected Rs_type0[] localRs ; /* 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 localRsTracker = false ; public boolean isRsSpecified(){ return localRsTracker; } /** * Auto generated getter method * @return Rs_type0[] */ public Rs_type0[] getRs(){ return localRs; } /** * validate the array for Rs */ protected void validateRs(Rs_type0[] param){ } /** * Auto generated setter method * @param param Rs */ public void setRs(Rs_type0[] param){ validateRs(param); localRsTracker = param != null; this.localRs=param; } /** * Auto generated add method for the array for convenience * @param param Rs_type0 */ public void addRs(Rs_type0 param){ if (localRs == null){ localRs = new Rs_type0[]{}; } //update the setting tracker localRsTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localRs); list.add(param); this.localRs = (Rs_type0[])list.toArray( new Rs_type0[list.size()]); } /** * field for Assay */ protected Assay_type0 localAssay ; /* 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 localAssayTracker = false ; public boolean isAssaySpecified(){ return localAssayTracker; } /** * Auto generated getter method * @return Assay_type0 */ public Assay_type0 getAssay(){ return localAssay; } /** * Auto generated setter method * @param param Assay */ public void setAssay(Assay_type0 param){ localAssayTracker = param != null; this.localAssay=param; } /** * field for Query */ protected Query_type0 localQuery ; /* 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 localQueryTracker = false ; public boolean isQuerySpecified(){ return localQueryTracker; } /** * Auto generated getter method * @return Query_type0 */ public Query_type0 getQuery(){ return localQuery; } /** * Auto generated setter method * @param param Query */ public void setQuery(Query_type0 param){ localQueryTracker = param != null; this.localQuery=param; } /** * field for Summary */ protected Summary_type0 localSummary ; /* 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 localSummaryTracker = false ; public boolean isSummarySpecified(){ return localSummaryTracker; } /** * Auto generated getter method * @return Summary_type0 */ public Summary_type0 getSummary(){ return localSummary; } /** * Auto generated setter method * @param param Summary */ public void setSummary(Summary_type0 param){ localSummaryTracker = param != null; this.localSummary=param; } /** * field for BaseURL * This was an Array! */ protected BaseURL_type0[] localBaseURL ; /* 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 localBaseURLTracker = false ; public boolean isBaseURLSpecified(){ return localBaseURLTracker; } /** * Auto generated getter method * @return BaseURL_type0[] */ public BaseURL_type0[] getBaseURL(){ return localBaseURL; } /** * validate the array for BaseURL */ protected void validateBaseURL(BaseURL_type0[] param){ } /** * Auto generated setter method * @param param BaseURL */ public void setBaseURL(BaseURL_type0[] param){ validateBaseURL(param); localBaseURLTracker = param != null; this.localBaseURL=param; } /** * Auto generated add method for the array for convenience * @param param BaseURL_type0 */ public void addBaseURL(BaseURL_type0 param){ if (localBaseURL == null){ localBaseURL = new BaseURL_type0[]{}; } //update the setting tracker localBaseURLTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localBaseURL); list.add(param); this.localBaseURL = (BaseURL_type0[])list.toArray( new BaseURL_type0[list.size()]); } /** * field for SetType * This was an Attribute! */ protected java.lang.String localSetType ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSetType(){ return localSetType; } /** * Auto generated setter method * @param param SetType */ public void setSetType(java.lang.String param){ this.localSetType=param; } /** * field for SetDepth * This was an Attribute! */ protected java.lang.String localSetDepth ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSetDepth(){ return localSetDepth; } /** * Auto generated setter method * @param param SetDepth */ public void setSetDepth(java.lang.String param){ this.localSetDepth=param; } /** * field for SpecVersion * This was an Attribute! */ protected java.lang.String localSpecVersion ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSpecVersion(){ return localSpecVersion; } /** * Auto generated setter method * @param param SpecVersion */ public void setSpecVersion(java.lang.String param){ this.localSpecVersion=param; } /** * field for DbSnpBuild * This was an Attribute! */ protected int localDbSnpBuild ; /** * Auto generated getter method * @return int */ public int getDbSnpBuild(){ return localDbSnpBuild; } /** * Auto generated setter method * @param param DbSnpBuild */ public void setDbSnpBuild(int param){ this.localDbSnpBuild=param; } /** * field for Generated * This was an Attribute! */ protected java.lang.String localGenerated ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGenerated(){ return localGenerated; } /** * Auto generated setter method * @param param Generated */ public void setGenerated(java.lang.String param){ this.localGenerated=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":ExchangeSet_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "ExchangeSet_type0", xmlWriter); } } if (localSetType != null){ writeAttribute("", "setType", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetType), xmlWriter); } if (localSetDepth != null){ writeAttribute("", "setDepth", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetDepth), xmlWriter); } if (localSpecVersion != null){ writeAttribute("", "specVersion", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpecVersion), xmlWriter); } if (localDbSnpBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "dbSnpBuild", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild), xmlWriter); } if (localGenerated != null){ writeAttribute("", "generated", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenerated), xmlWriter); } if (localSourceDatabaseTracker){ if (localSourceDatabase==null){ throw new org.apache.axis2.databinding.ADBException("SourceDatabase cannot be null!!"); } localSourceDatabase.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SourceDatabase"), xmlWriter); } if (localRsTracker){ if (localRs!=null){ for (int i = 0;i < localRs.length;i++){ if (localRs[i] != null){ localRs[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Rs cannot be null!!"); } } if (localAssayTracker){ if (localAssay==null){ throw new org.apache.axis2.databinding.ADBException("Assay cannot be null!!"); } localAssay.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assay"), xmlWriter); } if (localQueryTracker){ if (localQuery==null){ throw new org.apache.axis2.databinding.ADBException("Query cannot be null!!"); } localQuery.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Query"), xmlWriter); } if (localSummaryTracker){ if (localSummary==null){ throw new org.apache.axis2.databinding.ADBException("Summary cannot be null!!"); } localSummary.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Summary"), xmlWriter); } if (localBaseURLTracker){ if (localBaseURL!=null){ for (int i = 0;i < localBaseURL.length;i++){ if (localBaseURL[i] != null){ localBaseURL[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("BaseURL cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localSourceDatabaseTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "SourceDatabase")); if (localSourceDatabase==null){ throw new org.apache.axis2.databinding.ADBException("SourceDatabase cannot be null!!"); } elementList.add(localSourceDatabase); } if (localRsTracker){ if (localRs!=null) { for (int i = 0;i < localRs.length;i++){ if (localRs[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Rs")); elementList.add(localRs[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Rs cannot be null!!"); } } if (localAssayTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Assay")); if (localAssay==null){ throw new org.apache.axis2.databinding.ADBException("Assay cannot be null!!"); } elementList.add(localAssay); } if (localQueryTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Query")); if (localQuery==null){ throw new org.apache.axis2.databinding.ADBException("Query cannot be null!!"); } elementList.add(localQuery); } if (localSummaryTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Summary")); if (localSummary==null){ throw new org.apache.axis2.databinding.ADBException("Summary cannot be null!!"); } elementList.add(localSummary); } if (localBaseURLTracker){ if (localBaseURL!=null) { for (int i = 0;i < localBaseURL.length;i++){ if (localBaseURL[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "BaseURL")); elementList.add(localBaseURL[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("BaseURL cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","setType")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetType)); attribList.add( new javax.xml.namespace.QName("","setDepth")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetDepth)); attribList.add( new javax.xml.namespace.QName("","specVersion")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpecVersion)); attribList.add( new javax.xml.namespace.QName("","dbSnpBuild")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild)); attribList.add( new javax.xml.namespace.QName("","generated")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenerated)); 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 ExchangeSet_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ ExchangeSet_type0 object = new ExchangeSet_type0(); 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 (!"ExchangeSet_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (ExchangeSet_type0)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(); // handle attribute "setType" java.lang.String tempAttribSetType = reader.getAttributeValue(null,"setType"); if (tempAttribSetType!=null){ java.lang.String content = tempAttribSetType; object.setSetType( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSetType)); } else { } handledAttributes.add("setType"); // handle attribute "setDepth" java.lang.String tempAttribSetDepth = reader.getAttributeValue(null,"setDepth"); if (tempAttribSetDepth!=null){ java.lang.String content = tempAttribSetDepth; object.setSetDepth( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSetDepth)); } else { } handledAttributes.add("setDepth"); // handle attribute "specVersion" java.lang.String tempAttribSpecVersion = reader.getAttributeValue(null,"specVersion"); if (tempAttribSpecVersion!=null){ java.lang.String content = tempAttribSpecVersion; object.setSpecVersion( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSpecVersion)); } else { } handledAttributes.add("specVersion"); // handle attribute "dbSnpBuild" java.lang.String tempAttribDbSnpBuild = reader.getAttributeValue(null,"dbSnpBuild"); if (tempAttribDbSnpBuild!=null){ java.lang.String content = tempAttribDbSnpBuild; object.setDbSnpBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribDbSnpBuild)); } else { object.setDbSnpBuild(java.lang.Integer.MIN_VALUE); } handledAttributes.add("dbSnpBuild"); // handle attribute "generated" java.lang.String tempAttribGenerated = reader.getAttributeValue(null,"generated"); if (tempAttribGenerated!=null){ java.lang.String content = tempAttribGenerated; object.setGenerated( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGenerated)); } else { } handledAttributes.add("generated"); reader.next(); java.util.ArrayList list2 = new java.util.ArrayList(); java.util.ArrayList list6 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SourceDatabase").equals(reader.getName())){ object.setSourceDatabase(SourceDatabase_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs").equals(reader.getName())){ // Process the array and step past its final element's end. list2.add(Rs_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone2 = false; while(!loopDone2){ // We should be at the end element, but make sure 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 loopDone2 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs").equals(reader.getName())){ list2.add(Rs_type0.Factory.parse(reader)); }else{ loopDone2 = true; } } } // call the converter utility to convert and set the array object.setRs((Rs_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Rs_type0.class, list2)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assay").equals(reader.getName())){ object.setAssay(Assay_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Query").equals(reader.getName())){ object.setQuery(Query_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Summary").equals(reader.getName())){ object.setSummary(Summary_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL").equals(reader.getName())){ // Process the array and step past its final element's end. list6.add(BaseURL_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone6 = false; while(!loopDone6){ // We should be at the end element, but make sure 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL").equals(reader.getName())){ list6.add(BaseURL_type0.Factory.parse(reader)); }else{ loopDone6 = true; } } } // call the converter utility to convert and set the array object.setBaseURL((BaseURL_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( BaseURL_type0.class, list6)); } // 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 } public static class SnpType_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "snpType_type0", "ns1"); /** * field for SnpType_type0 */ protected java.lang.String localSnpType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected SnpType_type0(java.lang.String value, boolean isRegisterValue) { localSnpType_type0 = value; if (isRegisterValue){ _table_.put(localSnpType_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("notwithdrawn"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("artifact"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("gene-duplication"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("duplicate-submission"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("notspecified"); public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("ambiguous-location"); public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("low-map-quality"); public static final SnpType_type0 value1 = new SnpType_type0(_value1,true); public static final SnpType_type0 value2 = new SnpType_type0(_value2,true); public static final SnpType_type0 value3 = new SnpType_type0(_value3,true); public static final SnpType_type0 value4 = new SnpType_type0(_value4,true); public static final SnpType_type0 value5 = new SnpType_type0(_value5,true); public static final SnpType_type0 value6 = new SnpType_type0(_value6,true); public static final SnpType_type0 value7 = new SnpType_type0(_value7,true); public java.lang.String getValue() { return localSnpType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localSnpType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":snpType_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "snpType_type0", xmlWriter); } } if (localSnpType_type0==null){ throw new org.apache.axis2.databinding.ADBException("snpType_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localSnpType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSnpType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static SnpType_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { SnpType_type0 enumeration = (SnpType_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static SnpType_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static SnpType_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return SnpType_type0.Factory.fromString(content,namespaceUri); } else { return SnpType_type0.Factory.fromString(content,""); } } /** * 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 SnpType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ SnpType_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"snpType_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = SnpType_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = SnpType_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Update_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Update_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Build * This was an Attribute! */ protected int localBuild ; /** * Auto generated getter method * @return int */ public int getBuild(){ return localBuild; } /** * Auto generated setter method * @param param Build */ public void setBuild(int param){ this.localBuild=param; } /** * field for Date * This was an Attribute! */ protected java.lang.String localDate ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getDate(){ return localDate; } /** * Auto generated setter method * @param param Date */ public void setDate(java.lang.String param){ this.localDate=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Update_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Update_type0", xmlWriter); } } if (localBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "build", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuild), xmlWriter); } if (localDate != null){ writeAttribute("", "date", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","build")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuild)); attribList.add( new javax.xml.namespace.QName("","date")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate)); 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 Update_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Update_type0 object = new Update_type0(); 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 (!"Update_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Update_type0)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(); // handle attribute "build" java.lang.String tempAttribBuild = reader.getAttributeValue(null,"build"); if (tempAttribBuild!=null){ java.lang.String content = tempAttribBuild; object.setBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBuild)); } else { object.setBuild(java.lang.Integer.MIN_VALUE); } handledAttributes.add("build"); // handle attribute "date" java.lang.String tempAttribDate = reader.getAttributeValue(null,"date"); if (tempAttribDate!=null){ java.lang.String content = tempAttribDate; object.setDate( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribDate)); } else { } handledAttributes.add("date"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class SourceDatabase_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = SourceDatabase_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for TaxId * This was an Attribute! */ protected int localTaxId ; /** * Auto generated getter method * @return int */ public int getTaxId(){ return localTaxId; } /** * Auto generated setter method * @param param TaxId */ public void setTaxId(int param){ this.localTaxId=param; } /** * field for Organism * This was an Attribute! */ protected java.lang.String localOrganism ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getOrganism(){ return localOrganism; } /** * Auto generated setter method * @param param Organism */ public void setOrganism(java.lang.String param){ this.localOrganism=param; } /** * field for DbSnpOrgAbbr * This was an Attribute! */ protected java.lang.String localDbSnpOrgAbbr ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getDbSnpOrgAbbr(){ return localDbSnpOrgAbbr; } /** * Auto generated setter method * @param param DbSnpOrgAbbr */ public void setDbSnpOrgAbbr(java.lang.String param){ this.localDbSnpOrgAbbr=param; } /** * field for GpipeOrgAbbr * This was an Attribute! */ protected java.lang.String localGpipeOrgAbbr ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGpipeOrgAbbr(){ return localGpipeOrgAbbr; } /** * Auto generated setter method * @param param GpipeOrgAbbr */ public void setGpipeOrgAbbr(java.lang.String param){ this.localGpipeOrgAbbr=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":SourceDatabase_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "SourceDatabase_type0", xmlWriter); } } if (localTaxId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "taxId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTaxId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localTaxId is null"); } if (localOrganism != null){ writeAttribute("", "organism", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrganism), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localOrganism is null"); } if (localDbSnpOrgAbbr != null){ writeAttribute("", "dbSnpOrgAbbr", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpOrgAbbr), xmlWriter); } if (localGpipeOrgAbbr != null){ writeAttribute("", "gpipeOrgAbbr", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGpipeOrgAbbr), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","taxId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTaxId)); attribList.add( new javax.xml.namespace.QName("","organism")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrganism)); attribList.add( new javax.xml.namespace.QName("","dbSnpOrgAbbr")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpOrgAbbr)); attribList.add( new javax.xml.namespace.QName("","gpipeOrgAbbr")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGpipeOrgAbbr)); 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 SourceDatabase_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ SourceDatabase_type0 object = new SourceDatabase_type0(); 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 (!"SourceDatabase_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (SourceDatabase_type0)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(); // handle attribute "taxId" java.lang.String tempAttribTaxId = reader.getAttributeValue(null,"taxId"); if (tempAttribTaxId!=null){ java.lang.String content = tempAttribTaxId; object.setTaxId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribTaxId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute taxId is missing"); } handledAttributes.add("taxId"); // handle attribute "organism" java.lang.String tempAttribOrganism = reader.getAttributeValue(null,"organism"); if (tempAttribOrganism!=null){ java.lang.String content = tempAttribOrganism; object.setOrganism( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribOrganism)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute organism is missing"); } handledAttributes.add("organism"); // handle attribute "dbSnpOrgAbbr" java.lang.String tempAttribDbSnpOrgAbbr = reader.getAttributeValue(null,"dbSnpOrgAbbr"); if (tempAttribDbSnpOrgAbbr!=null){ java.lang.String content = tempAttribDbSnpOrgAbbr; object.setDbSnpOrgAbbr( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribDbSnpOrgAbbr)); } else { } handledAttributes.add("dbSnpOrgAbbr"); // handle attribute "gpipeOrgAbbr" java.lang.String tempAttribGpipeOrgAbbr = reader.getAttributeValue(null,"gpipeOrgAbbr"); if (tempAttribGpipeOrgAbbr!=null){ java.lang.String content = tempAttribGpipeOrgAbbr; object.setGpipeOrgAbbr( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGpipeOrgAbbr)); } else { } handledAttributes.add("gpipeOrgAbbr"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MapLoc implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "MapLoc", "ns1"); /** * field for MapLoc */ protected MapLoc_type0 localMapLoc ; /** * Auto generated getter method * @return MapLoc_type0 */ public MapLoc_type0 getMapLoc(){ return localMapLoc; } /** * Auto generated setter method * @param param MapLoc */ public void setMapLoc(MapLoc_type0 param){ this.localMapLoc=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localMapLoc==null){ throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!"); } localMapLoc.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localMapLoc.getPullParser(MY_QNAME); } /** * 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 MapLoc parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MapLoc object = new MapLoc(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc").equals(reader.getName())){ object.setMapLoc(MapLoc_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class EFetchRequest implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "eFetchRequest", "ns1"); /** * field for Id */ protected java.lang.String localId ; /* 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 localIdTracker = false ; public boolean isIdSpecified(){ return localIdTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getId(){ return localId; } /** * Auto generated setter method * @param param Id */ public void setId(java.lang.String param){ localIdTracker = param != null; this.localId=param; } /** * field for WebEnv */ protected java.lang.String localWebEnv ; /* 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 localWebEnvTracker = false ; public boolean isWebEnvSpecified(){ return localWebEnvTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getWebEnv(){ return localWebEnv; } /** * Auto generated setter method * @param param WebEnv */ public void setWebEnv(java.lang.String param){ localWebEnvTracker = param != null; this.localWebEnv=param; } /** * field for Query_key */ protected java.lang.String localQuery_key ; /* 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 localQuery_keyTracker = false ; public boolean isQuery_keySpecified(){ return localQuery_keyTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getQuery_key(){ return localQuery_key; } /** * Auto generated setter method * @param param Query_key */ public void setQuery_key(java.lang.String param){ localQuery_keyTracker = param != null; this.localQuery_key=param; } /** * field for Tool */ protected java.lang.String localTool ; /* 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 localToolTracker = false ; public boolean isToolSpecified(){ return localToolTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getTool(){ return localTool; } /** * Auto generated setter method * @param param Tool */ public void setTool(java.lang.String param){ localToolTracker = param != null; this.localTool=param; } /** * field for Email */ protected java.lang.String localEmail ; /* 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 localEmailTracker = false ; public boolean isEmailSpecified(){ return localEmailTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getEmail(){ return localEmail; } /** * Auto generated setter method * @param param Email */ public void setEmail(java.lang.String param){ localEmailTracker = param != null; this.localEmail=param; } /** * field for Retstart */ protected java.lang.String localRetstart ; /* 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 localRetstartTracker = false ; public boolean isRetstartSpecified(){ return localRetstartTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getRetstart(){ return localRetstart; } /** * Auto generated setter method * @param param Retstart */ public void setRetstart(java.lang.String param){ localRetstartTracker = param != null; this.localRetstart=param; } /** * field for Retmax */ protected java.lang.String localRetmax ; /* 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 localRetmaxTracker = false ; public boolean isRetmaxSpecified(){ return localRetmaxTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getRetmax(){ return localRetmax; } /** * Auto generated setter method * @param param Retmax */ public void setRetmax(java.lang.String param){ localRetmaxTracker = param != null; this.localRetmax=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":eFetchRequest", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "eFetchRequest", xmlWriter); } } if (localIdTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "id", xmlWriter); if (localId==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("id cannot be null!!"); }else{ xmlWriter.writeCharacters(localId); } xmlWriter.writeEndElement(); } if (localWebEnvTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "WebEnv", xmlWriter); if (localWebEnv==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("WebEnv cannot be null!!"); }else{ xmlWriter.writeCharacters(localWebEnv); } xmlWriter.writeEndElement(); } if (localQuery_keyTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "query_key", xmlWriter); if (localQuery_key==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("query_key cannot be null!!"); }else{ xmlWriter.writeCharacters(localQuery_key); } xmlWriter.writeEndElement(); } if (localToolTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "tool", xmlWriter); if (localTool==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("tool cannot be null!!"); }else{ xmlWriter.writeCharacters(localTool); } xmlWriter.writeEndElement(); } if (localEmailTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "email", xmlWriter); if (localEmail==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("email cannot be null!!"); }else{ xmlWriter.writeCharacters(localEmail); } xmlWriter.writeEndElement(); } if (localRetstartTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "retstart", xmlWriter); if (localRetstart==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("retstart cannot be null!!"); }else{ xmlWriter.writeCharacters(localRetstart); } xmlWriter.writeEndElement(); } if (localRetmaxTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "retmax", xmlWriter); if (localRetmax==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("retmax cannot be null!!"); }else{ xmlWriter.writeCharacters(localRetmax); } xmlWriter.writeEndElement(); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localIdTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "id")); if (localId != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId)); } else { throw new org.apache.axis2.databinding.ADBException("id cannot be null!!"); } } if (localWebEnvTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "WebEnv")); if (localWebEnv != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localWebEnv)); } else { throw new org.apache.axis2.databinding.ADBException("WebEnv cannot be null!!"); } } if (localQuery_keyTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "query_key")); if (localQuery_key != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localQuery_key)); } else { throw new org.apache.axis2.databinding.ADBException("query_key cannot be null!!"); } } if (localToolTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "tool")); if (localTool != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTool)); } else { throw new org.apache.axis2.databinding.ADBException("tool cannot be null!!"); } } if (localEmailTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "email")); if (localEmail != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEmail)); } else { throw new org.apache.axis2.databinding.ADBException("email cannot be null!!"); } } if (localRetstartTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "retstart")); if (localRetstart != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRetstart)); } else { throw new org.apache.axis2.databinding.ADBException("retstart cannot be null!!"); } } if (localRetmaxTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "retmax")); if (localRetmax != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRetmax)); } else { throw new org.apache.axis2.databinding.ADBException("retmax cannot be null!!"); } } 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 EFetchRequest parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ EFetchRequest object = new EFetchRequest(); 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 (!"eFetchRequest".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (EFetchRequest)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(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","id").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: "+"id" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setId( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","WebEnv").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: "+"WebEnv" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setWebEnv( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","query_key").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: "+"query_key" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setQuery_key( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","tool").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: "+"tool" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setTool( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","email").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: "+"email" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setEmail( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","retstart").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: "+"retstart" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setRetstart( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","retmax").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: "+"retmax" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setRetmax( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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 } public static class Validated_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "validated_type0", "ns1"); /** * field for Validated_type0 */ protected java.lang.String localValidated_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Validated_type0(java.lang.String value, boolean isRegisterValue) { localValidated_type0 = value; if (isRegisterValue){ _table_.put(localValidated_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("by-submitter"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("by-frequency"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("by-cluster"); public static final Validated_type0 value1 = new Validated_type0(_value1,true); public static final Validated_type0 value2 = new Validated_type0(_value2,true); public static final Validated_type0 value3 = new Validated_type0(_value3,true); public java.lang.String getValue() { return localValidated_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localValidated_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":validated_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "validated_type0", xmlWriter); } } if (localValidated_type0==null){ throw new org.apache.axis2.databinding.ADBException("validated_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localValidated_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValidated_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Validated_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Validated_type0 enumeration = (Validated_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Validated_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Validated_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Validated_type0.Factory.fromString(content,namespaceUri); } else { return Validated_type0.Factory.fromString(content,""); } } /** * 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 Validated_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Validated_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"validated_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Validated_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Validated_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Het_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Het_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Type * This was an Attribute! */ protected Type_type0 localType ; /** * Auto generated getter method * @return Type_type0 */ public Type_type0 getType(){ return localType; } /** * Auto generated setter method * @param param Type */ public void setType(Type_type0 param){ this.localType=param; } /** * field for Value * This was an Attribute! */ protected float localValue ; /** * Auto generated getter method * @return float */ public float getValue(){ return localValue; } /** * Auto generated setter method * @param param Value */ public void setValue(float param){ this.localValue=param; } /** * field for StdError * This was an Attribute! */ protected float localStdError ; /** * Auto generated getter method * @return float */ public float getStdError(){ return localStdError; } /** * Auto generated setter method * @param param StdError */ public void setStdError(float param){ this.localStdError=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Het_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Het_type0", xmlWriter); } } if (localType != null){ writeAttribute("", "type", localType.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localType is null"); } if (!java.lang.Float.isNaN(localValue)) { writeAttribute("", "value", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localValue is null"); } if (!java.lang.Float.isNaN(localStdError)) { writeAttribute("", "stdError", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStdError), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","type")); attribList.add(localType.toString()); attribList.add( new javax.xml.namespace.QName("","value")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); attribList.add( new javax.xml.namespace.QName("","stdError")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStdError)); 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 Het_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Het_type0 object = new Het_type0(); 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 (!"Het_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Het_type0)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(); // handle attribute "type" java.lang.String tempAttribType = reader.getAttributeValue(null,"type"); if (tempAttribType!=null){ java.lang.String content = tempAttribType; object.setType( Type_type0.Factory.fromString(reader,tempAttribType)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute type is missing"); } handledAttributes.add("type"); // handle attribute "value" java.lang.String tempAttribValue = reader.getAttributeValue(null,"value"); if (tempAttribValue!=null){ java.lang.String content = tempAttribValue; object.setValue( org.apache.axis2.databinding.utils.ConverterUtil.convertToFloat(tempAttribValue)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute value is missing"); } handledAttributes.add("value"); // handle attribute "stdError" java.lang.String tempAttribStdError = reader.getAttributeValue(null,"stdError"); if (tempAttribStdError!=null){ java.lang.String content = tempAttribStdError; object.setStdError( org.apache.axis2.databinding.utils.ConverterUtil.convertToFloat(tempAttribStdError)); } else { object.setStdError(java.lang.Float.NaN); } handledAttributes.add("stdError"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Taxonomy_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Taxonomy_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Id * This was an Attribute! */ protected int localId ; /** * Auto generated getter method * @return int */ public int getId(){ return localId; } /** * Auto generated setter method * @param param Id */ public void setId(int param){ this.localId=param; } /** * field for Organism * This was an Attribute! */ protected java.lang.String localOrganism ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getOrganism(){ return localOrganism; } /** * Auto generated setter method * @param param Organism */ public void setOrganism(java.lang.String param){ this.localOrganism=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Taxonomy_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Taxonomy_type0", xmlWriter); } } if (localId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "id", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localId is null"); } if (localOrganism != null){ writeAttribute("", "organism", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrganism), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","id")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId)); attribList.add( new javax.xml.namespace.QName("","organism")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrganism)); 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 Taxonomy_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Taxonomy_type0 object = new Taxonomy_type0(); 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 (!"Taxonomy_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Taxonomy_type0)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(); // handle attribute "id" java.lang.String tempAttribId = reader.getAttributeValue(null,"id"); if (tempAttribId!=null){ java.lang.String content = tempAttribId; object.setId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute id is missing"); } handledAttributes.add("id"); // handle attribute "organism" java.lang.String tempAttribOrganism = reader.getAttributeValue(null,"organism"); if (tempAttribOrganism!=null){ java.lang.String content = tempAttribOrganism; object.setOrganism( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribOrganism)); } else { } handledAttributes.add("organism"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Component implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Component", "ns1"); /** * field for Component */ protected Component_type0 localComponent ; /** * Auto generated getter method * @return Component_type0 */ public Component_type0 getComponent(){ return localComponent; } /** * Auto generated setter method * @param param Component */ public void setComponent(Component_type0 param){ this.localComponent=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localComponent==null){ throw new org.apache.axis2.databinding.ADBException("Component cannot be null!"); } localComponent.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localComponent.getPullParser(MY_QNAME); } /** * 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 Component parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Component object = new Component(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Component").equals(reader.getName())){ object.setComponent(Component_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class PrimarySequence_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = PrimarySequence_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for MapLoc * This was an Array! */ protected MapLoc_type0[] localMapLoc ; /** * Auto generated getter method * @return MapLoc_type0[] */ public MapLoc_type0[] getMapLoc(){ return localMapLoc; } /** * validate the array for MapLoc */ protected void validateMapLoc(MapLoc_type0[] param){ if ((param != null) && (param.length < 1)){ throw new java.lang.RuntimeException(); } } /** * Auto generated setter method * @param param MapLoc */ public void setMapLoc(MapLoc_type0[] param){ validateMapLoc(param); this.localMapLoc=param; } /** * Auto generated add method for the array for convenience * @param param MapLoc_type0 */ public void addMapLoc(MapLoc_type0 param){ if (localMapLoc == null){ localMapLoc = new MapLoc_type0[]{}; } java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMapLoc); list.add(param); this.localMapLoc = (MapLoc_type0[])list.toArray( new MapLoc_type0[list.size()]); } /** * field for DbSnpBuild * This was an Attribute! */ protected int localDbSnpBuild ; /** * Auto generated getter method * @return int */ public int getDbSnpBuild(){ return localDbSnpBuild; } /** * Auto generated setter method * @param param DbSnpBuild */ public void setDbSnpBuild(int param){ this.localDbSnpBuild=param; } /** * field for Gi * This was an Attribute! */ protected int localGi ; /** * Auto generated getter method * @return int */ public int getGi(){ return localGi; } /** * Auto generated setter method * @param param Gi */ public void setGi(int param){ this.localGi=param; } /** * field for Source * This was an Attribute! */ protected Source_type0 localSource ; /** * Auto generated getter method * @return Source_type0 */ public Source_type0 getSource(){ return localSource; } /** * Auto generated setter method * @param param Source */ public void setSource(Source_type0 param){ this.localSource=param; } /** * field for Accession * This was an Attribute! */ protected java.lang.String localAccession ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAccession(){ return localAccession; } /** * Auto generated setter method * @param param Accession */ public void setAccession(java.lang.String param){ this.localAccession=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":PrimarySequence_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "PrimarySequence_type0", xmlWriter); } } if (localDbSnpBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "dbSnpBuild", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localDbSnpBuild is null"); } if (localGi!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "gi", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGi), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localGi is null"); } if (localSource != null){ writeAttribute("", "source", localSource.toString(), xmlWriter); } if (localAccession != null){ writeAttribute("", "accession", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAccession), xmlWriter); } if (localMapLoc!=null){ for (int i = 0;i < localMapLoc.length;i++){ if (localMapLoc[i] != null){ localMapLoc[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc"), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } } } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localMapLoc!=null) { for (int i = 0;i < localMapLoc.length;i++){ if (localMapLoc[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "MapLoc")); elementList.add(localMapLoc[i]); } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null !!"); } } } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } attribList.add( new javax.xml.namespace.QName("","dbSnpBuild")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild)); attribList.add( new javax.xml.namespace.QName("","gi")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGi)); attribList.add( new javax.xml.namespace.QName("","source")); attribList.add(localSource.toString()); attribList.add( new javax.xml.namespace.QName("","accession")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAccession)); 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 PrimarySequence_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ PrimarySequence_type0 object = new PrimarySequence_type0(); 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 (!"PrimarySequence_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (PrimarySequence_type0)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(); // handle attribute "dbSnpBuild" java.lang.String tempAttribDbSnpBuild = reader.getAttributeValue(null,"dbSnpBuild"); if (tempAttribDbSnpBuild!=null){ java.lang.String content = tempAttribDbSnpBuild; object.setDbSnpBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribDbSnpBuild)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute dbSnpBuild is missing"); } handledAttributes.add("dbSnpBuild"); // handle attribute "gi" java.lang.String tempAttribGi = reader.getAttributeValue(null,"gi"); if (tempAttribGi!=null){ java.lang.String content = tempAttribGi; object.setGi( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribGi)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute gi is missing"); } handledAttributes.add("gi"); // handle attribute "source" java.lang.String tempAttribSource = reader.getAttributeValue(null,"source"); if (tempAttribSource!=null){ java.lang.String content = tempAttribSource; object.setSource( Source_type0.Factory.fromString(reader,tempAttribSource)); } else { } handledAttributes.add("source"); // handle attribute "accession" java.lang.String tempAttribAccession = reader.getAttributeValue(null,"accession"); if (tempAttribAccession!=null){ java.lang.String content = tempAttribAccession; object.setAccession( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAccession)); } else { } handledAttributes.add("accession"); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(MapLoc_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // We should be at the end element, but make sure 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc").equals(reader.getName())){ list1.add(MapLoc_type0.Factory.parse(reader)); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setMapLoc((MapLoc_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( MapLoc_type0.class, list1)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } 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 } public static class Assay implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Assay", "ns1"); /** * field for Assay */ protected Assay_type0 localAssay ; /** * Auto generated getter method * @return Assay_type0 */ public Assay_type0 getAssay(){ return localAssay; } /** * Auto generated setter method * @param param Assay */ public void setAssay(Assay_type0 param){ this.localAssay=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localAssay==null){ throw new org.apache.axis2.databinding.ADBException("Assay cannot be null!"); } localAssay.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localAssay.getPullParser(MY_QNAME); } /** * 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 Assay parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Assay object = new Assay(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assay").equals(reader.getName())){ object.setAssay(Assay_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class FxnSet_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = FxnSet_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for GeneId * This was an Attribute! */ protected int localGeneId ; /** * Auto generated getter method * @return int */ public int getGeneId(){ return localGeneId; } /** * Auto generated setter method * @param param GeneId */ public void setGeneId(int param){ this.localGeneId=param; } /** * field for Symbol * This was an Attribute! */ protected java.lang.String localSymbol ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSymbol(){ return localSymbol; } /** * Auto generated setter method * @param param Symbol */ public void setSymbol(java.lang.String param){ this.localSymbol=param; } /** * field for MrnaAcc * This was an Attribute! */ protected java.lang.String localMrnaAcc ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getMrnaAcc(){ return localMrnaAcc; } /** * Auto generated setter method * @param param MrnaAcc */ public void setMrnaAcc(java.lang.String param){ this.localMrnaAcc=param; } /** * field for MrnaVer * This was an Attribute! */ protected int localMrnaVer ; /** * Auto generated getter method * @return int */ public int getMrnaVer(){ return localMrnaVer; } /** * Auto generated setter method * @param param MrnaVer */ public void setMrnaVer(int param){ this.localMrnaVer=param; } /** * field for ProtAcc * This was an Attribute! */ protected java.lang.String localProtAcc ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getProtAcc(){ return localProtAcc; } /** * Auto generated setter method * @param param ProtAcc */ public void setProtAcc(java.lang.String param){ this.localProtAcc=param; } /** * field for ProtVer * This was an Attribute! */ protected int localProtVer ; /** * Auto generated getter method * @return int */ public int getProtVer(){ return localProtVer; } /** * Auto generated setter method * @param param ProtVer */ public void setProtVer(int param){ this.localProtVer=param; } /** * field for FxnClass * This was an Attribute! */ protected FxnClass_type0 localFxnClass ; /** * Auto generated getter method * @return FxnClass_type0 */ public FxnClass_type0 getFxnClass(){ return localFxnClass; } /** * Auto generated setter method * @param param FxnClass */ public void setFxnClass(FxnClass_type0 param){ this.localFxnClass=param; } /** * field for ReadingFrame * This was an Attribute! */ protected int localReadingFrame ; /** * Auto generated getter method * @return int */ public int getReadingFrame(){ return localReadingFrame; } /** * Auto generated setter method * @param param ReadingFrame */ public void setReadingFrame(int param){ this.localReadingFrame=param; } /** * field for Allele * This was an Attribute! */ protected java.lang.String localAllele ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAllele(){ return localAllele; } /** * Auto generated setter method * @param param Allele */ public void setAllele(java.lang.String param){ this.localAllele=param; } /** * field for Residue * This was an Attribute! */ protected java.lang.String localResidue ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getResidue(){ return localResidue; } /** * Auto generated setter method * @param param Residue */ public void setResidue(java.lang.String param){ this.localResidue=param; } /** * field for AaPosition * This was an Attribute! */ protected int localAaPosition ; /** * Auto generated getter method * @return int */ public int getAaPosition(){ return localAaPosition; } /** * Auto generated setter method * @param param AaPosition */ public void setAaPosition(int param){ this.localAaPosition=param; } /** * field for MrnaPosition * This was an Attribute! */ protected int localMrnaPosition ; /** * Auto generated getter method * @return int */ public int getMrnaPosition(){ return localMrnaPosition; } /** * Auto generated setter method * @param param MrnaPosition */ public void setMrnaPosition(int param){ this.localMrnaPosition=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":FxnSet_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "FxnSet_type0", xmlWriter); } } if (localGeneId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "geneId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGeneId), xmlWriter); } if (localSymbol != null){ writeAttribute("", "symbol", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSymbol), xmlWriter); } if (localMrnaAcc != null){ writeAttribute("", "mrnaAcc", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaAcc), xmlWriter); } if (localMrnaVer!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "mrnaVer", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaVer), xmlWriter); } if (localProtAcc != null){ writeAttribute("", "protAcc", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtAcc), xmlWriter); } if (localProtVer!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "protVer", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtVer), xmlWriter); } if (localFxnClass != null){ writeAttribute("", "fxnClass", localFxnClass.toString(), xmlWriter); } if (localReadingFrame!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "readingFrame", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReadingFrame), xmlWriter); } if (localAllele != null){ writeAttribute("", "allele", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele), xmlWriter); } if (localResidue != null){ writeAttribute("", "residue", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResidue), xmlWriter); } if (localAaPosition!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "aaPosition", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAaPosition), xmlWriter); } if (localMrnaPosition!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "mrnaPosition", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaPosition), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","geneId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGeneId)); attribList.add( new javax.xml.namespace.QName("","symbol")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSymbol)); attribList.add( new javax.xml.namespace.QName("","mrnaAcc")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaAcc)); attribList.add( new javax.xml.namespace.QName("","mrnaVer")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaVer)); attribList.add( new javax.xml.namespace.QName("","protAcc")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtAcc)); attribList.add( new javax.xml.namespace.QName("","protVer")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProtVer)); attribList.add( new javax.xml.namespace.QName("","fxnClass")); attribList.add(localFxnClass.toString()); attribList.add( new javax.xml.namespace.QName("","readingFrame")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReadingFrame)); attribList.add( new javax.xml.namespace.QName("","allele")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele)); attribList.add( new javax.xml.namespace.QName("","residue")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localResidue)); attribList.add( new javax.xml.namespace.QName("","aaPosition")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAaPosition)); attribList.add( new javax.xml.namespace.QName("","mrnaPosition")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMrnaPosition)); 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 FxnSet_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ FxnSet_type0 object = new FxnSet_type0(); 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 (!"FxnSet_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (FxnSet_type0)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(); // handle attribute "geneId" java.lang.String tempAttribGeneId = reader.getAttributeValue(null,"geneId"); if (tempAttribGeneId!=null){ java.lang.String content = tempAttribGeneId; object.setGeneId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribGeneId)); } else { object.setGeneId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("geneId"); // handle attribute "symbol" java.lang.String tempAttribSymbol = reader.getAttributeValue(null,"symbol"); if (tempAttribSymbol!=null){ java.lang.String content = tempAttribSymbol; object.setSymbol( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSymbol)); } else { } handledAttributes.add("symbol"); // handle attribute "mrnaAcc" java.lang.String tempAttribMrnaAcc = reader.getAttributeValue(null,"mrnaAcc"); if (tempAttribMrnaAcc!=null){ java.lang.String content = tempAttribMrnaAcc; object.setMrnaAcc( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribMrnaAcc)); } else { } handledAttributes.add("mrnaAcc"); // handle attribute "mrnaVer" java.lang.String tempAttribMrnaVer = reader.getAttributeValue(null,"mrnaVer"); if (tempAttribMrnaVer!=null){ java.lang.String content = tempAttribMrnaVer; object.setMrnaVer( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribMrnaVer)); } else { object.setMrnaVer(java.lang.Integer.MIN_VALUE); } handledAttributes.add("mrnaVer"); // handle attribute "protAcc" java.lang.String tempAttribProtAcc = reader.getAttributeValue(null,"protAcc"); if (tempAttribProtAcc!=null){ java.lang.String content = tempAttribProtAcc; object.setProtAcc( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribProtAcc)); } else { } handledAttributes.add("protAcc"); // handle attribute "protVer" java.lang.String tempAttribProtVer = reader.getAttributeValue(null,"protVer"); if (tempAttribProtVer!=null){ java.lang.String content = tempAttribProtVer; object.setProtVer( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribProtVer)); } else { object.setProtVer(java.lang.Integer.MIN_VALUE); } handledAttributes.add("protVer"); // handle attribute "fxnClass" java.lang.String tempAttribFxnClass = reader.getAttributeValue(null,"fxnClass"); if (tempAttribFxnClass!=null){ java.lang.String content = tempAttribFxnClass; object.setFxnClass( FxnClass_type0.Factory.fromString(reader,tempAttribFxnClass)); } else { } handledAttributes.add("fxnClass"); // handle attribute "readingFrame" java.lang.String tempAttribReadingFrame = reader.getAttributeValue(null,"readingFrame"); if (tempAttribReadingFrame!=null){ java.lang.String content = tempAttribReadingFrame; object.setReadingFrame( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribReadingFrame)); } else { object.setReadingFrame(java.lang.Integer.MIN_VALUE); } handledAttributes.add("readingFrame"); // handle attribute "allele" java.lang.String tempAttribAllele = reader.getAttributeValue(null,"allele"); if (tempAttribAllele!=null){ java.lang.String content = tempAttribAllele; object.setAllele( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAllele)); } else { } handledAttributes.add("allele"); // handle attribute "residue" java.lang.String tempAttribResidue = reader.getAttributeValue(null,"residue"); if (tempAttribResidue!=null){ java.lang.String content = tempAttribResidue; object.setResidue( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribResidue)); } else { } handledAttributes.add("residue"); // handle attribute "aaPosition" java.lang.String tempAttribAaPosition = reader.getAttributeValue(null,"aaPosition"); if (tempAttribAaPosition!=null){ java.lang.String content = tempAttribAaPosition; object.setAaPosition( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribAaPosition)); } else { object.setAaPosition(java.lang.Integer.MIN_VALUE); } handledAttributes.add("aaPosition"); // handle attribute "mrnaPosition" java.lang.String tempAttribMrnaPosition = reader.getAttributeValue(null,"mrnaPosition"); if (tempAttribMrnaPosition!=null){ java.lang.String content = tempAttribMrnaPosition; object.setMrnaPosition( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribMrnaPosition)); } else { object.setMrnaPosition(java.lang.Integer.MIN_VALUE); } handledAttributes.add("mrnaPosition"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Source_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "source_type0", "ns1"); /** * field for Source_type0 */ protected java.lang.String localSource_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Source_type0(java.lang.String value, boolean isRegisterValue) { localSource_type0 = value; if (isRegisterValue){ _table_.put(localSource_type0, this); } } public static final java.lang.String _submitter = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("submitter"); public static final java.lang.String _blastmb = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("blastmb"); public static final java.lang.String _xm = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("xm"); public static final java.lang.String _remap = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("remap"); public static final java.lang.String _hgvs = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("hgvs"); public static final Source_type0 submitter = new Source_type0(_submitter,true); public static final Source_type0 blastmb = new Source_type0(_blastmb,true); public static final Source_type0 xm = new Source_type0(_xm,true); public static final Source_type0 remap = new Source_type0(_remap,true); public static final Source_type0 hgvs = new Source_type0(_hgvs,true); public java.lang.String getValue() { return localSource_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localSource_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":source_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "source_type0", xmlWriter); } } if (localSource_type0==null){ throw new org.apache.axis2.databinding.ADBException("source_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localSource_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSource_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Source_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Source_type0 enumeration = (Source_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Source_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Source_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Source_type0.Factory.fromString(content,namespaceUri); } else { return Source_type0.Factory.fromString(content,""); } } /** * 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 Source_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Source_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"source_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Source_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Source_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class FxnClass_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "fxnClass_type0", "ns1"); /** * field for FxnClass_type0 */ protected java.lang.String localFxnClass_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected FxnClass_type0(java.lang.String value, boolean isRegisterValue) { localFxnClass_type0 = value; if (isRegisterValue){ _table_.put(localFxnClass_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("locus-region"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("coding-unknown"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("synonymous-codon"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("non-synonymous-codon"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mrna-utr"); public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("intron-variant"); public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("splice-region-variant"); public static final java.lang.String _value8 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("reference"); public static final java.lang.String _value9 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("coding-exception"); public static final java.lang.String _value10 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("coding-sequence-variant"); public static final java.lang.String _value11 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("nc-transcript-variant"); public static final java.lang.String _value12 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("downstream-variant-500B"); public static final java.lang.String _value13 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("upstream-variant-2KB"); public static final java.lang.String _value14 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("nonsense"); public static final java.lang.String _value15 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("missense"); public static final java.lang.String _value16 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("frameshift-variant"); public static final java.lang.String _value17 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("utr-variant-3-prime"); public static final java.lang.String _value18 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("utr-variant-5-prime"); public static final java.lang.String _value19 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("splice-acceptor-variant"); public static final java.lang.String _value20 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("splice-donor-variant"); public static final java.lang.String _value21 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cds-indel"); public static final java.lang.String _value22 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("stop-gained"); public static final java.lang.String _value23 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("stop-lost"); public static final java.lang.String _value24 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("complex-change-in-transcript"); public static final java.lang.String _value25 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("incomplete-terminal-codon-variant"); public static final java.lang.String _value26 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("nmd-transcript-variant"); public static final java.lang.String _value27 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mature-miRNA-variant"); public static final java.lang.String _value28 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("upstream-variant-5KB"); public static final java.lang.String _value29 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("downstream-variant-5KB"); public static final FxnClass_type0 value1 = new FxnClass_type0(_value1,true); public static final FxnClass_type0 value2 = new FxnClass_type0(_value2,true); public static final FxnClass_type0 value3 = new FxnClass_type0(_value3,true); public static final FxnClass_type0 value4 = new FxnClass_type0(_value4,true); public static final FxnClass_type0 value5 = new FxnClass_type0(_value5,true); public static final FxnClass_type0 value6 = new FxnClass_type0(_value6,true); public static final FxnClass_type0 value7 = new FxnClass_type0(_value7,true); public static final FxnClass_type0 value8 = new FxnClass_type0(_value8,true); public static final FxnClass_type0 value9 = new FxnClass_type0(_value9,true); public static final FxnClass_type0 value10 = new FxnClass_type0(_value10,true); public static final FxnClass_type0 value11 = new FxnClass_type0(_value11,true); public static final FxnClass_type0 value12 = new FxnClass_type0(_value12,true); public static final FxnClass_type0 value13 = new FxnClass_type0(_value13,true); public static final FxnClass_type0 value14 = new FxnClass_type0(_value14,true); public static final FxnClass_type0 value15 = new FxnClass_type0(_value15,true); public static final FxnClass_type0 value16 = new FxnClass_type0(_value16,true); public static final FxnClass_type0 value17 = new FxnClass_type0(_value17,true); public static final FxnClass_type0 value18 = new FxnClass_type0(_value18,true); public static final FxnClass_type0 value19 = new FxnClass_type0(_value19,true); public static final FxnClass_type0 value20 = new FxnClass_type0(_value20,true); public static final FxnClass_type0 value21 = new FxnClass_type0(_value21,true); public static final FxnClass_type0 value22 = new FxnClass_type0(_value22,true); public static final FxnClass_type0 value23 = new FxnClass_type0(_value23,true); public static final FxnClass_type0 value24 = new FxnClass_type0(_value24,true); public static final FxnClass_type0 value25 = new FxnClass_type0(_value25,true); public static final FxnClass_type0 value26 = new FxnClass_type0(_value26,true); public static final FxnClass_type0 value27 = new FxnClass_type0(_value27,true); public static final FxnClass_type0 value28 = new FxnClass_type0(_value28,true); public static final FxnClass_type0 value29 = new FxnClass_type0(_value29,true); public java.lang.String getValue() { return localFxnClass_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localFxnClass_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":fxnClass_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "fxnClass_type0", xmlWriter); } } if (localFxnClass_type0==null){ throw new org.apache.axis2.databinding.ADBException("fxnClass_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localFxnClass_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFxnClass_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static FxnClass_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { FxnClass_type0 enumeration = (FxnClass_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static FxnClass_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static FxnClass_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return FxnClass_type0.Factory.fromString(content,namespaceUri); } else { return FxnClass_type0.Factory.fromString(content,""); } } /** * 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 FxnClass_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ FxnClass_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"fxnClass_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = FxnClass_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = FxnClass_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class BatchType_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "batchType_type0", "ns1"); /** * field for BatchType_type0 */ protected java.lang.String localBatchType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected BatchType_type0(java.lang.String value, boolean isRegisterValue) { localBatchType_type0 = value; if (isRegisterValue){ _table_.put(localBatchType_type0, this); } } public static final java.lang.String _snpassay = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("snpassay"); public static final java.lang.String _validation = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("validation"); public static final java.lang.String _doublehit = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("doublehit"); public static final BatchType_type0 snpassay = new BatchType_type0(_snpassay,true); public static final BatchType_type0 validation = new BatchType_type0(_validation,true); public static final BatchType_type0 doublehit = new BatchType_type0(_doublehit,true); public java.lang.String getValue() { return localBatchType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localBatchType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":batchType_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "batchType_type0", xmlWriter); } } if (localBatchType_type0==null){ throw new org.apache.axis2.databinding.ADBException("batchType_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localBatchType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatchType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static BatchType_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { BatchType_type0 enumeration = (BatchType_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static BatchType_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static BatchType_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return BatchType_type0.Factory.fromString(content,namespaceUri); } else { return BatchType_type0.Factory.fromString(content,""); } } /** * 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 BatchType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ BatchType_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"batchType_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = BatchType_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = BatchType_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Query_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Query_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Date * This was an Attribute! */ protected java.lang.String localDate ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getDate(){ return localDate; } /** * Auto generated setter method * @param param Date */ public void setDate(java.lang.String param){ this.localDate=param; } /** * field for String * This was an Attribute! */ protected java.lang.String localString ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getString(){ return localString; } /** * Auto generated setter method * @param param String */ public void setString(java.lang.String param){ this.localString=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Query_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Query_type0", xmlWriter); } } if (localDate != null){ writeAttribute("", "date", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate), xmlWriter); } if (localString != null){ writeAttribute("", "string", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localString), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","date")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate)); attribList.add( new javax.xml.namespace.QName("","string")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localString)); 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 Query_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Query_type0 object = new Query_type0(); 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 (!"Query_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Query_type0)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(); // handle attribute "date" java.lang.String tempAttribDate = reader.getAttributeValue(null,"date"); if (tempAttribDate!=null){ java.lang.String content = tempAttribDate; object.setDate( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribDate)); } else { } handledAttributes.add("date"); // handle attribute "string" java.lang.String tempAttribString = reader.getAttributeValue(null,"string"); if (tempAttribString!=null){ java.lang.String content = tempAttribString; object.setString( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribString)); } else { } handledAttributes.add("string"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class BioSource_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = BioSource_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Genome * This was an Array! */ protected java.lang.String[] localGenome ; /* 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 localGenomeTracker = false ; public boolean isGenomeSpecified(){ return localGenomeTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getGenome(){ return localGenome; } /** * validate the array for Genome */ protected void validateGenome(java.lang.String[] param){ } /** * Auto generated setter method * @param param Genome */ public void setGenome(java.lang.String[] param){ validateGenome(param); localGenomeTracker = param != null; this.localGenome=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addGenome(java.lang.String param){ if (localGenome == null){ localGenome = new java.lang.String[]{}; } //update the setting tracker localGenomeTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localGenome); list.add(param); this.localGenome = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * field for Origin * This was an Array! */ protected java.lang.String[] localOrigin ; /* 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 localOriginTracker = false ; public boolean isOriginSpecified(){ return localOriginTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getOrigin(){ return localOrigin; } /** * validate the array for Origin */ protected void validateOrigin(java.lang.String[] param){ } /** * Auto generated setter method * @param param Origin */ public void setOrigin(java.lang.String[] param){ validateOrigin(param); localOriginTracker = param != null; this.localOrigin=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addOrigin(java.lang.String param){ if (localOrigin == null){ localOrigin = new java.lang.String[]{}; } //update the setting tracker localOriginTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localOrigin); list.add(param); this.localOrigin = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * * @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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":BioSource_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "BioSource_type0", xmlWriter); } } if (localGenomeTracker){ if (localGenome!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localGenome.length;i++){ if (localGenome[i] != null){ writeStartElement(null, namespace, "Genome", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenome[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Genome cannot be null!!"); } } if (localOriginTracker){ if (localOrigin!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localOrigin.length;i++){ if (localOrigin[i] != null){ writeStartElement(null, namespace, "Origin", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrigin[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Origin cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localGenomeTracker){ if (localGenome!=null){ for (int i = 0;i < localGenome.length;i++){ if (localGenome[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Genome")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenome[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("Genome cannot be null!!"); } } if (localOriginTracker){ if (localOrigin!=null){ for (int i = 0;i < localOrigin.length;i++){ if (localOrigin[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Origin")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrigin[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("Origin cannot be null!!"); } } 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 BioSource_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ BioSource_type0 object = new BioSource_type0(); 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 (!"BioSource_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (BioSource_type0)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 list1 = new java.util.ArrayList(); java.util.ArrayList list2 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Genome").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Genome").equals(reader.getName())){ list1.add(reader.getElementText()); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setGenome((java.lang.String[]) list1.toArray(new java.lang.String[list1.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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Origin").equals(reader.getName())){ // Process the array and step past its final element's end. list2.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone2 = false; while(!loopDone2){ // 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 loopDone2 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Origin").equals(reader.getName())){ list2.add(reader.getElementText()); }else{ loopDone2 = true; } } } // call the converter utility to convert and set the array object.setOrigin((java.lang.String[]) list2.toArray(new java.lang.String[list2.size()])); } // 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 } public static class PrimarySequence implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "PrimarySequence", "ns1"); /** * field for PrimarySequence */ protected PrimarySequence_type0 localPrimarySequence ; /** * Auto generated getter method * @return PrimarySequence_type0 */ public PrimarySequence_type0 getPrimarySequence(){ return localPrimarySequence; } /** * Auto generated setter method * @param param PrimarySequence */ public void setPrimarySequence(PrimarySequence_type0 param){ this.localPrimarySequence=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localPrimarySequence==null){ throw new org.apache.axis2.databinding.ADBException("PrimarySequence cannot be null!"); } localPrimarySequence.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localPrimarySequence.getPullParser(MY_QNAME); } /** * 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 PrimarySequence parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ PrimarySequence object = new PrimarySequence(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","PrimarySequence").equals(reader.getName())){ object.setPrimarySequence(PrimarySequence_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Sequence_type1 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Sequence_type1 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Seq5 */ protected java.lang.String localSeq5 ; /* 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 localSeq5Tracker = false ; public boolean isSeq5Specified(){ return localSeq5Tracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSeq5(){ return localSeq5; } /** * Auto generated setter method * @param param Seq5 */ public void setSeq5(java.lang.String param){ localSeq5Tracker = param != null; this.localSeq5=param; } /** * field for Observed */ protected java.lang.String localObserved ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getObserved(){ return localObserved; } /** * Auto generated setter method * @param param Observed */ public void setObserved(java.lang.String param){ this.localObserved=param; } /** * field for Seq3 */ protected java.lang.String localSeq3 ; /* 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 localSeq3Tracker = false ; public boolean isSeq3Specified(){ return localSeq3Tracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSeq3(){ return localSeq3; } /** * Auto generated setter method * @param param Seq3 */ public void setSeq3(java.lang.String param){ localSeq3Tracker = param != null; this.localSeq3=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Sequence_type1", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Sequence_type1", xmlWriter); } } if (localSeq5Tracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Seq5", xmlWriter); if (localSeq5==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Seq5 cannot be null!!"); }else{ xmlWriter.writeCharacters(localSeq5); } xmlWriter.writeEndElement(); } namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Observed", xmlWriter); if (localObserved==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Observed cannot be null!!"); }else{ xmlWriter.writeCharacters(localObserved); } xmlWriter.writeEndElement(); if (localSeq3Tracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Seq3", xmlWriter); if (localSeq3==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Seq3 cannot be null!!"); }else{ xmlWriter.writeCharacters(localSeq3); } xmlWriter.writeEndElement(); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localSeq5Tracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Seq5")); if (localSeq5 != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeq5)); } else { throw new org.apache.axis2.databinding.ADBException("Seq5 cannot be null!!"); } } elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Observed")); if (localObserved != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localObserved)); } else { throw new org.apache.axis2.databinding.ADBException("Observed cannot be null!!"); } if (localSeq3Tracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Seq3")); if (localSeq3 != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeq3)); } else { throw new org.apache.axis2.databinding.ADBException("Seq3 cannot be null!!"); } } 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 Sequence_type1 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Sequence_type1 object = new Sequence_type1(); 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 (!"Sequence_type1".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Sequence_type1)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(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Seq5").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: "+"Seq5" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setSeq5( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Observed").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: "+"Observed" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setObserved( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Seq3").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: "+"Seq3" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setSeq3( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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 } public static class Sequence_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Sequence_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Seq5 */ protected java.lang.String localSeq5 ; /* 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 localSeq5Tracker = false ; public boolean isSeq5Specified(){ return localSeq5Tracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSeq5(){ return localSeq5; } /** * Auto generated setter method * @param param Seq5 */ public void setSeq5(java.lang.String param){ localSeq5Tracker = param != null; this.localSeq5=param; } /** * field for Observed */ protected java.lang.String localObserved ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getObserved(){ return localObserved; } /** * Auto generated setter method * @param param Observed */ public void setObserved(java.lang.String param){ this.localObserved=param; } /** * field for Seq3 */ protected java.lang.String localSeq3 ; /* 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 localSeq3Tracker = false ; public boolean isSeq3Specified(){ return localSeq3Tracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSeq3(){ return localSeq3; } /** * Auto generated setter method * @param param Seq3 */ public void setSeq3(java.lang.String param){ localSeq3Tracker = param != null; this.localSeq3=param; } /** * field for ExemplarSs * This was an Attribute! */ protected int localExemplarSs ; /** * Auto generated getter method * @return int */ public int getExemplarSs(){ return localExemplarSs; } /** * Auto generated setter method * @param param ExemplarSs */ public void setExemplarSs(int param){ this.localExemplarSs=param; } /** * field for AncestralAllele * This was an Attribute! */ protected java.lang.String localAncestralAllele ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAncestralAllele(){ return localAncestralAllele; } /** * Auto generated setter method * @param param AncestralAllele */ public void setAncestralAllele(java.lang.String param){ this.localAncestralAllele=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Sequence_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Sequence_type0", xmlWriter); } } if (localExemplarSs!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "exemplarSs", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localExemplarSs), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localExemplarSs is null"); } if (localAncestralAllele != null){ writeAttribute("", "ancestralAllele", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAncestralAllele), xmlWriter); } if (localSeq5Tracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Seq5", xmlWriter); if (localSeq5==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Seq5 cannot be null!!"); }else{ xmlWriter.writeCharacters(localSeq5); } xmlWriter.writeEndElement(); } namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Observed", xmlWriter); if (localObserved==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Observed cannot be null!!"); }else{ xmlWriter.writeCharacters(localObserved); } xmlWriter.writeEndElement(); if (localSeq3Tracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Seq3", xmlWriter); if (localSeq3==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Seq3 cannot be null!!"); }else{ xmlWriter.writeCharacters(localSeq3); } xmlWriter.writeEndElement(); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localSeq5Tracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Seq5")); if (localSeq5 != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeq5)); } else { throw new org.apache.axis2.databinding.ADBException("Seq5 cannot be null!!"); } } elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Observed")); if (localObserved != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localObserved)); } else { throw new org.apache.axis2.databinding.ADBException("Observed cannot be null!!"); } if (localSeq3Tracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Seq3")); if (localSeq3 != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSeq3)); } else { throw new org.apache.axis2.databinding.ADBException("Seq3 cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","exemplarSs")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localExemplarSs)); attribList.add( new javax.xml.namespace.QName("","ancestralAllele")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAncestralAllele)); 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 Sequence_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Sequence_type0 object = new Sequence_type0(); 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 (!"Sequence_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Sequence_type0)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(); // handle attribute "exemplarSs" java.lang.String tempAttribExemplarSs = reader.getAttributeValue(null,"exemplarSs"); if (tempAttribExemplarSs!=null){ java.lang.String content = tempAttribExemplarSs; object.setExemplarSs( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribExemplarSs)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute exemplarSs is missing"); } handledAttributes.add("exemplarSs"); // handle attribute "ancestralAllele" java.lang.String tempAttribAncestralAllele = reader.getAttributeValue(null,"ancestralAllele"); if (tempAttribAncestralAllele!=null){ java.lang.String content = tempAttribAncestralAllele; object.setAncestralAllele( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAncestralAllele)); } else { } handledAttributes.add("ancestralAllele"); reader.next(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Seq5").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: "+"Seq5" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setSeq5( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Observed").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: "+"Observed" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setObserved( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Seq3").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: "+"Seq3" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setSeq3( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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 } public static class Validation_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Validation_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for OtherPopBatchId * This was an Array! */ protected int[] localOtherPopBatchId ; /* 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 localOtherPopBatchIdTracker = false ; public boolean isOtherPopBatchIdSpecified(){ return localOtherPopBatchIdTracker; } /** * Auto generated getter method * @return int[] */ public int[] getOtherPopBatchId(){ return localOtherPopBatchId; } /** * validate the array for OtherPopBatchId */ protected void validateOtherPopBatchId(int[] param){ } /** * Auto generated setter method * @param param OtherPopBatchId */ public void setOtherPopBatchId(int[] param){ validateOtherPopBatchId(param); localOtherPopBatchIdTracker = param != null; this.localOtherPopBatchId=param; } /** * field for TwoHit2AlleleBatchId * This was an Array! */ protected int[] localTwoHit2AlleleBatchId ; /* 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 localTwoHit2AlleleBatchIdTracker = false ; public boolean isTwoHit2AlleleBatchIdSpecified(){ return localTwoHit2AlleleBatchIdTracker; } /** * Auto generated getter method * @return int[] */ public int[] getTwoHit2AlleleBatchId(){ return localTwoHit2AlleleBatchId; } /** * validate the array for TwoHit2AlleleBatchId */ protected void validateTwoHit2AlleleBatchId(int[] param){ } /** * Auto generated setter method * @param param TwoHit2AlleleBatchId */ public void setTwoHit2AlleleBatchId(int[] param){ validateTwoHit2AlleleBatchId(param); localTwoHit2AlleleBatchIdTracker = param != null; this.localTwoHit2AlleleBatchId=param; } /** * field for FrequencyClass * This was an Array! */ protected int[] localFrequencyClass ; /* 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 localFrequencyClassTracker = false ; public boolean isFrequencyClassSpecified(){ return localFrequencyClassTracker; } /** * Auto generated getter method * @return int[] */ public int[] getFrequencyClass(){ return localFrequencyClass; } /** * validate the array for FrequencyClass */ protected void validateFrequencyClass(int[] param){ } /** * Auto generated setter method * @param param FrequencyClass */ public void setFrequencyClass(int[] param){ validateFrequencyClass(param); localFrequencyClassTracker = param != null; this.localFrequencyClass=param; } /** * field for HapMapPhase * This was an Array! */ protected int[] localHapMapPhase ; /* 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 localHapMapPhaseTracker = false ; public boolean isHapMapPhaseSpecified(){ return localHapMapPhaseTracker; } /** * Auto generated getter method * @return int[] */ public int[] getHapMapPhase(){ return localHapMapPhase; } /** * validate the array for HapMapPhase */ protected void validateHapMapPhase(int[] param){ } /** * Auto generated setter method * @param param HapMapPhase */ public void setHapMapPhase(int[] param){ validateHapMapPhase(param); localHapMapPhaseTracker = param != null; this.localHapMapPhase=param; } /** * field for TGPPhase * This was an Array! */ protected int[] localTGPPhase ; /* 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 localTGPPhaseTracker = false ; public boolean isTGPPhaseSpecified(){ return localTGPPhaseTracker; } /** * Auto generated getter method * @return int[] */ public int[] getTGPPhase(){ return localTGPPhase; } /** * validate the array for TGPPhase */ protected void validateTGPPhase(int[] param){ } /** * Auto generated setter method * @param param TGPPhase */ public void setTGPPhase(int[] param){ validateTGPPhase(param); localTGPPhaseTracker = param != null; this.localTGPPhase=param; } /** * field for SuspectEvidence * This was an Array! */ protected java.lang.String[] localSuspectEvidence ; /* 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 localSuspectEvidenceTracker = false ; public boolean isSuspectEvidenceSpecified(){ return localSuspectEvidenceTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getSuspectEvidence(){ return localSuspectEvidence; } /** * validate the array for SuspectEvidence */ protected void validateSuspectEvidence(java.lang.String[] param){ } /** * Auto generated setter method * @param param SuspectEvidence */ public void setSuspectEvidence(java.lang.String[] param){ validateSuspectEvidence(param); localSuspectEvidenceTracker = param != null; this.localSuspectEvidence=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addSuspectEvidence(java.lang.String param){ if (localSuspectEvidence == null){ localSuspectEvidence = new java.lang.String[]{}; } //update the setting tracker localSuspectEvidenceTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localSuspectEvidence); list.add(param); this.localSuspectEvidence = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * field for ByCluster * This was an Attribute! */ protected boolean localByCluster ; /** * Auto generated getter method * @return boolean */ public boolean getByCluster(){ return localByCluster; } /** * Auto generated setter method * @param param ByCluster */ public void setByCluster(boolean param){ this.localByCluster=param; } /** * field for ByFrequency * This was an Attribute! */ protected boolean localByFrequency ; /** * Auto generated getter method * @return boolean */ public boolean getByFrequency(){ return localByFrequency; } /** * Auto generated setter method * @param param ByFrequency */ public void setByFrequency(boolean param){ this.localByFrequency=param; } /** * field for ByOtherPop * This was an Attribute! */ protected boolean localByOtherPop ; /** * Auto generated getter method * @return boolean */ public boolean getByOtherPop(){ return localByOtherPop; } /** * Auto generated setter method * @param param ByOtherPop */ public void setByOtherPop(boolean param){ this.localByOtherPop=param; } /** * field for By2Hit2Allele * This was an Attribute! */ protected boolean localBy2Hit2Allele ; /** * Auto generated getter method * @return boolean */ public boolean getBy2Hit2Allele(){ return localBy2Hit2Allele; } /** * Auto generated setter method * @param param By2Hit2Allele */ public void setBy2Hit2Allele(boolean param){ this.localBy2Hit2Allele=param; } /** * field for ByHapMap * This was an Attribute! */ protected boolean localByHapMap ; /** * Auto generated getter method * @return boolean */ public boolean getByHapMap(){ return localByHapMap; } /** * Auto generated setter method * @param param ByHapMap */ public void setByHapMap(boolean param){ this.localByHapMap=param; } /** * field for By1000G * This was an Attribute! */ protected boolean localBy1000G ; /** * Auto generated getter method * @return boolean */ public boolean getBy1000G(){ return localBy1000G; } /** * Auto generated setter method * @param param By1000G */ public void setBy1000G(boolean param){ this.localBy1000G=param; } /** * field for Suspect * This was an Attribute! */ protected boolean localSuspect ; /** * Auto generated getter method * @return boolean */ public boolean getSuspect(){ return localSuspect; } /** * Auto generated setter method * @param param Suspect */ public void setSuspect(boolean param){ this.localSuspect=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Validation_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Validation_type0", xmlWriter); } } if (true) { writeAttribute("", "byCluster", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByCluster), xmlWriter); } if (true) { writeAttribute("", "byFrequency", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByFrequency), xmlWriter); } if (true) { writeAttribute("", "byOtherPop", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByOtherPop), xmlWriter); } if (true) { writeAttribute("", "by2Hit2Allele", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBy2Hit2Allele), xmlWriter); } if (true) { writeAttribute("", "byHapMap", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByHapMap), xmlWriter); } if (true) { writeAttribute("", "by1000G", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBy1000G), xmlWriter); } if (true) { writeAttribute("", "suspect", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSuspect), xmlWriter); } if (localOtherPopBatchIdTracker){ if (localOtherPopBatchId!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localOtherPopBatchId.length;i++){ if (localOtherPopBatchId[i]!=java.lang.Integer.MIN_VALUE) { writeStartElement(null, namespace, "otherPopBatchId", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOtherPopBatchId[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("otherPopBatchId cannot be null!!"); } } if (localTwoHit2AlleleBatchIdTracker){ if (localTwoHit2AlleleBatchId!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localTwoHit2AlleleBatchId.length;i++){ if (localTwoHit2AlleleBatchId[i]!=java.lang.Integer.MIN_VALUE) { writeStartElement(null, namespace, "twoHit2AlleleBatchId", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTwoHit2AlleleBatchId[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("twoHit2AlleleBatchId cannot be null!!"); } } if (localFrequencyClassTracker){ if (localFrequencyClass!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localFrequencyClass.length;i++){ if (localFrequencyClass[i]!=java.lang.Integer.MIN_VALUE) { writeStartElement(null, namespace, "FrequencyClass", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFrequencyClass[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("FrequencyClass cannot be null!!"); } } if (localHapMapPhaseTracker){ if (localHapMapPhase!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localHapMapPhase.length;i++){ if (localHapMapPhase[i]!=java.lang.Integer.MIN_VALUE) { writeStartElement(null, namespace, "HapMapPhase", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHapMapPhase[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("HapMapPhase cannot be null!!"); } } if (localTGPPhaseTracker){ if (localTGPPhase!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localTGPPhase.length;i++){ if (localTGPPhase[i]!=java.lang.Integer.MIN_VALUE) { writeStartElement(null, namespace, "TGPPhase", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTGPPhase[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("TGPPhase cannot be null!!"); } } if (localSuspectEvidenceTracker){ if (localSuspectEvidence!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localSuspectEvidence.length;i++){ if (localSuspectEvidence[i] != null){ writeStartElement(null, namespace, "SuspectEvidence", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSuspectEvidence[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("SuspectEvidence cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localOtherPopBatchIdTracker){ if (localOtherPopBatchId!=null){ for (int i = 0;i < localOtherPopBatchId.length;i++){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "otherPopBatchId")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOtherPopBatchId[i])); } } else { throw new org.apache.axis2.databinding.ADBException("otherPopBatchId cannot be null!!"); } } if (localTwoHit2AlleleBatchIdTracker){ if (localTwoHit2AlleleBatchId!=null){ for (int i = 0;i < localTwoHit2AlleleBatchId.length;i++){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "twoHit2AlleleBatchId")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTwoHit2AlleleBatchId[i])); } } else { throw new org.apache.axis2.databinding.ADBException("twoHit2AlleleBatchId cannot be null!!"); } } if (localFrequencyClassTracker){ if (localFrequencyClass!=null){ for (int i = 0;i < localFrequencyClass.length;i++){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "FrequencyClass")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFrequencyClass[i])); } } else { throw new org.apache.axis2.databinding.ADBException("FrequencyClass cannot be null!!"); } } if (localHapMapPhaseTracker){ if (localHapMapPhase!=null){ for (int i = 0;i < localHapMapPhase.length;i++){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "HapMapPhase")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHapMapPhase[i])); } } else { throw new org.apache.axis2.databinding.ADBException("HapMapPhase cannot be null!!"); } } if (localTGPPhaseTracker){ if (localTGPPhase!=null){ for (int i = 0;i < localTGPPhase.length;i++){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "TGPPhase")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTGPPhase[i])); } } else { throw new org.apache.axis2.databinding.ADBException("TGPPhase cannot be null!!"); } } if (localSuspectEvidenceTracker){ if (localSuspectEvidence!=null){ for (int i = 0;i < localSuspectEvidence.length;i++){ if (localSuspectEvidence[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "SuspectEvidence")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSuspectEvidence[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("SuspectEvidence cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","byCluster")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByCluster)); attribList.add( new javax.xml.namespace.QName("","byFrequency")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByFrequency)); attribList.add( new javax.xml.namespace.QName("","byOtherPop")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByOtherPop)); attribList.add( new javax.xml.namespace.QName("","by2Hit2Allele")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBy2Hit2Allele)); attribList.add( new javax.xml.namespace.QName("","byHapMap")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByHapMap)); attribList.add( new javax.xml.namespace.QName("","by1000G")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBy1000G)); attribList.add( new javax.xml.namespace.QName("","suspect")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSuspect)); 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 Validation_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Validation_type0 object = new Validation_type0(); 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 (!"Validation_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Validation_type0)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(); // handle attribute "byCluster" java.lang.String tempAttribByCluster = reader.getAttributeValue(null,"byCluster"); if (tempAttribByCluster!=null){ java.lang.String content = tempAttribByCluster; object.setByCluster( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribByCluster)); } else { } handledAttributes.add("byCluster"); // handle attribute "byFrequency" java.lang.String tempAttribByFrequency = reader.getAttributeValue(null,"byFrequency"); if (tempAttribByFrequency!=null){ java.lang.String content = tempAttribByFrequency; object.setByFrequency( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribByFrequency)); } else { } handledAttributes.add("byFrequency"); // handle attribute "byOtherPop" java.lang.String tempAttribByOtherPop = reader.getAttributeValue(null,"byOtherPop"); if (tempAttribByOtherPop!=null){ java.lang.String content = tempAttribByOtherPop; object.setByOtherPop( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribByOtherPop)); } else { } handledAttributes.add("byOtherPop"); // handle attribute "by2Hit2Allele" java.lang.String tempAttribBy2Hit2Allele = reader.getAttributeValue(null,"by2Hit2Allele"); if (tempAttribBy2Hit2Allele!=null){ java.lang.String content = tempAttribBy2Hit2Allele; object.setBy2Hit2Allele( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribBy2Hit2Allele)); } else { } handledAttributes.add("by2Hit2Allele"); // handle attribute "byHapMap" java.lang.String tempAttribByHapMap = reader.getAttributeValue(null,"byHapMap"); if (tempAttribByHapMap!=null){ java.lang.String content = tempAttribByHapMap; object.setByHapMap( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribByHapMap)); } else { } handledAttributes.add("byHapMap"); // handle attribute "by1000G" java.lang.String tempAttribBy1000G = reader.getAttributeValue(null,"by1000G"); if (tempAttribBy1000G!=null){ java.lang.String content = tempAttribBy1000G; object.setBy1000G( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribBy1000G)); } else { } handledAttributes.add("by1000G"); // handle attribute "suspect" java.lang.String tempAttribSuspect = reader.getAttributeValue(null,"suspect"); if (tempAttribSuspect!=null){ java.lang.String content = tempAttribSuspect; object.setSuspect( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribSuspect)); } else { } handledAttributes.add("suspect"); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); java.util.ArrayList list2 = new java.util.ArrayList(); java.util.ArrayList list3 = new java.util.ArrayList(); java.util.ArrayList list4 = new java.util.ArrayList(); java.util.ArrayList list5 = new java.util.ArrayList(); java.util.ArrayList list6 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","otherPopBatchId").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","otherPopBatchId").equals(reader.getName())){ list1.add(reader.getElementText()); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setOtherPopBatchId((int[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( int.class,list1)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","twoHit2AlleleBatchId").equals(reader.getName())){ // Process the array and step past its final element's end. list2.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone2 = false; while(!loopDone2){ // 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 loopDone2 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","twoHit2AlleleBatchId").equals(reader.getName())){ list2.add(reader.getElementText()); }else{ loopDone2 = true; } } } // call the converter utility to convert and set the array object.setTwoHit2AlleleBatchId((int[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( int.class,list2)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FrequencyClass").equals(reader.getName())){ // Process the array and step past its final element's end. list3.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone3 = false; while(!loopDone3){ // 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 loopDone3 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FrequencyClass").equals(reader.getName())){ list3.add(reader.getElementText()); }else{ loopDone3 = true; } } } // call the converter utility to convert and set the array object.setFrequencyClass((int[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( int.class,list3)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","HapMapPhase").equals(reader.getName())){ // Process the array and step past its final element's end. list4.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone4 = false; while(!loopDone4){ // 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 loopDone4 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","HapMapPhase").equals(reader.getName())){ list4.add(reader.getElementText()); }else{ loopDone4 = true; } } } // call the converter utility to convert and set the array object.setHapMapPhase((int[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( int.class,list4)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","TGPPhase").equals(reader.getName())){ // Process the array and step past its final element's end. list5.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone5 = false; while(!loopDone5){ // 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 loopDone5 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","TGPPhase").equals(reader.getName())){ list5.add(reader.getElementText()); }else{ loopDone5 = true; } } } // call the converter utility to convert and set the array object.setTGPPhase((int[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( int.class,list5)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SuspectEvidence").equals(reader.getName())){ // Process the array and step past its final element's end. 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SuspectEvidence").equals(reader.getName())){ list6.add(reader.getElementText()); }else{ loopDone6 = true; } } } // call the converter utility to convert and set the array object.setSuspectEvidence((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()) // 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 } public static class Assembly_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Assembly_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Component * This was an Array! */ protected Component_type0[] localComponent ; /* 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 localComponentTracker = false ; public boolean isComponentSpecified(){ return localComponentTracker; } /** * Auto generated getter method * @return Component_type0[] */ public Component_type0[] getComponent(){ return localComponent; } /** * validate the array for Component */ protected void validateComponent(Component_type0[] param){ } /** * Auto generated setter method * @param param Component */ public void setComponent(Component_type0[] param){ validateComponent(param); localComponentTracker = param != null; this.localComponent=param; } /** * Auto generated add method for the array for convenience * @param param Component_type0 */ public void addComponent(Component_type0 param){ if (localComponent == null){ localComponent = new Component_type0[]{}; } //update the setting tracker localComponentTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localComponent); list.add(param); this.localComponent = (Component_type0[])list.toArray( new Component_type0[list.size()]); } /** * field for SnpStat */ protected SnpStat_type0 localSnpStat ; /** * Auto generated getter method * @return SnpStat_type0 */ public SnpStat_type0 getSnpStat(){ return localSnpStat; } /** * Auto generated setter method * @param param SnpStat */ public void setSnpStat(SnpStat_type0 param){ this.localSnpStat=param; } /** * field for DbSnpBuild * This was an Attribute! */ protected int localDbSnpBuild ; /** * Auto generated getter method * @return int */ public int getDbSnpBuild(){ return localDbSnpBuild; } /** * Auto generated setter method * @param param DbSnpBuild */ public void setDbSnpBuild(int param){ this.localDbSnpBuild=param; } /** * field for GenomeBuild * This was an Attribute! */ protected java.lang.String localGenomeBuild ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGenomeBuild(){ return localGenomeBuild; } /** * Auto generated setter method * @param param GenomeBuild */ public void setGenomeBuild(java.lang.String param){ this.localGenomeBuild=param; } /** * field for GroupLabel * This was an Attribute! */ protected java.lang.String localGroupLabel ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGroupLabel(){ return localGroupLabel; } /** * Auto generated setter method * @param param GroupLabel */ public void setGroupLabel(java.lang.String param){ this.localGroupLabel=param; } /** * field for AssemblySource * This was an Attribute! */ protected java.lang.String localAssemblySource ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAssemblySource(){ return localAssemblySource; } /** * Auto generated setter method * @param param AssemblySource */ public void setAssemblySource(java.lang.String param){ this.localAssemblySource=param; } /** * field for Current * This was an Attribute! */ protected boolean localCurrent ; /** * Auto generated getter method * @return boolean */ public boolean getCurrent(){ return localCurrent; } /** * Auto generated setter method * @param param Current */ public void setCurrent(boolean param){ this.localCurrent=param; } /** * field for Reference * This was an Attribute! */ protected boolean localReference ; /** * Auto generated getter method * @return boolean */ public boolean getReference(){ return localReference; } /** * Auto generated setter method * @param param Reference */ public void setReference(boolean param){ this.localReference=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Assembly_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Assembly_type0", xmlWriter); } } if (localDbSnpBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "dbSnpBuild", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localDbSnpBuild is null"); } if (localGenomeBuild != null){ writeAttribute("", "genomeBuild", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenomeBuild), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localGenomeBuild is null"); } if (localGroupLabel != null){ writeAttribute("", "groupLabel", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGroupLabel), xmlWriter); } if (localAssemblySource != null){ writeAttribute("", "assemblySource", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAssemblySource), xmlWriter); } if (true) { writeAttribute("", "current", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCurrent), xmlWriter); } if (true) { writeAttribute("", "reference", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReference), xmlWriter); } if (localComponentTracker){ if (localComponent!=null){ for (int i = 0;i < localComponent.length;i++){ if (localComponent[i] != null){ localComponent[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Component"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Component cannot be null!!"); } } if (localSnpStat==null){ throw new org.apache.axis2.databinding.ADBException("SnpStat cannot be null!!"); } localSnpStat.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SnpStat"), xmlWriter); xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localComponentTracker){ if (localComponent!=null) { for (int i = 0;i < localComponent.length;i++){ if (localComponent[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Component")); elementList.add(localComponent[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Component cannot be null!!"); } } elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "SnpStat")); if (localSnpStat==null){ throw new org.apache.axis2.databinding.ADBException("SnpStat cannot be null!!"); } elementList.add(localSnpStat); attribList.add( new javax.xml.namespace.QName("","dbSnpBuild")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild)); attribList.add( new javax.xml.namespace.QName("","genomeBuild")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenomeBuild)); attribList.add( new javax.xml.namespace.QName("","groupLabel")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGroupLabel)); attribList.add( new javax.xml.namespace.QName("","assemblySource")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAssemblySource)); attribList.add( new javax.xml.namespace.QName("","current")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCurrent)); attribList.add( new javax.xml.namespace.QName("","reference")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReference)); 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 Assembly_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Assembly_type0 object = new Assembly_type0(); 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 (!"Assembly_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Assembly_type0)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(); // handle attribute "dbSnpBuild" java.lang.String tempAttribDbSnpBuild = reader.getAttributeValue(null,"dbSnpBuild"); if (tempAttribDbSnpBuild!=null){ java.lang.String content = tempAttribDbSnpBuild; object.setDbSnpBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribDbSnpBuild)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute dbSnpBuild is missing"); } handledAttributes.add("dbSnpBuild"); // handle attribute "genomeBuild" java.lang.String tempAttribGenomeBuild = reader.getAttributeValue(null,"genomeBuild"); if (tempAttribGenomeBuild!=null){ java.lang.String content = tempAttribGenomeBuild; object.setGenomeBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGenomeBuild)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute genomeBuild is missing"); } handledAttributes.add("genomeBuild"); // handle attribute "groupLabel" java.lang.String tempAttribGroupLabel = reader.getAttributeValue(null,"groupLabel"); if (tempAttribGroupLabel!=null){ java.lang.String content = tempAttribGroupLabel; object.setGroupLabel( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGroupLabel)); } else { } handledAttributes.add("groupLabel"); // handle attribute "assemblySource" java.lang.String tempAttribAssemblySource = reader.getAttributeValue(null,"assemblySource"); if (tempAttribAssemblySource!=null){ java.lang.String content = tempAttribAssemblySource; object.setAssemblySource( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAssemblySource)); } else { } handledAttributes.add("assemblySource"); // handle attribute "current" java.lang.String tempAttribCurrent = reader.getAttributeValue(null,"current"); if (tempAttribCurrent!=null){ java.lang.String content = tempAttribCurrent; object.setCurrent( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribCurrent)); } else { } handledAttributes.add("current"); // handle attribute "reference" java.lang.String tempAttribReference = reader.getAttributeValue(null,"reference"); if (tempAttribReference!=null){ java.lang.String content = tempAttribReference; object.setReference( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribReference)); } else { } handledAttributes.add("reference"); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Component").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(Component_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // We should be at the end element, but make sure 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Component").equals(reader.getName())){ list1.add(Component_type0.Factory.parse(reader)); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setComponent((Component_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Component_type0.class, list1)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SnpStat").equals(reader.getName())){ object.setSnpStat(SnpStat_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } 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 } public static class RsStruct implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "RsStruct", "ns1"); /** * field for RsStruct */ protected RsStruct_type0 localRsStruct ; /** * Auto generated getter method * @return RsStruct_type0 */ public RsStruct_type0 getRsStruct(){ return localRsStruct; } /** * Auto generated setter method * @param param RsStruct */ public void setRsStruct(RsStruct_type0 param){ this.localRsStruct=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localRsStruct==null){ throw new org.apache.axis2.databinding.ADBException("RsStruct cannot be null!"); } localRsStruct.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localRsStruct.getPullParser(MY_QNAME); } /** * 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 RsStruct parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ RsStruct object = new RsStruct(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsStruct").equals(reader.getName())){ object.setRsStruct(RsStruct_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Rs_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Rs_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Het */ protected Het_type0 localHet ; /* 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 localHetTracker = false ; public boolean isHetSpecified(){ return localHetTracker; } /** * Auto generated getter method * @return Het_type0 */ public Het_type0 getHet(){ return localHet; } /** * Auto generated setter method * @param param Het */ public void setHet(Het_type0 param){ localHetTracker = param != null; this.localHet=param; } /** * field for Validation */ protected Validation_type0 localValidation ; /** * Auto generated getter method * @return Validation_type0 */ public Validation_type0 getValidation(){ return localValidation; } /** * Auto generated setter method * @param param Validation */ public void setValidation(Validation_type0 param){ this.localValidation=param; } /** * field for Create */ protected Create_type0 localCreate ; /** * Auto generated getter method * @return Create_type0 */ public Create_type0 getCreate(){ return localCreate; } /** * Auto generated setter method * @param param Create */ public void setCreate(Create_type0 param){ this.localCreate=param; } /** * field for Update */ protected Update_type0 localUpdate ; /* 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 localUpdateTracker = false ; public boolean isUpdateSpecified(){ return localUpdateTracker; } /** * Auto generated getter method * @return Update_type0 */ public Update_type0 getUpdate(){ return localUpdate; } /** * Auto generated setter method * @param param Update */ public void setUpdate(Update_type0 param){ localUpdateTracker = param != null; this.localUpdate=param; } /** * field for Sequence */ protected Sequence_type0 localSequence ; /** * Auto generated getter method * @return Sequence_type0 */ public Sequence_type0 getSequence(){ return localSequence; } /** * Auto generated setter method * @param param Sequence */ public void setSequence(Sequence_type0 param){ this.localSequence=param; } /** * field for Ss * This was an Array! */ protected Ss_type0[] localSs ; /** * Auto generated getter method * @return Ss_type0[] */ public Ss_type0[] getSs(){ return localSs; } /** * validate the array for Ss */ protected void validateSs(Ss_type0[] param){ if ((param != null) && (param.length < 1)){ throw new java.lang.RuntimeException(); } } /** * Auto generated setter method * @param param Ss */ public void setSs(Ss_type0[] param){ validateSs(param); this.localSs=param; } /** * Auto generated add method for the array for convenience * @param param Ss_type0 */ public void addSs(Ss_type0 param){ if (localSs == null){ localSs = new Ss_type0[]{}; } java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localSs); list.add(param); this.localSs = (Ss_type0[])list.toArray( new Ss_type0[list.size()]); } /** * field for Assembly * This was an Array! */ protected Assembly_type0[] localAssembly ; /* 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 localAssemblyTracker = false ; public boolean isAssemblySpecified(){ return localAssemblyTracker; } /** * Auto generated getter method * @return Assembly_type0[] */ public Assembly_type0[] getAssembly(){ return localAssembly; } /** * validate the array for Assembly */ protected void validateAssembly(Assembly_type0[] param){ } /** * Auto generated setter method * @param param Assembly */ public void setAssembly(Assembly_type0[] param){ validateAssembly(param); localAssemblyTracker = param != null; this.localAssembly=param; } /** * Auto generated add method for the array for convenience * @param param Assembly_type0 */ public void addAssembly(Assembly_type0 param){ if (localAssembly == null){ localAssembly = new Assembly_type0[]{}; } //update the setting tracker localAssemblyTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localAssembly); list.add(param); this.localAssembly = (Assembly_type0[])list.toArray( new Assembly_type0[list.size()]); } /** * field for PrimarySequence * This was an Array! */ protected PrimarySequence_type0[] localPrimarySequence ; /* 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 localPrimarySequenceTracker = false ; public boolean isPrimarySequenceSpecified(){ return localPrimarySequenceTracker; } /** * Auto generated getter method * @return PrimarySequence_type0[] */ public PrimarySequence_type0[] getPrimarySequence(){ return localPrimarySequence; } /** * validate the array for PrimarySequence */ protected void validatePrimarySequence(PrimarySequence_type0[] param){ } /** * Auto generated setter method * @param param PrimarySequence */ public void setPrimarySequence(PrimarySequence_type0[] param){ validatePrimarySequence(param); localPrimarySequenceTracker = param != null; this.localPrimarySequence=param; } /** * Auto generated add method for the array for convenience * @param param PrimarySequence_type0 */ public void addPrimarySequence(PrimarySequence_type0 param){ if (localPrimarySequence == null){ localPrimarySequence = new PrimarySequence_type0[]{}; } //update the setting tracker localPrimarySequenceTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localPrimarySequence); list.add(param); this.localPrimarySequence = (PrimarySequence_type0[])list.toArray( new PrimarySequence_type0[list.size()]); } /** * field for RsStruct * This was an Array! */ protected RsStruct_type0[] localRsStruct ; /* 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 localRsStructTracker = false ; public boolean isRsStructSpecified(){ return localRsStructTracker; } /** * Auto generated getter method * @return RsStruct_type0[] */ public RsStruct_type0[] getRsStruct(){ return localRsStruct; } /** * validate the array for RsStruct */ protected void validateRsStruct(RsStruct_type0[] param){ } /** * Auto generated setter method * @param param RsStruct */ public void setRsStruct(RsStruct_type0[] param){ validateRsStruct(param); localRsStructTracker = param != null; this.localRsStruct=param; } /** * Auto generated add method for the array for convenience * @param param RsStruct_type0 */ public void addRsStruct(RsStruct_type0 param){ if (localRsStruct == null){ localRsStruct = new RsStruct_type0[]{}; } //update the setting tracker localRsStructTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localRsStruct); list.add(param); this.localRsStruct = (RsStruct_type0[])list.toArray( new RsStruct_type0[list.size()]); } /** * field for RsLinkout * This was an Array! */ protected RsLinkout_type0[] localRsLinkout ; /* 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 localRsLinkoutTracker = false ; public boolean isRsLinkoutSpecified(){ return localRsLinkoutTracker; } /** * Auto generated getter method * @return RsLinkout_type0[] */ public RsLinkout_type0[] getRsLinkout(){ return localRsLinkout; } /** * validate the array for RsLinkout */ protected void validateRsLinkout(RsLinkout_type0[] param){ } /** * Auto generated setter method * @param param RsLinkout */ public void setRsLinkout(RsLinkout_type0[] param){ validateRsLinkout(param); localRsLinkoutTracker = param != null; this.localRsLinkout=param; } /** * Auto generated add method for the array for convenience * @param param RsLinkout_type0 */ public void addRsLinkout(RsLinkout_type0 param){ if (localRsLinkout == null){ localRsLinkout = new RsLinkout_type0[]{}; } //update the setting tracker localRsLinkoutTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localRsLinkout); list.add(param); this.localRsLinkout = (RsLinkout_type0[])list.toArray( new RsLinkout_type0[list.size()]); } /** * field for MergeHistory * This was an Array! */ protected MergeHistory_type0[] localMergeHistory ; /* 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 localMergeHistoryTracker = false ; public boolean isMergeHistorySpecified(){ return localMergeHistoryTracker; } /** * Auto generated getter method * @return MergeHistory_type0[] */ public MergeHistory_type0[] getMergeHistory(){ return localMergeHistory; } /** * validate the array for MergeHistory */ protected void validateMergeHistory(MergeHistory_type0[] param){ } /** * Auto generated setter method * @param param MergeHistory */ public void setMergeHistory(MergeHistory_type0[] param){ validateMergeHistory(param); localMergeHistoryTracker = param != null; this.localMergeHistory=param; } /** * Auto generated add method for the array for convenience * @param param MergeHistory_type0 */ public void addMergeHistory(MergeHistory_type0 param){ if (localMergeHistory == null){ localMergeHistory = new MergeHistory_type0[]{}; } //update the setting tracker localMergeHistoryTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMergeHistory); list.add(param); this.localMergeHistory = (MergeHistory_type0[])list.toArray( new MergeHistory_type0[list.size()]); } /** * field for Hgvs * This was an Array! */ protected java.lang.String[] localHgvs ; /* 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 localHgvsTracker = false ; public boolean isHgvsSpecified(){ return localHgvsTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getHgvs(){ return localHgvs; } /** * validate the array for Hgvs */ protected void validateHgvs(java.lang.String[] param){ } /** * Auto generated setter method * @param param Hgvs */ public void setHgvs(java.lang.String[] param){ validateHgvs(param); localHgvsTracker = param != null; this.localHgvs=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addHgvs(java.lang.String param){ if (localHgvs == null){ localHgvs = new java.lang.String[]{}; } //update the setting tracker localHgvsTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localHgvs); list.add(param); this.localHgvs = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * field for AlleleOrigin * This was an Array! */ protected AlleleOrigin_type0[] localAlleleOrigin ; /* 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 localAlleleOriginTracker = false ; public boolean isAlleleOriginSpecified(){ return localAlleleOriginTracker; } /** * Auto generated getter method * @return AlleleOrigin_type0[] */ public AlleleOrigin_type0[] getAlleleOrigin(){ return localAlleleOrigin; } /** * validate the array for AlleleOrigin */ protected void validateAlleleOrigin(AlleleOrigin_type0[] param){ } /** * Auto generated setter method * @param param AlleleOrigin */ public void setAlleleOrigin(AlleleOrigin_type0[] param){ validateAlleleOrigin(param); localAlleleOriginTracker = param != null; this.localAlleleOrigin=param; } /** * Auto generated add method for the array for convenience * @param param AlleleOrigin_type0 */ public void addAlleleOrigin(AlleleOrigin_type0 param){ if (localAlleleOrigin == null){ localAlleleOrigin = new AlleleOrigin_type0[]{}; } //update the setting tracker localAlleleOriginTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localAlleleOrigin); list.add(param); this.localAlleleOrigin = (AlleleOrigin_type0[])list.toArray( new AlleleOrigin_type0[list.size()]); } /** * field for Phenotype * This was an Array! */ protected Phenotype_type0[] localPhenotype ; /* 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 localPhenotypeTracker = false ; public boolean isPhenotypeSpecified(){ return localPhenotypeTracker; } /** * Auto generated getter method * @return Phenotype_type0[] */ public Phenotype_type0[] getPhenotype(){ return localPhenotype; } /** * validate the array for Phenotype */ protected void validatePhenotype(Phenotype_type0[] param){ } /** * Auto generated setter method * @param param Phenotype */ public void setPhenotype(Phenotype_type0[] param){ validatePhenotype(param); localPhenotypeTracker = param != null; this.localPhenotype=param; } /** * Auto generated add method for the array for convenience * @param param Phenotype_type0 */ public void addPhenotype(Phenotype_type0 param){ if (localPhenotype == null){ localPhenotype = new Phenotype_type0[]{}; } //update the setting tracker localPhenotypeTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localPhenotype); list.add(param); this.localPhenotype = (Phenotype_type0[])list.toArray( new Phenotype_type0[list.size()]); } /** * field for BioSource * This was an Array! */ protected BioSource_type0[] localBioSource ; /* 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 localBioSourceTracker = false ; public boolean isBioSourceSpecified(){ return localBioSourceTracker; } /** * Auto generated getter method * @return BioSource_type0[] */ public BioSource_type0[] getBioSource(){ return localBioSource; } /** * validate the array for BioSource */ protected void validateBioSource(BioSource_type0[] param){ } /** * Auto generated setter method * @param param BioSource */ public void setBioSource(BioSource_type0[] param){ validateBioSource(param); localBioSourceTracker = param != null; this.localBioSource=param; } /** * Auto generated add method for the array for convenience * @param param BioSource_type0 */ public void addBioSource(BioSource_type0 param){ if (localBioSource == null){ localBioSource = new BioSource_type0[]{}; } //update the setting tracker localBioSourceTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localBioSource); list.add(param); this.localBioSource = (BioSource_type0[])list.toArray( new BioSource_type0[list.size()]); } /** * field for Frequency * This was an Array! */ protected Frequency_type0[] localFrequency ; /* 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 localFrequencyTracker = false ; public boolean isFrequencySpecified(){ return localFrequencyTracker; } /** * Auto generated getter method * @return Frequency_type0[] */ public Frequency_type0[] getFrequency(){ return localFrequency; } /** * validate the array for Frequency */ protected void validateFrequency(Frequency_type0[] param){ } /** * Auto generated setter method * @param param Frequency */ public void setFrequency(Frequency_type0[] param){ validateFrequency(param); localFrequencyTracker = param != null; this.localFrequency=param; } /** * Auto generated add method for the array for convenience * @param param Frequency_type0 */ public void addFrequency(Frequency_type0 param){ if (localFrequency == null){ localFrequency = new Frequency_type0[]{}; } //update the setting tracker localFrequencyTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localFrequency); list.add(param); this.localFrequency = (Frequency_type0[])list.toArray( new Frequency_type0[list.size()]); } /** * field for RsId * This was an Attribute! */ protected int localRsId ; /** * Auto generated getter method * @return int */ public int getRsId(){ return localRsId; } /** * Auto generated setter method * @param param RsId */ public void setRsId(int param){ this.localRsId=param; } /** * field for SnpClass * This was an Attribute! */ protected SnpClass_type0 localSnpClass ; /** * Auto generated getter method * @return SnpClass_type0 */ public SnpClass_type0 getSnpClass(){ return localSnpClass; } /** * Auto generated setter method * @param param SnpClass */ public void setSnpClass(SnpClass_type0 param){ this.localSnpClass=param; } /** * field for SnpType * This was an Attribute! */ protected SnpType_type0 localSnpType ; /** * Auto generated getter method * @return SnpType_type0 */ public SnpType_type0 getSnpType(){ return localSnpType; } /** * Auto generated setter method * @param param SnpType */ public void setSnpType(SnpType_type0 param){ this.localSnpType=param; } /** * field for MolType * This was an Attribute! */ protected MolType_type1 localMolType ; /** * Auto generated getter method * @return MolType_type1 */ public MolType_type1 getMolType(){ return localMolType; } /** * Auto generated setter method * @param param MolType */ public void setMolType(MolType_type1 param){ this.localMolType=param; } /** * field for ValidProbMin * This was an Attribute! */ protected java.math.BigInteger localValidProbMin ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getValidProbMin(){ return localValidProbMin; } /** * Auto generated setter method * @param param ValidProbMin */ public void setValidProbMin(java.math.BigInteger param){ this.localValidProbMin=param; } /** * field for ValidProbMax * This was an Attribute! */ protected java.math.BigInteger localValidProbMax ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getValidProbMax(){ return localValidProbMax; } /** * Auto generated setter method * @param param ValidProbMax */ public void setValidProbMax(java.math.BigInteger param){ this.localValidProbMax=param; } /** * field for Genotype * This was an Attribute! */ protected boolean localGenotype ; /** * Auto generated getter method * @return boolean */ public boolean getGenotype(){ return localGenotype; } /** * Auto generated setter method * @param param Genotype */ public void setGenotype(boolean param){ this.localGenotype=param; } /** * field for BitField * This was an Attribute! */ protected java.lang.String localBitField ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getBitField(){ return localBitField; } /** * Auto generated setter method * @param param BitField */ public void setBitField(java.lang.String param){ this.localBitField=param; } /** * field for TaxId * This was an Attribute! */ protected int localTaxId ; /** * Auto generated getter method * @return int */ public int getTaxId(){ return localTaxId; } /** * Auto generated setter method * @param param TaxId */ public void setTaxId(int param){ this.localTaxId=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Rs_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Rs_type0", xmlWriter); } } if (localRsId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "rsId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localRsId is null"); } if (localSnpClass != null){ writeAttribute("", "snpClass", localSnpClass.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localSnpClass is null"); } if (localSnpType != null){ writeAttribute("", "snpType", localSnpType.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localSnpType is null"); } if (localMolType != null){ writeAttribute("", "molType", localMolType.toString(), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localMolType is null"); } if (localValidProbMin != null){ writeAttribute("", "validProbMin", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValidProbMin), xmlWriter); } if (localValidProbMax != null){ writeAttribute("", "validProbMax", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValidProbMax), xmlWriter); } if (true) { writeAttribute("", "genotype", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenotype), xmlWriter); } if (localBitField != null){ writeAttribute("", "bitField", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBitField), xmlWriter); } if (localTaxId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "taxId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTaxId), xmlWriter); } if (localHetTracker){ if (localHet==null){ throw new org.apache.axis2.databinding.ADBException("Het cannot be null!!"); } localHet.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Het"), xmlWriter); } if (localValidation==null){ throw new org.apache.axis2.databinding.ADBException("Validation cannot be null!!"); } localValidation.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Validation"), xmlWriter); if (localCreate==null){ throw new org.apache.axis2.databinding.ADBException("Create cannot be null!!"); } localCreate.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Create"), xmlWriter); if (localUpdateTracker){ if (localUpdate==null){ throw new org.apache.axis2.databinding.ADBException("Update cannot be null!!"); } localUpdate.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Update"), xmlWriter); } if (localSequence==null){ throw new org.apache.axis2.databinding.ADBException("Sequence cannot be null!!"); } localSequence.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Sequence"), xmlWriter); if (localSs!=null){ for (int i = 0;i < localSs.length;i++){ if (localSs[i] != null){ localSs[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Ss"), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("Ss cannot be null!!"); } } } else { throw new org.apache.axis2.databinding.ADBException("Ss cannot be null!!"); } if (localAssemblyTracker){ if (localAssembly!=null){ for (int i = 0;i < localAssembly.length;i++){ if (localAssembly[i] != null){ localAssembly[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assembly"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Assembly cannot be null!!"); } } if (localPrimarySequenceTracker){ if (localPrimarySequence!=null){ for (int i = 0;i < localPrimarySequence.length;i++){ if (localPrimarySequence[i] != null){ localPrimarySequence[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","PrimarySequence"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("PrimarySequence cannot be null!!"); } } if (localRsStructTracker){ if (localRsStruct!=null){ for (int i = 0;i < localRsStruct.length;i++){ if (localRsStruct[i] != null){ localRsStruct[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsStruct"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("RsStruct cannot be null!!"); } } if (localRsLinkoutTracker){ if (localRsLinkout!=null){ for (int i = 0;i < localRsLinkout.length;i++){ if (localRsLinkout[i] != null){ localRsLinkout[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsLinkout"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("RsLinkout cannot be null!!"); } } if (localMergeHistoryTracker){ if (localMergeHistory!=null){ for (int i = 0;i < localMergeHistory.length;i++){ if (localMergeHistory[i] != null){ localMergeHistory[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MergeHistory"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("MergeHistory cannot be null!!"); } } if (localHgvsTracker){ if (localHgvs!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localHgvs.length;i++){ if (localHgvs[i] != null){ writeStartElement(null, namespace, "hgvs", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHgvs[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("hgvs cannot be null!!"); } } if (localAlleleOriginTracker){ if (localAlleleOrigin!=null){ for (int i = 0;i < localAlleleOrigin.length;i++){ if (localAlleleOrigin[i] != null){ localAlleleOrigin[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","AlleleOrigin"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("AlleleOrigin cannot be null!!"); } } if (localPhenotypeTracker){ if (localPhenotype!=null){ for (int i = 0;i < localPhenotype.length;i++){ if (localPhenotype[i] != null){ localPhenotype[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Phenotype"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Phenotype cannot be null!!"); } } if (localBioSourceTracker){ if (localBioSource!=null){ for (int i = 0;i < localBioSource.length;i++){ if (localBioSource[i] != null){ localBioSource[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BioSource"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("BioSource cannot be null!!"); } } if (localFrequencyTracker){ if (localFrequency!=null){ for (int i = 0;i < localFrequency.length;i++){ if (localFrequency[i] != null){ localFrequency[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Frequency"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Frequency cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localHetTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Het")); if (localHet==null){ throw new org.apache.axis2.databinding.ADBException("Het cannot be null!!"); } elementList.add(localHet); } elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Validation")); if (localValidation==null){ throw new org.apache.axis2.databinding.ADBException("Validation cannot be null!!"); } elementList.add(localValidation); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Create")); if (localCreate==null){ throw new org.apache.axis2.databinding.ADBException("Create cannot be null!!"); } elementList.add(localCreate); if (localUpdateTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Update")); if (localUpdate==null){ throw new org.apache.axis2.databinding.ADBException("Update cannot be null!!"); } elementList.add(localUpdate); } elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Sequence")); if (localSequence==null){ throw new org.apache.axis2.databinding.ADBException("Sequence cannot be null!!"); } elementList.add(localSequence); if (localSs!=null) { for (int i = 0;i < localSs.length;i++){ if (localSs[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Ss")); elementList.add(localSs[i]); } else { throw new org.apache.axis2.databinding.ADBException("Ss cannot be null !!"); } } } else { throw new org.apache.axis2.databinding.ADBException("Ss cannot be null!!"); } if (localAssemblyTracker){ if (localAssembly!=null) { for (int i = 0;i < localAssembly.length;i++){ if (localAssembly[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Assembly")); elementList.add(localAssembly[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Assembly cannot be null!!"); } } if (localPrimarySequenceTracker){ if (localPrimarySequence!=null) { for (int i = 0;i < localPrimarySequence.length;i++){ if (localPrimarySequence[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "PrimarySequence")); elementList.add(localPrimarySequence[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("PrimarySequence cannot be null!!"); } } if (localRsStructTracker){ if (localRsStruct!=null) { for (int i = 0;i < localRsStruct.length;i++){ if (localRsStruct[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "RsStruct")); elementList.add(localRsStruct[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("RsStruct cannot be null!!"); } } if (localRsLinkoutTracker){ if (localRsLinkout!=null) { for (int i = 0;i < localRsLinkout.length;i++){ if (localRsLinkout[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "RsLinkout")); elementList.add(localRsLinkout[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("RsLinkout cannot be null!!"); } } if (localMergeHistoryTracker){ if (localMergeHistory!=null) { for (int i = 0;i < localMergeHistory.length;i++){ if (localMergeHistory[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "MergeHistory")); elementList.add(localMergeHistory[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("MergeHistory cannot be null!!"); } } if (localHgvsTracker){ if (localHgvs!=null){ for (int i = 0;i < localHgvs.length;i++){ if (localHgvs[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "hgvs")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHgvs[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("hgvs cannot be null!!"); } } if (localAlleleOriginTracker){ if (localAlleleOrigin!=null) { for (int i = 0;i < localAlleleOrigin.length;i++){ if (localAlleleOrigin[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "AlleleOrigin")); elementList.add(localAlleleOrigin[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("AlleleOrigin cannot be null!!"); } } if (localPhenotypeTracker){ if (localPhenotype!=null) { for (int i = 0;i < localPhenotype.length;i++){ if (localPhenotype[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Phenotype")); elementList.add(localPhenotype[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Phenotype cannot be null!!"); } } if (localBioSourceTracker){ if (localBioSource!=null) { for (int i = 0;i < localBioSource.length;i++){ if (localBioSource[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "BioSource")); elementList.add(localBioSource[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("BioSource cannot be null!!"); } } if (localFrequencyTracker){ if (localFrequency!=null) { for (int i = 0;i < localFrequency.length;i++){ if (localFrequency[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Frequency")); elementList.add(localFrequency[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Frequency cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","rsId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsId)); attribList.add( new javax.xml.namespace.QName("","snpClass")); attribList.add(localSnpClass.toString()); attribList.add( new javax.xml.namespace.QName("","snpType")); attribList.add(localSnpType.toString()); attribList.add( new javax.xml.namespace.QName("","molType")); attribList.add(localMolType.toString()); attribList.add( new javax.xml.namespace.QName("","validProbMin")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValidProbMin)); attribList.add( new javax.xml.namespace.QName("","validProbMax")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValidProbMax)); attribList.add( new javax.xml.namespace.QName("","genotype")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenotype)); attribList.add( new javax.xml.namespace.QName("","bitField")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBitField)); attribList.add( new javax.xml.namespace.QName("","taxId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTaxId)); 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 Rs_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Rs_type0 object = new Rs_type0(); 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 (!"Rs_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Rs_type0)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(); // handle attribute "rsId" java.lang.String tempAttribRsId = reader.getAttributeValue(null,"rsId"); if (tempAttribRsId!=null){ java.lang.String content = tempAttribRsId; object.setRsId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribRsId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute rsId is missing"); } handledAttributes.add("rsId"); // handle attribute "snpClass" java.lang.String tempAttribSnpClass = reader.getAttributeValue(null,"snpClass"); if (tempAttribSnpClass!=null){ java.lang.String content = tempAttribSnpClass; object.setSnpClass( SnpClass_type0.Factory.fromString(reader,tempAttribSnpClass)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute snpClass is missing"); } handledAttributes.add("snpClass"); // handle attribute "snpType" java.lang.String tempAttribSnpType = reader.getAttributeValue(null,"snpType"); if (tempAttribSnpType!=null){ java.lang.String content = tempAttribSnpType; object.setSnpType( SnpType_type0.Factory.fromString(reader,tempAttribSnpType)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute snpType is missing"); } handledAttributes.add("snpType"); // handle attribute "molType" java.lang.String tempAttribMolType = reader.getAttributeValue(null,"molType"); if (tempAttribMolType!=null){ java.lang.String content = tempAttribMolType; object.setMolType( MolType_type1.Factory.fromString(reader,tempAttribMolType)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute molType is missing"); } handledAttributes.add("molType"); // handle attribute "validProbMin" java.lang.String tempAttribValidProbMin = reader.getAttributeValue(null,"validProbMin"); if (tempAttribValidProbMin!=null){ java.lang.String content = tempAttribValidProbMin; object.setValidProbMin( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribValidProbMin)); } else { } handledAttributes.add("validProbMin"); // handle attribute "validProbMax" java.lang.String tempAttribValidProbMax = reader.getAttributeValue(null,"validProbMax"); if (tempAttribValidProbMax!=null){ java.lang.String content = tempAttribValidProbMax; object.setValidProbMax( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribValidProbMax)); } else { } handledAttributes.add("validProbMax"); // handle attribute "genotype" java.lang.String tempAttribGenotype = reader.getAttributeValue(null,"genotype"); if (tempAttribGenotype!=null){ java.lang.String content = tempAttribGenotype; object.setGenotype( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribGenotype)); } else { } handledAttributes.add("genotype"); // handle attribute "bitField" java.lang.String tempAttribBitField = reader.getAttributeValue(null,"bitField"); if (tempAttribBitField!=null){ java.lang.String content = tempAttribBitField; object.setBitField( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribBitField)); } else { } handledAttributes.add("bitField"); // handle attribute "taxId" java.lang.String tempAttribTaxId = reader.getAttributeValue(null,"taxId"); if (tempAttribTaxId!=null){ java.lang.String content = tempAttribTaxId; object.setTaxId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribTaxId)); } else { object.setTaxId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("taxId"); reader.next(); java.util.ArrayList list6 = new java.util.ArrayList(); java.util.ArrayList list7 = new java.util.ArrayList(); java.util.ArrayList list8 = new java.util.ArrayList(); java.util.ArrayList list9 = new java.util.ArrayList(); java.util.ArrayList list10 = new java.util.ArrayList(); java.util.ArrayList list11 = new java.util.ArrayList(); java.util.ArrayList list12 = new java.util.ArrayList(); java.util.ArrayList list13 = new java.util.ArrayList(); java.util.ArrayList list14 = new java.util.ArrayList(); java.util.ArrayList list15 = new java.util.ArrayList(); java.util.ArrayList list16 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Het").equals(reader.getName())){ object.setHet(Het_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Validation").equals(reader.getName())){ object.setValidation(Validation_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Create").equals(reader.getName())){ object.setCreate(Create_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Update").equals(reader.getName())){ object.setUpdate(Update_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Sequence").equals(reader.getName())){ object.setSequence(Sequence_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Ss").equals(reader.getName())){ // Process the array and step past its final element's end. list6.add(Ss_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone6 = false; while(!loopDone6){ // We should be at the end element, but make sure 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Ss").equals(reader.getName())){ list6.add(Ss_type0.Factory.parse(reader)); }else{ loopDone6 = true; } } } // call the converter utility to convert and set the array object.setSs((Ss_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Ss_type0.class, list6)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assembly").equals(reader.getName())){ // Process the array and step past its final element's end. list7.add(Assembly_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone7 = false; while(!loopDone7){ // We should be at the end element, but make sure 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 loopDone7 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assembly").equals(reader.getName())){ list7.add(Assembly_type0.Factory.parse(reader)); }else{ loopDone7 = true; } } } // call the converter utility to convert and set the array object.setAssembly((Assembly_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Assembly_type0.class, list7)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","PrimarySequence").equals(reader.getName())){ // Process the array and step past its final element's end. list8.add(PrimarySequence_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone8 = false; while(!loopDone8){ // We should be at the end element, but make sure 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 loopDone8 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","PrimarySequence").equals(reader.getName())){ list8.add(PrimarySequence_type0.Factory.parse(reader)); }else{ loopDone8 = true; } } } // call the converter utility to convert and set the array object.setPrimarySequence((PrimarySequence_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( PrimarySequence_type0.class, list8)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsStruct").equals(reader.getName())){ // Process the array and step past its final element's end. list9.add(RsStruct_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone9 = false; while(!loopDone9){ // We should be at the end element, but make sure 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 loopDone9 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsStruct").equals(reader.getName())){ list9.add(RsStruct_type0.Factory.parse(reader)); }else{ loopDone9 = true; } } } // call the converter utility to convert and set the array object.setRsStruct((RsStruct_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( RsStruct_type0.class, list9)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsLinkout").equals(reader.getName())){ // Process the array and step past its final element's end. list10.add(RsLinkout_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone10 = false; while(!loopDone10){ // We should be at the end element, but make sure 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 loopDone10 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsLinkout").equals(reader.getName())){ list10.add(RsLinkout_type0.Factory.parse(reader)); }else{ loopDone10 = true; } } } // call the converter utility to convert and set the array object.setRsLinkout((RsLinkout_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( RsLinkout_type0.class, list10)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MergeHistory").equals(reader.getName())){ // Process the array and step past its final element's end. list11.add(MergeHistory_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone11 = false; while(!loopDone11){ // We should be at the end element, but make sure 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 loopDone11 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MergeHistory").equals(reader.getName())){ list11.add(MergeHistory_type0.Factory.parse(reader)); }else{ loopDone11 = true; } } } // call the converter utility to convert and set the array object.setMergeHistory((MergeHistory_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( MergeHistory_type0.class, list11)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","hgvs").equals(reader.getName())){ // Process the array and step past its final element's end. list12.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone12 = false; while(!loopDone12){ // 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 loopDone12 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","hgvs").equals(reader.getName())){ list12.add(reader.getElementText()); }else{ loopDone12 = true; } } } // call the converter utility to convert and set the array object.setHgvs((java.lang.String[]) list12.toArray(new java.lang.String[list12.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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","AlleleOrigin").equals(reader.getName())){ // Process the array and step past its final element's end. list13.add(AlleleOrigin_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone13 = false; while(!loopDone13){ // We should be at the end element, but make sure 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 loopDone13 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","AlleleOrigin").equals(reader.getName())){ list13.add(AlleleOrigin_type0.Factory.parse(reader)); }else{ loopDone13 = true; } } } // call the converter utility to convert and set the array object.setAlleleOrigin((AlleleOrigin_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( AlleleOrigin_type0.class, list13)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Phenotype").equals(reader.getName())){ // Process the array and step past its final element's end. list14.add(Phenotype_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone14 = false; while(!loopDone14){ // We should be at the end element, but make sure 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 loopDone14 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Phenotype").equals(reader.getName())){ list14.add(Phenotype_type0.Factory.parse(reader)); }else{ loopDone14 = true; } } } // call the converter utility to convert and set the array object.setPhenotype((Phenotype_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Phenotype_type0.class, list14)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BioSource").equals(reader.getName())){ // Process the array and step past its final element's end. list15.add(BioSource_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone15 = false; while(!loopDone15){ // We should be at the end element, but make sure 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 loopDone15 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BioSource").equals(reader.getName())){ list15.add(BioSource_type0.Factory.parse(reader)); }else{ loopDone15 = true; } } } // call the converter utility to convert and set the array object.setBioSource((BioSource_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( BioSource_type0.class, list15)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Frequency").equals(reader.getName())){ // Process the array and step past its final element's end. list16.add(Frequency_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone16 = false; while(!loopDone16){ // We should be at the end element, but make sure 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 loopDone16 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Frequency").equals(reader.getName())){ list16.add(Frequency_type0.Factory.parse(reader)); }else{ loopDone16 = true; } } } // call the converter utility to convert and set the array object.setFrequency((Frequency_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Frequency_type0.class, list16)); } // 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 } public static class MethodClass_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "methodClass_type0", "ns1"); /** * field for MethodClass_type0 */ protected java.lang.String localMethodClass_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected MethodClass_type0(java.lang.String value, boolean isRegisterValue) { localMethodClass_type0 = value; if (isRegisterValue){ _table_.put(localMethodClass_type0, this); } } public static final java.lang.String _DHPLC = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("DHPLC"); public static final java.lang.String _hybridize = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("hybridize"); public static final java.lang.String _computed = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("computed"); public static final java.lang.String _SSCP = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SSCP"); public static final java.lang.String _other = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("other"); public static final java.lang.String _unknown = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unknown"); public static final java.lang.String _RFLP = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("RFLP"); public static final java.lang.String _sequence = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("sequence"); public static final MethodClass_type0 DHPLC = new MethodClass_type0(_DHPLC,true); public static final MethodClass_type0 hybridize = new MethodClass_type0(_hybridize,true); public static final MethodClass_type0 computed = new MethodClass_type0(_computed,true); public static final MethodClass_type0 SSCP = new MethodClass_type0(_SSCP,true); public static final MethodClass_type0 other = new MethodClass_type0(_other,true); public static final MethodClass_type0 unknown = new MethodClass_type0(_unknown,true); public static final MethodClass_type0 RFLP = new MethodClass_type0(_RFLP,true); public static final MethodClass_type0 sequence = new MethodClass_type0(_sequence,true); public java.lang.String getValue() { return localMethodClass_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localMethodClass_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":methodClass_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "methodClass_type0", xmlWriter); } } if (localMethodClass_type0==null){ throw new org.apache.axis2.databinding.ADBException("methodClass_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localMethodClass_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMethodClass_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static MethodClass_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { MethodClass_type0 enumeration = (MethodClass_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static MethodClass_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static MethodClass_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return MethodClass_type0.Factory.fromString(content,namespaceUri); } else { return MethodClass_type0.Factory.fromString(content,""); } } /** * 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 MethodClass_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MethodClass_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"methodClass_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = MethodClass_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = MethodClass_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MapWeight_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "mapWeight_type0", "ns1"); /** * field for MapWeight_type0 */ protected java.lang.String localMapWeight_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected MapWeight_type0(java.lang.String value, boolean isRegisterValue) { localMapWeight_type0 = value; if (isRegisterValue){ _table_.put(localMapWeight_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unmapped"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unique-in-contig"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("two-hits-in-contig"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("less-10-hits"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("multiple-hits"); public static final MapWeight_type0 value1 = new MapWeight_type0(_value1,true); public static final MapWeight_type0 value2 = new MapWeight_type0(_value2,true); public static final MapWeight_type0 value3 = new MapWeight_type0(_value3,true); public static final MapWeight_type0 value4 = new MapWeight_type0(_value4,true); public static final MapWeight_type0 value5 = new MapWeight_type0(_value5,true); public java.lang.String getValue() { return localMapWeight_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localMapWeight_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":mapWeight_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "mapWeight_type0", xmlWriter); } } if (localMapWeight_type0==null){ throw new org.apache.axis2.databinding.ADBException("mapWeight_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localMapWeight_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMapWeight_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static MapWeight_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { MapWeight_type0 enumeration = (MapWeight_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static MapWeight_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static MapWeight_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return MapWeight_type0.Factory.fromString(content,namespaceUri); } else { return MapWeight_type0.Factory.fromString(content,""); } } /** * 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 MapWeight_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MapWeight_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"mapWeight_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = MapWeight_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = MapWeight_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Component_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Component_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for MapLoc * This was an Array! */ protected MapLoc_type0[] localMapLoc ; /** * Auto generated getter method * @return MapLoc_type0[] */ public MapLoc_type0[] getMapLoc(){ return localMapLoc; } /** * validate the array for MapLoc */ protected void validateMapLoc(MapLoc_type0[] param){ if ((param != null) && (param.length < 1)){ throw new java.lang.RuntimeException(); } } /** * Auto generated setter method * @param param MapLoc */ public void setMapLoc(MapLoc_type0[] param){ validateMapLoc(param); this.localMapLoc=param; } /** * Auto generated add method for the array for convenience * @param param MapLoc_type0 */ public void addMapLoc(MapLoc_type0 param){ if (localMapLoc == null){ localMapLoc = new MapLoc_type0[]{}; } java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMapLoc); list.add(param); this.localMapLoc = (MapLoc_type0[])list.toArray( new MapLoc_type0[list.size()]); } /** * field for ComponentType * This was an Attribute! */ protected ComponentType_type0 localComponentType ; /** * Auto generated getter method * @return ComponentType_type0 */ public ComponentType_type0 getComponentType(){ return localComponentType; } /** * Auto generated setter method * @param param ComponentType */ public void setComponentType(ComponentType_type0 param){ this.localComponentType=param; } /** * field for CtgId * This was an Attribute! */ protected int localCtgId ; /** * Auto generated getter method * @return int */ public int getCtgId(){ return localCtgId; } /** * Auto generated setter method * @param param CtgId */ public void setCtgId(int param){ this.localCtgId=param; } /** * field for Accession * This was an Attribute! */ protected java.lang.String localAccession ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAccession(){ return localAccession; } /** * Auto generated setter method * @param param Accession */ public void setAccession(java.lang.String param){ this.localAccession=param; } /** * field for Name * This was an Attribute! */ protected java.lang.String localName ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getName(){ return localName; } /** * Auto generated setter method * @param param Name */ public void setName(java.lang.String param){ this.localName=param; } /** * field for Chromosome * This was an Attribute! */ protected java.lang.String localChromosome ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getChromosome(){ return localChromosome; } /** * Auto generated setter method * @param param Chromosome */ public void setChromosome(java.lang.String param){ this.localChromosome=param; } /** * field for Start * This was an Attribute! */ protected int localStart ; /** * Auto generated getter method * @return int */ public int getStart(){ return localStart; } /** * Auto generated setter method * @param param Start */ public void setStart(int param){ this.localStart=param; } /** * field for End * This was an Attribute! */ protected int localEnd ; /** * Auto generated getter method * @return int */ public int getEnd(){ return localEnd; } /** * Auto generated setter method * @param param End */ public void setEnd(int param){ this.localEnd=param; } /** * field for Orientation * This was an Attribute! */ protected Orientation_type0 localOrientation ; /** * Auto generated getter method * @return Orientation_type0 */ public Orientation_type0 getOrientation(){ return localOrientation; } /** * Auto generated setter method * @param param Orientation */ public void setOrientation(Orientation_type0 param){ this.localOrientation=param; } /** * field for Gi * This was an Attribute! */ protected java.lang.String localGi ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGi(){ return localGi; } /** * Auto generated setter method * @param param Gi */ public void setGi(java.lang.String param){ this.localGi=param; } /** * field for GroupTerm * This was an Attribute! */ protected java.lang.String localGroupTerm ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGroupTerm(){ return localGroupTerm; } /** * Auto generated setter method * @param param GroupTerm */ public void setGroupTerm(java.lang.String param){ this.localGroupTerm=param; } /** * field for ContigLabel * This was an Attribute! */ protected java.lang.String localContigLabel ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getContigLabel(){ return localContigLabel; } /** * Auto generated setter method * @param param ContigLabel */ public void setContigLabel(java.lang.String param){ this.localContigLabel=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Component_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Component_type0", xmlWriter); } } if (localComponentType != null){ writeAttribute("", "componentType", localComponentType.toString(), xmlWriter); } if (localCtgId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "ctgId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCtgId), xmlWriter); } if (localAccession != null){ writeAttribute("", "accession", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAccession), xmlWriter); } if (localName != null){ writeAttribute("", "name", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName), xmlWriter); } if (localChromosome != null){ writeAttribute("", "chromosome", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localChromosome), xmlWriter); } if (localStart!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "start", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStart), xmlWriter); } if (localEnd!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "end", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEnd), xmlWriter); } if (localOrientation != null){ writeAttribute("", "orientation", localOrientation.toString(), xmlWriter); } if (localGi != null){ writeAttribute("", "gi", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGi), xmlWriter); } if (localGroupTerm != null){ writeAttribute("", "groupTerm", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGroupTerm), xmlWriter); } if (localContigLabel != null){ writeAttribute("", "contigLabel", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContigLabel), xmlWriter); } if (localMapLoc!=null){ for (int i = 0;i < localMapLoc.length;i++){ if (localMapLoc[i] != null){ localMapLoc[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc"), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } } } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localMapLoc!=null) { for (int i = 0;i < localMapLoc.length;i++){ if (localMapLoc[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "MapLoc")); elementList.add(localMapLoc[i]); } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null !!"); } } } else { throw new org.apache.axis2.databinding.ADBException("MapLoc cannot be null!!"); } attribList.add( new javax.xml.namespace.QName("","componentType")); attribList.add(localComponentType.toString()); attribList.add( new javax.xml.namespace.QName("","ctgId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCtgId)); attribList.add( new javax.xml.namespace.QName("","accession")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAccession)); attribList.add( new javax.xml.namespace.QName("","name")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); attribList.add( new javax.xml.namespace.QName("","chromosome")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localChromosome)); attribList.add( new javax.xml.namespace.QName("","start")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStart)); attribList.add( new javax.xml.namespace.QName("","end")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEnd)); attribList.add( new javax.xml.namespace.QName("","orientation")); attribList.add(localOrientation.toString()); attribList.add( new javax.xml.namespace.QName("","gi")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGi)); attribList.add( new javax.xml.namespace.QName("","groupTerm")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGroupTerm)); attribList.add( new javax.xml.namespace.QName("","contigLabel")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContigLabel)); 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 Component_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Component_type0 object = new Component_type0(); 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 (!"Component_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Component_type0)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(); // handle attribute "componentType" java.lang.String tempAttribComponentType = reader.getAttributeValue(null,"componentType"); if (tempAttribComponentType!=null){ java.lang.String content = tempAttribComponentType; object.setComponentType( ComponentType_type0.Factory.fromString(reader,tempAttribComponentType)); } else { } handledAttributes.add("componentType"); // handle attribute "ctgId" java.lang.String tempAttribCtgId = reader.getAttributeValue(null,"ctgId"); if (tempAttribCtgId!=null){ java.lang.String content = tempAttribCtgId; object.setCtgId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribCtgId)); } else { object.setCtgId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("ctgId"); // handle attribute "accession" java.lang.String tempAttribAccession = reader.getAttributeValue(null,"accession"); if (tempAttribAccession!=null){ java.lang.String content = tempAttribAccession; object.setAccession( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAccession)); } else { } handledAttributes.add("accession"); // handle attribute "name" java.lang.String tempAttribName = reader.getAttributeValue(null,"name"); if (tempAttribName!=null){ java.lang.String content = tempAttribName; object.setName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribName)); } else { } handledAttributes.add("name"); // handle attribute "chromosome" java.lang.String tempAttribChromosome = reader.getAttributeValue(null,"chromosome"); if (tempAttribChromosome!=null){ java.lang.String content = tempAttribChromosome; object.setChromosome( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribChromosome)); } else { } handledAttributes.add("chromosome"); // handle attribute "start" java.lang.String tempAttribStart = reader.getAttributeValue(null,"start"); if (tempAttribStart!=null){ java.lang.String content = tempAttribStart; object.setStart( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribStart)); } else { object.setStart(java.lang.Integer.MIN_VALUE); } handledAttributes.add("start"); // handle attribute "end" java.lang.String tempAttribEnd = reader.getAttributeValue(null,"end"); if (tempAttribEnd!=null){ java.lang.String content = tempAttribEnd; object.setEnd( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribEnd)); } else { object.setEnd(java.lang.Integer.MIN_VALUE); } handledAttributes.add("end"); // handle attribute "orientation" java.lang.String tempAttribOrientation = reader.getAttributeValue(null,"orientation"); if (tempAttribOrientation!=null){ java.lang.String content = tempAttribOrientation; object.setOrientation( Orientation_type0.Factory.fromString(reader,tempAttribOrientation)); } else { } handledAttributes.add("orientation"); // handle attribute "gi" java.lang.String tempAttribGi = reader.getAttributeValue(null,"gi"); if (tempAttribGi!=null){ java.lang.String content = tempAttribGi; object.setGi( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGi)); } else { } handledAttributes.add("gi"); // handle attribute "groupTerm" java.lang.String tempAttribGroupTerm = reader.getAttributeValue(null,"groupTerm"); if (tempAttribGroupTerm!=null){ java.lang.String content = tempAttribGroupTerm; object.setGroupTerm( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGroupTerm)); } else { } handledAttributes.add("groupTerm"); // handle attribute "contigLabel" java.lang.String tempAttribContigLabel = reader.getAttributeValue(null,"contigLabel"); if (tempAttribContigLabel!=null){ java.lang.String content = tempAttribContigLabel; object.setContigLabel( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribContigLabel)); } else { } handledAttributes.add("contigLabel"); reader.next(); java.util.ArrayList list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(MapLoc_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // We should be at the end element, but make sure 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","MapLoc").equals(reader.getName())){ list1.add(MapLoc_type0.Factory.parse(reader)); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setMapLoc((MapLoc_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( MapLoc_type0.class, list1)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } 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 } public static class Assay_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Assay_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Method */ protected Method_type0 localMethod ; /** * Auto generated getter method * @return Method_type0 */ public Method_type0 getMethod(){ return localMethod; } /** * Auto generated setter method * @param param Method */ public void setMethod(Method_type0 param){ this.localMethod=param; } /** * field for Taxonomy */ protected Taxonomy_type0 localTaxonomy ; /** * Auto generated getter method * @return Taxonomy_type0 */ public Taxonomy_type0 getTaxonomy(){ return localTaxonomy; } /** * Auto generated setter method * @param param Taxonomy */ public void setTaxonomy(Taxonomy_type0 param){ this.localTaxonomy=param; } /** * field for Strains * This was an Array! */ protected java.lang.String[] localStrains ; /* 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 localStrainsTracker = false ; public boolean isStrainsSpecified(){ return localStrainsTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getStrains(){ return localStrains; } /** * validate the array for Strains */ protected void validateStrains(java.lang.String[] param){ } /** * Auto generated setter method * @param param Strains */ public void setStrains(java.lang.String[] param){ validateStrains(param); localStrainsTracker = param != null; this.localStrains=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addStrains(java.lang.String param){ if (localStrains == null){ localStrains = new java.lang.String[]{}; } //update the setting tracker localStrainsTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localStrains); list.add(param); this.localStrains = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * field for Comment */ protected java.lang.String localComment ; /* 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 localCommentTracker = false ; public boolean isCommentSpecified(){ return localCommentTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getComment(){ return localComment; } /** * Auto generated setter method * @param param Comment */ public void setComment(java.lang.String param){ localCommentTracker = param != null; this.localComment=param; } /** * field for Citation * This was an Array! */ protected java.lang.String[] localCitation ; /* 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 localCitationTracker = false ; public boolean isCitationSpecified(){ return localCitationTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getCitation(){ return localCitation; } /** * validate the array for Citation */ protected void validateCitation(java.lang.String[] param){ } /** * Auto generated setter method * @param param Citation */ public void setCitation(java.lang.String[] param){ validateCitation(param); localCitationTracker = param != null; this.localCitation=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addCitation(java.lang.String param){ if (localCitation == null){ localCitation = new java.lang.String[]{}; } //update the setting tracker localCitationTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localCitation); list.add(param); this.localCitation = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * field for Handle * This was an Attribute! */ protected java.lang.String localHandle ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getHandle(){ return localHandle; } /** * Auto generated setter method * @param param Handle */ public void setHandle(java.lang.String param){ this.localHandle=param; } /** * field for Batch * This was an Attribute! */ protected java.lang.String localBatch ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getBatch(){ return localBatch; } /** * Auto generated setter method * @param param Batch */ public void setBatch(java.lang.String param){ this.localBatch=param; } /** * field for BatchId * This was an Attribute! */ protected int localBatchId ; /** * Auto generated getter method * @return int */ public int getBatchId(){ return localBatchId; } /** * Auto generated setter method * @param param BatchId */ public void setBatchId(int param){ this.localBatchId=param; } /** * field for BatchType * This was an Attribute! */ protected BatchType_type0 localBatchType ; /** * Auto generated getter method * @return BatchType_type0 */ public BatchType_type0 getBatchType(){ return localBatchType; } /** * Auto generated setter method * @param param BatchType */ public void setBatchType(BatchType_type0 param){ this.localBatchType=param; } /** * field for MolType * This was an Attribute! */ protected MolType_type2 localMolType ; /** * Auto generated getter method * @return MolType_type2 */ public MolType_type2 getMolType(){ return localMolType; } /** * Auto generated setter method * @param param MolType */ public void setMolType(MolType_type2 param){ this.localMolType=param; } /** * field for SampleSize * This was an Attribute! */ protected int localSampleSize ; /** * Auto generated getter method * @return int */ public int getSampleSize(){ return localSampleSize; } /** * Auto generated setter method * @param param SampleSize */ public void setSampleSize(int param){ this.localSampleSize=param; } /** * field for Population * This was an Attribute! */ protected java.lang.String localPopulation ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getPopulation(){ return localPopulation; } /** * Auto generated setter method * @param param Population */ public void setPopulation(java.lang.String param){ this.localPopulation=param; } /** * field for LinkoutUrl * This was an Attribute! */ protected java.lang.String localLinkoutUrl ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getLinkoutUrl(){ return localLinkoutUrl; } /** * Auto generated setter method * @param param LinkoutUrl */ public void setLinkoutUrl(java.lang.String param){ this.localLinkoutUrl=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Assay_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Assay_type0", xmlWriter); } } if (localHandle != null){ writeAttribute("", "handle", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHandle), xmlWriter); } if (localBatch != null){ writeAttribute("", "batch", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatch), xmlWriter); } if (localBatchId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "batchId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatchId), xmlWriter); } if (localBatchType != null){ writeAttribute("", "batchType", localBatchType.toString(), xmlWriter); } if (localMolType != null){ writeAttribute("", "molType", localMolType.toString(), xmlWriter); } if (localSampleSize!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "sampleSize", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSampleSize), xmlWriter); } if (localPopulation != null){ writeAttribute("", "population", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPopulation), xmlWriter); } if (localLinkoutUrl != null){ writeAttribute("", "linkoutUrl", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkoutUrl), xmlWriter); } if (localMethod==null){ throw new org.apache.axis2.databinding.ADBException("Method cannot be null!!"); } localMethod.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Method"), xmlWriter); if (localTaxonomy==null){ throw new org.apache.axis2.databinding.ADBException("Taxonomy cannot be null!!"); } localTaxonomy.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Taxonomy"), xmlWriter); if (localStrainsTracker){ if (localStrains!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localStrains.length;i++){ if (localStrains[i] != null){ writeStartElement(null, namespace, "Strains", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStrains[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Strains cannot be null!!"); } } if (localCommentTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "Comment", xmlWriter); if (localComment==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("Comment cannot be null!!"); }else{ xmlWriter.writeCharacters(localComment); } xmlWriter.writeEndElement(); } if (localCitationTracker){ if (localCitation!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localCitation.length;i++){ if (localCitation[i] != null){ writeStartElement(null, namespace, "Citation", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCitation[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Citation cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Method")); if (localMethod==null){ throw new org.apache.axis2.databinding.ADBException("Method cannot be null!!"); } elementList.add(localMethod); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Taxonomy")); if (localTaxonomy==null){ throw new org.apache.axis2.databinding.ADBException("Taxonomy cannot be null!!"); } elementList.add(localTaxonomy); if (localStrainsTracker){ if (localStrains!=null){ for (int i = 0;i < localStrains.length;i++){ if (localStrains[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Strains")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStrains[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("Strains cannot be null!!"); } } if (localCommentTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Comment")); if (localComment != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localComment)); } else { throw new org.apache.axis2.databinding.ADBException("Comment cannot be null!!"); } } if (localCitationTracker){ if (localCitation!=null){ for (int i = 0;i < localCitation.length;i++){ if (localCitation[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Citation")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCitation[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("Citation cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","handle")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localHandle)); attribList.add( new javax.xml.namespace.QName("","batch")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatch)); attribList.add( new javax.xml.namespace.QName("","batchId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBatchId)); attribList.add( new javax.xml.namespace.QName("","batchType")); attribList.add(localBatchType.toString()); attribList.add( new javax.xml.namespace.QName("","molType")); attribList.add(localMolType.toString()); attribList.add( new javax.xml.namespace.QName("","sampleSize")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSampleSize)); attribList.add( new javax.xml.namespace.QName("","population")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPopulation)); attribList.add( new javax.xml.namespace.QName("","linkoutUrl")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkoutUrl)); 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 Assay_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Assay_type0 object = new Assay_type0(); 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 (!"Assay_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Assay_type0)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(); // handle attribute "handle" java.lang.String tempAttribHandle = reader.getAttributeValue(null,"handle"); if (tempAttribHandle!=null){ java.lang.String content = tempAttribHandle; object.setHandle( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribHandle)); } else { } handledAttributes.add("handle"); // handle attribute "batch" java.lang.String tempAttribBatch = reader.getAttributeValue(null,"batch"); if (tempAttribBatch!=null){ java.lang.String content = tempAttribBatch; object.setBatch( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribBatch)); } else { } handledAttributes.add("batch"); // handle attribute "batchId" java.lang.String tempAttribBatchId = reader.getAttributeValue(null,"batchId"); if (tempAttribBatchId!=null){ java.lang.String content = tempAttribBatchId; object.setBatchId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBatchId)); } else { object.setBatchId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("batchId"); // handle attribute "batchType" java.lang.String tempAttribBatchType = reader.getAttributeValue(null,"batchType"); if (tempAttribBatchType!=null){ java.lang.String content = tempAttribBatchType; object.setBatchType( BatchType_type0.Factory.fromString(reader,tempAttribBatchType)); } else { } handledAttributes.add("batchType"); // handle attribute "molType" java.lang.String tempAttribMolType = reader.getAttributeValue(null,"molType"); if (tempAttribMolType!=null){ java.lang.String content = tempAttribMolType; object.setMolType( MolType_type2.Factory.fromString(reader,tempAttribMolType)); } else { } handledAttributes.add("molType"); // handle attribute "sampleSize" java.lang.String tempAttribSampleSize = reader.getAttributeValue(null,"sampleSize"); if (tempAttribSampleSize!=null){ java.lang.String content = tempAttribSampleSize; object.setSampleSize( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribSampleSize)); } else { object.setSampleSize(java.lang.Integer.MIN_VALUE); } handledAttributes.add("sampleSize"); // handle attribute "population" java.lang.String tempAttribPopulation = reader.getAttributeValue(null,"population"); if (tempAttribPopulation!=null){ java.lang.String content = tempAttribPopulation; object.setPopulation( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribPopulation)); } else { } handledAttributes.add("population"); // handle attribute "linkoutUrl" java.lang.String tempAttribLinkoutUrl = reader.getAttributeValue(null,"linkoutUrl"); if (tempAttribLinkoutUrl!=null){ java.lang.String content = tempAttribLinkoutUrl; object.setLinkoutUrl( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribLinkoutUrl)); } else { } handledAttributes.add("linkoutUrl"); reader.next(); java.util.ArrayList list3 = new java.util.ArrayList(); java.util.ArrayList list5 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Method").equals(reader.getName())){ object.setMethod(Method_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Taxonomy").equals(reader.getName())){ object.setTaxonomy(Taxonomy_type0.Factory.parse(reader)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Strains").equals(reader.getName())){ // Process the array and step past its final element's end. list3.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone3 = false; while(!loopDone3){ // 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 loopDone3 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Strains").equals(reader.getName())){ list3.add(reader.getElementText()); }else{ loopDone3 = true; } } } // call the converter utility to convert and set the array object.setStrains((java.lang.String[]) list3.toArray(new java.lang.String[list3.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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Comment").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: "+"Comment" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setComment( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Citation").equals(reader.getName())){ // Process the array and step past its final element's end. list5.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone5 = false; while(!loopDone5){ // 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 loopDone5 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Citation").equals(reader.getName())){ list5.add(reader.getElementText()); }else{ loopDone5 = true; } } } // call the converter utility to convert and set the array object.setCitation((java.lang.String[]) list5.toArray(new java.lang.String[list5.size()])); } // 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 } public static class Assembly implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Assembly", "ns1"); /** * field for Assembly */ protected Assembly_type0 localAssembly ; /** * Auto generated getter method * @return Assembly_type0 */ public Assembly_type0 getAssembly(){ return localAssembly; } /** * Auto generated setter method * @param param Assembly */ public void setAssembly(Assembly_type0 param){ this.localAssembly=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localAssembly==null){ throw new org.apache.axis2.databinding.ADBException("Assembly cannot be null!"); } localAssembly.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localAssembly.getPullParser(MY_QNAME); } /** * 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 Assembly parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Assembly object = new Assembly(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assembly").equals(reader.getName())){ object.setAssembly(Assembly_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class LocType_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "locType_type0", "ns1"); /** * field for LocType_type0 */ protected java.lang.String localLocType_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected LocType_type0(java.lang.String value, boolean isRegisterValue) { localLocType_type0 = value; if (isRegisterValue){ _table_.put(localLocType_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("insertion"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("exact"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("deletion"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("range-ins"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("range-exact"); public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("range-del"); public static final LocType_type0 value1 = new LocType_type0(_value1,true); public static final LocType_type0 value2 = new LocType_type0(_value2,true); public static final LocType_type0 value3 = new LocType_type0(_value3,true); public static final LocType_type0 value4 = new LocType_type0(_value4,true); public static final LocType_type0 value5 = new LocType_type0(_value5,true); public static final LocType_type0 value6 = new LocType_type0(_value6,true); public java.lang.String getValue() { return localLocType_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localLocType_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":locType_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "locType_type0", xmlWriter); } } if (localLocType_type0==null){ throw new org.apache.axis2.databinding.ADBException("locType_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localLocType_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocType_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static LocType_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { LocType_type0 enumeration = (LocType_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static LocType_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static LocType_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return LocType_type0.Factory.fromString(content,namespaceUri); } else { return LocType_type0.Factory.fromString(content,""); } } /** * 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 LocType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ LocType_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"locType_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = LocType_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = LocType_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Orient_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "orient_type0", "ns1"); /** * field for Orient_type0 */ protected java.lang.String localOrient_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Orient_type0(java.lang.String value, boolean isRegisterValue) { localOrient_type0 = value; if (isRegisterValue){ _table_.put(localOrient_type0, this); } } public static final java.lang.String _forward = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("forward"); public static final java.lang.String _reverse = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("reverse"); public static final Orient_type0 forward = new Orient_type0(_forward,true); public static final Orient_type0 reverse = new Orient_type0(_reverse,true); public java.lang.String getValue() { return localOrient_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localOrient_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":orient_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "orient_type0", xmlWriter); } } if (localOrient_type0==null){ throw new org.apache.axis2.databinding.ADBException("orient_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localOrient_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrient_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Orient_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Orient_type0 enumeration = (Orient_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Orient_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Orient_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Orient_type0.Factory.fromString(content,namespaceUri); } else { return Orient_type0.Factory.fromString(content,""); } } /** * 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 Orient_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Orient_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"orient_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Orient_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Orient_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Strand_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "strand_type0", "ns1"); /** * field for Strand_type0 */ protected java.lang.String localStrand_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Strand_type0(java.lang.String value, boolean isRegisterValue) { localStrand_type0 = value; if (isRegisterValue){ _table_.put(localStrand_type0, this); } } public static final java.lang.String _top = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("top"); public static final java.lang.String _bottom = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("bottom"); public static final Strand_type0 top = new Strand_type0(_top,true); public static final Strand_type0 bottom = new Strand_type0(_bottom,true); public java.lang.String getValue() { return localStrand_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localStrand_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":strand_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "strand_type0", xmlWriter); } } if (localStrand_type0==null){ throw new org.apache.axis2.databinding.ADBException("strand_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localStrand_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localStrand_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Strand_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Strand_type0 enumeration = (Strand_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Strand_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Strand_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Strand_type0.Factory.fromString(content,namespaceUri); } else { return Strand_type0.Factory.fromString(content,""); } } /** * 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 Strand_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Strand_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"strand_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Strand_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Strand_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Orient_type1 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "orient_type1", "ns1"); /** * field for Orient_type1 */ protected java.lang.String localOrient_type1 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Orient_type1(java.lang.String value, boolean isRegisterValue) { localOrient_type1 = value; if (isRegisterValue){ _table_.put(localOrient_type1, this); } } public static final java.lang.String _forward = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("forward"); public static final java.lang.String _reverse = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("reverse"); public static final Orient_type1 forward = new Orient_type1(_forward,true); public static final Orient_type1 reverse = new Orient_type1(_reverse,true); public java.lang.String getValue() { return localOrient_type1;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localOrient_type1.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":orient_type1", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "orient_type1", xmlWriter); } } if (localOrient_type1==null){ throw new org.apache.axis2.databinding.ADBException("orient_type1 cannot be null !!"); }else{ xmlWriter.writeCharacters(localOrient_type1); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrient_type1) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Orient_type1 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Orient_type1 enumeration = (Orient_type1) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Orient_type1 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Orient_type1 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Orient_type1.Factory.fromString(content,namespaceUri); } else { return Orient_type1.Factory.fromString(content,""); } } /** * 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 Orient_type1 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Orient_type1 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"orient_type1" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Orient_type1.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Orient_type1.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Rs implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Rs", "ns1"); /** * field for Rs */ protected Rs_type0 localRs ; /** * Auto generated getter method * @return Rs_type0 */ public Rs_type0 getRs(){ return localRs; } /** * Auto generated setter method * @param param Rs */ public void setRs(Rs_type0 param){ this.localRs=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localRs==null){ throw new org.apache.axis2.databinding.ADBException("Rs cannot be null!"); } localRs.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localRs.getPullParser(MY_QNAME); } /** * 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 Rs parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Rs object = new Rs(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs").equals(reader.getName())){ object.setRs(Rs_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Create_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Create_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Build * This was an Attribute! */ protected int localBuild ; /** * Auto generated getter method * @return int */ public int getBuild(){ return localBuild; } /** * Auto generated setter method * @param param Build */ public void setBuild(int param){ this.localBuild=param; } /** * field for Date * This was an Attribute! */ protected java.lang.String localDate ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getDate(){ return localDate; } /** * Auto generated setter method * @param param Date */ public void setDate(java.lang.String param){ this.localDate=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Create_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Create_type0", xmlWriter); } } if (localBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "build", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuild), xmlWriter); } if (localDate != null){ writeAttribute("", "date", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","build")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuild)); attribList.add( new javax.xml.namespace.QName("","date")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDate)); 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 Create_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Create_type0 object = new Create_type0(); 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 (!"Create_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Create_type0)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(); // handle attribute "build" java.lang.String tempAttribBuild = reader.getAttributeValue(null,"build"); if (tempAttribBuild!=null){ java.lang.String content = tempAttribBuild; object.setBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBuild)); } else { object.setBuild(java.lang.Integer.MIN_VALUE); } handledAttributes.add("build"); // handle attribute "date" java.lang.String tempAttribDate = reader.getAttributeValue(null,"date"); if (tempAttribDate!=null){ java.lang.String content = tempAttribDate; object.setDate( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribDate)); } else { } handledAttributes.add("date"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Orientation_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "orientation_type0", "ns1"); /** * field for Orientation_type0 */ protected java.lang.String localOrientation_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected Orientation_type0(java.lang.String value, boolean isRegisterValue) { localOrientation_type0 = value; if (isRegisterValue){ _table_.put(localOrientation_type0, this); } } public static final java.lang.String _fwd = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("fwd"); public static final java.lang.String _rev = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("rev"); public static final java.lang.String _unknown = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("unknown"); public static final Orientation_type0 fwd = new Orientation_type0(_fwd,true); public static final Orientation_type0 rev = new Orientation_type0(_rev,true); public static final Orientation_type0 unknown = new Orientation_type0(_unknown,true); public java.lang.String getValue() { return localOrientation_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localOrientation_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":orientation_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "orientation_type0", xmlWriter); } } if (localOrientation_type0==null){ throw new org.apache.axis2.databinding.ADBException("orientation_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localOrientation_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrientation_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static Orientation_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { Orientation_type0 enumeration = (Orientation_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static Orientation_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static Orientation_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return Orientation_type0.Factory.fromString(content,namespaceUri); } else { return Orientation_type0.Factory.fromString(content,""); } } /** * 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 Orientation_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Orientation_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"orientation_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = Orientation_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = Orientation_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class ExchangeSet implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "ExchangeSet", "ns1"); /** * field for SourceDatabase */ protected SourceDatabase_type0 localSourceDatabase ; /* 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 localSourceDatabaseTracker = false ; public boolean isSourceDatabaseSpecified(){ return localSourceDatabaseTracker; } /** * Auto generated getter method * @return SourceDatabase_type0 */ public SourceDatabase_type0 getSourceDatabase(){ return localSourceDatabase; } /** * Auto generated setter method * @param param SourceDatabase */ public void setSourceDatabase(SourceDatabase_type0 param){ localSourceDatabaseTracker = param != null; this.localSourceDatabase=param; } /** * field for Rs * This was an Array! */ protected Rs_type0[] localRs ; /* 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 localRsTracker = false ; public boolean isRsSpecified(){ return localRsTracker; } /** * Auto generated getter method * @return Rs_type0[] */ public Rs_type0[] getRs(){ return localRs; } /** * validate the array for Rs */ protected void validateRs(Rs_type0[] param){ } /** * Auto generated setter method * @param param Rs */ public void setRs(Rs_type0[] param){ validateRs(param); localRsTracker = param != null; this.localRs=param; } /** * Auto generated add method for the array for convenience * @param param Rs_type0 */ public void addRs(Rs_type0 param){ if (localRs == null){ localRs = new Rs_type0[]{}; } //update the setting tracker localRsTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localRs); list.add(param); this.localRs = (Rs_type0[])list.toArray( new Rs_type0[list.size()]); } /** * field for Assay */ protected Assay_type0 localAssay ; /* 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 localAssayTracker = false ; public boolean isAssaySpecified(){ return localAssayTracker; } /** * Auto generated getter method * @return Assay_type0 */ public Assay_type0 getAssay(){ return localAssay; } /** * Auto generated setter method * @param param Assay */ public void setAssay(Assay_type0 param){ localAssayTracker = param != null; this.localAssay=param; } /** * field for Query */ protected Query_type0 localQuery ; /* 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 localQueryTracker = false ; public boolean isQuerySpecified(){ return localQueryTracker; } /** * Auto generated getter method * @return Query_type0 */ public Query_type0 getQuery(){ return localQuery; } /** * Auto generated setter method * @param param Query */ public void setQuery(Query_type0 param){ localQueryTracker = param != null; this.localQuery=param; } /** * field for Summary */ protected Summary_type0 localSummary ; /* 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 localSummaryTracker = false ; public boolean isSummarySpecified(){ return localSummaryTracker; } /** * Auto generated getter method * @return Summary_type0 */ public Summary_type0 getSummary(){ return localSummary; } /** * Auto generated setter method * @param param Summary */ public void setSummary(Summary_type0 param){ localSummaryTracker = param != null; this.localSummary=param; } /** * field for BaseURL * This was an Array! */ protected BaseURL_type0[] localBaseURL ; /* 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 localBaseURLTracker = false ; public boolean isBaseURLSpecified(){ return localBaseURLTracker; } /** * Auto generated getter method * @return BaseURL_type0[] */ public BaseURL_type0[] getBaseURL(){ return localBaseURL; } /** * validate the array for BaseURL */ protected void validateBaseURL(BaseURL_type0[] param){ } /** * Auto generated setter method * @param param BaseURL */ public void setBaseURL(BaseURL_type0[] param){ validateBaseURL(param); localBaseURLTracker = param != null; this.localBaseURL=param; } /** * Auto generated add method for the array for convenience * @param param BaseURL_type0 */ public void addBaseURL(BaseURL_type0 param){ if (localBaseURL == null){ localBaseURL = new BaseURL_type0[]{}; } //update the setting tracker localBaseURLTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localBaseURL); list.add(param); this.localBaseURL = (BaseURL_type0[])list.toArray( new BaseURL_type0[list.size()]); } /** * field for SetType * This was an Attribute! */ protected java.lang.String localSetType ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSetType(){ return localSetType; } /** * Auto generated setter method * @param param SetType */ public void setSetType(java.lang.String param){ this.localSetType=param; } /** * field for SetDepth * This was an Attribute! */ protected java.lang.String localSetDepth ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSetDepth(){ return localSetDepth; } /** * Auto generated setter method * @param param SetDepth */ public void setSetDepth(java.lang.String param){ this.localSetDepth=param; } /** * field for SpecVersion * This was an Attribute! */ protected java.lang.String localSpecVersion ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSpecVersion(){ return localSpecVersion; } /** * Auto generated setter method * @param param SpecVersion */ public void setSpecVersion(java.lang.String param){ this.localSpecVersion=param; } /** * field for DbSnpBuild * This was an Attribute! */ protected int localDbSnpBuild ; /** * Auto generated getter method * @return int */ public int getDbSnpBuild(){ return localDbSnpBuild; } /** * Auto generated setter method * @param param DbSnpBuild */ public void setDbSnpBuild(int param){ this.localDbSnpBuild=param; } /** * field for Generated * This was an Attribute! */ protected java.lang.String localGenerated ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getGenerated(){ return localGenerated; } /** * Auto generated setter method * @param param Generated */ public void setGenerated(java.lang.String param){ this.localGenerated=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":ExchangeSet", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "ExchangeSet", xmlWriter); } } if (localSetType != null){ writeAttribute("", "setType", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetType), xmlWriter); } if (localSetDepth != null){ writeAttribute("", "setDepth", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetDepth), xmlWriter); } if (localSpecVersion != null){ writeAttribute("", "specVersion", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpecVersion), xmlWriter); } if (localDbSnpBuild!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "dbSnpBuild", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild), xmlWriter); } if (localGenerated != null){ writeAttribute("", "generated", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenerated), xmlWriter); } if (localSourceDatabaseTracker){ if (localSourceDatabase==null){ throw new org.apache.axis2.databinding.ADBException("SourceDatabase cannot be null!!"); } localSourceDatabase.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SourceDatabase"), xmlWriter); } if (localRsTracker){ if (localRs!=null){ for (int i = 0;i < localRs.length;i++){ if (localRs[i] != null){ localRs[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Rs cannot be null!!"); } } if (localAssayTracker){ if (localAssay==null){ throw new org.apache.axis2.databinding.ADBException("Assay cannot be null!!"); } localAssay.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assay"), xmlWriter); } if (localQueryTracker){ if (localQuery==null){ throw new org.apache.axis2.databinding.ADBException("Query cannot be null!!"); } localQuery.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Query"), xmlWriter); } if (localSummaryTracker){ if (localSummary==null){ throw new org.apache.axis2.databinding.ADBException("Summary cannot be null!!"); } localSummary.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Summary"), xmlWriter); } if (localBaseURLTracker){ if (localBaseURL!=null){ for (int i = 0;i < localBaseURL.length;i++){ if (localBaseURL[i] != null){ localBaseURL[i].serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL"), xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("BaseURL cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localSourceDatabaseTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "SourceDatabase")); if (localSourceDatabase==null){ throw new org.apache.axis2.databinding.ADBException("SourceDatabase cannot be null!!"); } elementList.add(localSourceDatabase); } if (localRsTracker){ if (localRs!=null) { for (int i = 0;i < localRs.length;i++){ if (localRs[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Rs")); elementList.add(localRs[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("Rs cannot be null!!"); } } if (localAssayTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Assay")); if (localAssay==null){ throw new org.apache.axis2.databinding.ADBException("Assay cannot be null!!"); } elementList.add(localAssay); } if (localQueryTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Query")); if (localQuery==null){ throw new org.apache.axis2.databinding.ADBException("Query cannot be null!!"); } elementList.add(localQuery); } if (localSummaryTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Summary")); if (localSummary==null){ throw new org.apache.axis2.databinding.ADBException("Summary cannot be null!!"); } elementList.add(localSummary); } if (localBaseURLTracker){ if (localBaseURL!=null) { for (int i = 0;i < localBaseURL.length;i++){ if (localBaseURL[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "BaseURL")); elementList.add(localBaseURL[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("BaseURL cannot be null!!"); } } attribList.add( new javax.xml.namespace.QName("","setType")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetType)); attribList.add( new javax.xml.namespace.QName("","setDepth")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSetDepth)); attribList.add( new javax.xml.namespace.QName("","specVersion")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpecVersion)); attribList.add( new javax.xml.namespace.QName("","dbSnpBuild")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDbSnpBuild)); attribList.add( new javax.xml.namespace.QName("","generated")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGenerated)); 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 ExchangeSet parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ ExchangeSet object = new ExchangeSet(); 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 (!"ExchangeSet".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (ExchangeSet)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(); // handle attribute "setType" java.lang.String tempAttribSetType = reader.getAttributeValue(null,"setType"); if (tempAttribSetType!=null){ java.lang.String content = tempAttribSetType; object.setSetType( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSetType)); } else { } handledAttributes.add("setType"); // handle attribute "setDepth" java.lang.String tempAttribSetDepth = reader.getAttributeValue(null,"setDepth"); if (tempAttribSetDepth!=null){ java.lang.String content = tempAttribSetDepth; object.setSetDepth( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSetDepth)); } else { } handledAttributes.add("setDepth"); // handle attribute "specVersion" java.lang.String tempAttribSpecVersion = reader.getAttributeValue(null,"specVersion"); if (tempAttribSpecVersion!=null){ java.lang.String content = tempAttribSpecVersion; object.setSpecVersion( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSpecVersion)); } else { } handledAttributes.add("specVersion"); // handle attribute "dbSnpBuild" java.lang.String tempAttribDbSnpBuild = reader.getAttributeValue(null,"dbSnpBuild"); if (tempAttribDbSnpBuild!=null){ java.lang.String content = tempAttribDbSnpBuild; object.setDbSnpBuild( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribDbSnpBuild)); } else { object.setDbSnpBuild(java.lang.Integer.MIN_VALUE); } handledAttributes.add("dbSnpBuild"); // handle attribute "generated" java.lang.String tempAttribGenerated = reader.getAttributeValue(null,"generated"); if (tempAttribGenerated!=null){ java.lang.String content = tempAttribGenerated; object.setGenerated( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribGenerated)); } else { } handledAttributes.add("generated"); reader.next(); java.util.ArrayList list2 = new java.util.ArrayList(); java.util.ArrayList list6 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","SourceDatabase").equals(reader.getName())){ object.setSourceDatabase(SourceDatabase_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs").equals(reader.getName())){ // Process the array and step past its final element's end. list2.add(Rs_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone2 = false; while(!loopDone2){ // We should be at the end element, but make sure 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 loopDone2 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Rs").equals(reader.getName())){ list2.add(Rs_type0.Factory.parse(reader)); }else{ loopDone2 = true; } } } // call the converter utility to convert and set the array object.setRs((Rs_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( Rs_type0.class, list2)); } // 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Assay").equals(reader.getName())){ object.setAssay(Assay_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Query").equals(reader.getName())){ object.setQuery(Query_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Summary").equals(reader.getName())){ object.setSummary(Summary_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL").equals(reader.getName())){ // Process the array and step past its final element's end. list6.add(BaseURL_type0.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone6 = false; while(!loopDone6){ // We should be at the end element, but make sure 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","BaseURL").equals(reader.getName())){ list6.add(BaseURL_type0.Factory.parse(reader)); }else{ loopDone6 = true; } } } // call the converter utility to convert and set the array object.setBaseURL((BaseURL_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( BaseURL_type0.class, list6)); } // 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 } public static class FxnSet implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "FxnSet", "ns1"); /** * field for FxnSet */ protected FxnSet_type0 localFxnSet ; /** * Auto generated getter method * @return FxnSet_type0 */ public FxnSet_type0 getFxnSet(){ return localFxnSet; } /** * Auto generated setter method * @param param FxnSet */ public void setFxnSet(FxnSet_type0 param){ this.localFxnSet=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localFxnSet==null){ throw new org.apache.axis2.databinding.ADBException("FxnSet cannot be null!"); } localFxnSet.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localFxnSet.getPullParser(MY_QNAME); } /** * 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 FxnSet parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ FxnSet object = new FxnSet(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","FxnSet").equals(reader.getName())){ object.setFxnSet(FxnSet_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class EFetchResult implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "eFetchResult", "ns1"); /** * field for ERROR */ protected java.lang.String localERROR ; /* 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 localERRORTracker = false ; public boolean isERRORSpecified(){ return localERRORTracker; } /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getERROR(){ return localERROR; } /** * Auto generated setter method * @param param ERROR */ public void setERROR(java.lang.String param){ localERRORTracker = param != null; this.localERROR=param; } /** * field for ExchangeSet */ protected ExchangeSet_type0 localExchangeSet ; /* 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 localExchangeSetTracker = false ; public boolean isExchangeSetSpecified(){ return localExchangeSetTracker; } /** * Auto generated getter method * @return ExchangeSet_type0 */ public ExchangeSet_type0 getExchangeSet(){ return localExchangeSet; } /** * Auto generated setter method * @param param ExchangeSet */ public void setExchangeSet(ExchangeSet_type0 param){ localExchangeSetTracker = param != null; this.localExchangeSet=param; } /** * field for IdList */ protected IdListType localIdList ; /* 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 localIdListTracker = false ; public boolean isIdListSpecified(){ return localIdListTracker; } /** * Auto generated getter method * @return IdListType */ public IdListType getIdList(){ return localIdList; } /** * Auto generated setter method * @param param IdList */ public void setIdList(IdListType param){ localIdListTracker = param != null; this.localIdList=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":eFetchResult", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "eFetchResult", xmlWriter); } } if (localERRORTracker){ namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "ERROR", xmlWriter); if (localERROR==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("ERROR cannot be null!!"); }else{ xmlWriter.writeCharacters(localERROR); } xmlWriter.writeEndElement(); } if (localExchangeSetTracker){ if (localExchangeSet==null){ throw new org.apache.axis2.databinding.ADBException("ExchangeSet cannot be null!!"); } localExchangeSet.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","ExchangeSet"), xmlWriter); } if (localIdListTracker){ if (localIdList==null){ throw new org.apache.axis2.databinding.ADBException("IdList cannot be null!!"); } localIdList.serialize(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","IdList"), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localERRORTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "ERROR")); if (localERROR != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localERROR)); } else { throw new org.apache.axis2.databinding.ADBException("ERROR cannot be null!!"); } } if (localExchangeSetTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "ExchangeSet")); if (localExchangeSet==null){ throw new org.apache.axis2.databinding.ADBException("ExchangeSet cannot be null!!"); } elementList.add(localExchangeSet); } if (localIdListTracker){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "IdList")); if (localIdList==null){ throw new org.apache.axis2.databinding.ADBException("IdList cannot be null!!"); } elementList.add(localIdList); } 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 EFetchResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ EFetchResult object = new EFetchResult(); 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 (!"eFetchResult".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (EFetchResult)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(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","ERROR").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: "+"ERROR" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setERROR( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","ExchangeSet").equals(reader.getName())){ object.setExchangeSet(ExchangeSet_type0.Factory.parse(reader)); 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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","IdList").equals(reader.getName())){ object.setIdList(IdListType.Factory.parse(reader)); 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 } public static class AlleleOrigin_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = AlleleOrigin_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Integer */ protected java.math.BigInteger localInteger ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getInteger(){ return localInteger; } /** * Auto generated setter method * @param param Integer */ public void setInteger(java.math.BigInteger param){ this.localInteger=param; } public java.lang.String toString(){ return localInteger.toString(); } /** * field for Allele * This was an Attribute! */ protected java.lang.String localAllele ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getAllele(){ return localAllele; } /** * Auto generated setter method * @param param Allele */ public void setAllele(java.lang.String param){ this.localAllele=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":AlleleOrigin_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "AlleleOrigin_type0", xmlWriter); } } if (localAllele != null){ writeAttribute("", "allele", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele), xmlWriter); } if (localInteger==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("integer cannot be null!!"); }else{ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInteger)); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT); if (localInteger != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInteger)); } else { throw new org.apache.axis2.databinding.ADBException("integer cannot be null!!"); } attribList.add( new javax.xml.namespace.QName("","allele")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllele)); 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{ public static AlleleOrigin_type0 fromString(java.lang.String value, java.lang.String namespaceURI){ AlleleOrigin_type0 returnValue = new AlleleOrigin_type0(); returnValue.setInteger( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(value)); return returnValue; } public static AlleleOrigin_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return AlleleOrigin_type0.Factory.fromString(content,namespaceUri); } else { return AlleleOrigin_type0.Factory.fromString(content,""); } } /** * 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 AlleleOrigin_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ AlleleOrigin_type0 object = new AlleleOrigin_type0(); 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 (!"AlleleOrigin_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (AlleleOrigin_type0)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(); // handle attribute "allele" java.lang.String tempAttribAllele = reader.getAttributeValue(null,"allele"); if (tempAttribAllele!=null){ java.lang.String content = tempAttribAllele; object.setAllele( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribAllele)); } else { } handledAttributes.add("allele"); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ if (reader.isStartElement() || reader.hasText()){ 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: "+"integer" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setInteger( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(content)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Phenotype_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Phenotype_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for PhenotypeSequence * This was an Array! */ protected PhenotypeSequence[] localPhenotypeSequence ; /* 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 localPhenotypeSequenceTracker = false ; public boolean isPhenotypeSequenceSpecified(){ return localPhenotypeSequenceTracker; } /** * Auto generated getter method * @return PhenotypeSequence[] */ public PhenotypeSequence[] getPhenotypeSequence(){ return localPhenotypeSequence; } /** * validate the array for PhenotypeSequence */ protected void validatePhenotypeSequence(PhenotypeSequence[] param){ } /** * Auto generated setter method * @param param PhenotypeSequence */ public void setPhenotypeSequence(PhenotypeSequence[] param){ validatePhenotypeSequence(param); localPhenotypeSequenceTracker = param != null; this.localPhenotypeSequence=param; } /** * Auto generated add method for the array for convenience * @param param PhenotypeSequence */ public void addPhenotypeSequence(PhenotypeSequence param){ if (localPhenotypeSequence == null){ localPhenotypeSequence = new PhenotypeSequence[]{}; } //update the setting tracker localPhenotypeSequenceTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localPhenotypeSequence); list.add(param); this.localPhenotypeSequence = (PhenotypeSequence[])list.toArray( new PhenotypeSequence[list.size()]); } /** * * @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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Phenotype_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Phenotype_type0", xmlWriter); } } if (localPhenotypeSequenceTracker){ if (localPhenotypeSequence!=null){ for (int i = 0;i < localPhenotypeSequence.length;i++){ if (localPhenotypeSequence[i] != null){ localPhenotypeSequence[i].serialize(null,xmlWriter); } else { // we don't have to do any thing since minOccures is zero } } } else { throw new org.apache.axis2.databinding.ADBException("PhenotypeSequence cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localPhenotypeSequenceTracker){ if (localPhenotypeSequence!=null) { for (int i = 0;i < localPhenotypeSequence.length;i++){ if (localPhenotypeSequence[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "PhenotypeSequence")); elementList.add(localPhenotypeSequence[i]); } else { // nothing to do } } } else { throw new org.apache.axis2.databinding.ADBException("PhenotypeSequence cannot be null!!"); } } 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 Phenotype_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Phenotype_type0 object = new Phenotype_type0(); 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 (!"Phenotype_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Phenotype_type0)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 list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); try{ if (reader.isStartElement() ){ // Process the array and step past its final element's end. list1.add(PhenotypeSequence.Factory.parse(reader)); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // 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 loopDone1 = true; } else { list1.add(PhenotypeSequence.Factory.parse(reader)); } } // call the converter utility to convert and set the array object.setPhenotypeSequence((PhenotypeSequence[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray( PhenotypeSequence.class, list1)); } // End of if for expected property start element else { } } catch (java.lang.Exception e) {} 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 } public static class RsLinkout implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "RsLinkout", "ns1"); /** * field for RsLinkout */ protected RsLinkout_type0 localRsLinkout ; /** * Auto generated getter method * @return RsLinkout_type0 */ public RsLinkout_type0 getRsLinkout(){ return localRsLinkout; } /** * Auto generated setter method * @param param RsLinkout */ public void setRsLinkout(RsLinkout_type0 param){ this.localRsLinkout=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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it if (localRsLinkout==null){ throw new org.apache.axis2.databinding.ADBException("RsLinkout cannot be null!"); } localRsLinkout.serialize(MY_QNAME,xmlWriter); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return localRsLinkout.getPullParser(MY_QNAME); } /** * 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 RsLinkout parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ RsLinkout object = new RsLinkout(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() ){ if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","RsLinkout").equals(reader.getName())){ object.setRsLinkout(RsLinkout_type0.Factory.parse(reader)); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class IdListType implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = IdListType Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for Id * This was an Array! */ protected java.lang.String[] localId ; /* 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 localIdTracker = false ; public boolean isIdSpecified(){ return localIdTracker; } /** * Auto generated getter method * @return java.lang.String[] */ public java.lang.String[] getId(){ return localId; } /** * validate the array for Id */ protected void validateId(java.lang.String[] param){ } /** * Auto generated setter method * @param param Id */ public void setId(java.lang.String[] param){ validateId(param); localIdTracker = param != null; this.localId=param; } /** * Auto generated add method for the array for convenience * @param param java.lang.String */ public void addId(java.lang.String param){ if (localId == null){ localId = new java.lang.String[]{}; } //update the setting tracker localIdTracker = true; java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localId); list.add(param); this.localId = (java.lang.String[])list.toArray( new java.lang.String[list.size()]); } /** * * @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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":IdListType", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "IdListType", xmlWriter); } } if (localIdTracker){ if (localId!=null) { namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; for (int i = 0;i < localId.length;i++){ if (localId[i] != null){ writeStartElement(null, namespace, "Id", xmlWriter); xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId[i])); xmlWriter.writeEndElement(); } else { // we have to do nothing since minOccurs is zero } } } else { throw new org.apache.axis2.databinding.ADBException("Id cannot be null!!"); } } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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 (localIdTracker){ if (localId!=null){ for (int i = 0;i < localId.length;i++){ if (localId[i] != null){ elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "Id")); elementList.add( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localId[i])); } else { // have to do nothing } } } else { throw new org.apache.axis2.databinding.ADBException("Id cannot be null!!"); } } 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 IdListType parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ IdListType object = new IdListType(); 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 (!"IdListType".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (IdListType)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 list1 = new java.util.ArrayList(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Id").equals(reader.getName())){ // Process the array and step past its final element's end. list1.add(reader.getElementText()); //loop until we find a start element that is not part of this array boolean loopDone1 = false; while(!loopDone1){ // 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 loopDone1 = true; } else { if (new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","Id").equals(reader.getName())){ list1.add(reader.getElementText()); }else{ loopDone1 = true; } } } // call the converter utility to convert and set the array object.setId((java.lang.String[]) list1.toArray(new java.lang.String[list1.size()])); } // 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 } public static class PhenotypeSequenceE implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = PhenotypeSequence Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for ClinicalSignificance */ protected java.lang.String localClinicalSignificance ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getClinicalSignificance(){ return localClinicalSignificance; } /** * Auto generated setter method * @param param ClinicalSignificance */ public void setClinicalSignificance(java.lang.String param){ this.localClinicalSignificance=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; if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":PhenotypeSequence", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "PhenotypeSequence", xmlWriter); } } namespace = "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"; writeStartElement(null, namespace, "ClinicalSignificance", xmlWriter); if (localClinicalSignificance==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("ClinicalSignificance cannot be null!!"); }else{ xmlWriter.writeCharacters(localClinicalSignificance); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); elementList.add(new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "ClinicalSignificance")); if (localClinicalSignificance != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localClinicalSignificance)); } else { throw new org.apache.axis2.databinding.ADBException("ClinicalSignificance cannot be null!!"); } 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 PhenotypeSequenceE parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ PhenotypeSequenceE object = new PhenotypeSequenceE(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp","ClinicalSignificance").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: "+"ClinicalSignificance" +" cannot be null"); } java.lang.String content = reader.getElementText(); object.setClinicalSignificance( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else{ // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class Summary_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = Summary_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for NumRsIds * This was an Attribute! */ protected java.math.BigInteger localNumRsIds ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumRsIds(){ return localNumRsIds; } /** * Auto generated setter method * @param param NumRsIds */ public void setNumRsIds(java.math.BigInteger param){ this.localNumRsIds=param; } /** * field for TotalSeqLength * This was an Attribute! */ protected java.math.BigInteger localTotalSeqLength ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getTotalSeqLength(){ return localTotalSeqLength; } /** * Auto generated setter method * @param param TotalSeqLength */ public void setTotalSeqLength(java.math.BigInteger param){ this.localTotalSeqLength=param; } /** * field for NumContigHits * This was an Attribute! */ protected java.math.BigInteger localNumContigHits ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumContigHits(){ return localNumContigHits; } /** * Auto generated setter method * @param param NumContigHits */ public void setNumContigHits(java.math.BigInteger param){ this.localNumContigHits=param; } /** * field for NumGeneHits * This was an Attribute! */ protected java.math.BigInteger localNumGeneHits ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumGeneHits(){ return localNumGeneHits; } /** * Auto generated setter method * @param param NumGeneHits */ public void setNumGeneHits(java.math.BigInteger param){ this.localNumGeneHits=param; } /** * field for NumGiHits * This was an Attribute! */ protected java.math.BigInteger localNumGiHits ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumGiHits(){ return localNumGiHits; } /** * Auto generated setter method * @param param NumGiHits */ public void setNumGiHits(java.math.BigInteger param){ this.localNumGiHits=param; } /** * field for Num3DStructs * This was an Attribute! */ protected java.math.BigInteger localNum3DStructs ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNum3DStructs(){ return localNum3DStructs; } /** * Auto generated setter method * @param param Num3DStructs */ public void setNum3DStructs(java.math.BigInteger param){ this.localNum3DStructs=param; } /** * field for NumAlleleFreqs * This was an Attribute! */ protected java.math.BigInteger localNumAlleleFreqs ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumAlleleFreqs(){ return localNumAlleleFreqs; } /** * Auto generated setter method * @param param NumAlleleFreqs */ public void setNumAlleleFreqs(java.math.BigInteger param){ this.localNumAlleleFreqs=param; } /** * field for NumStsHits * This was an Attribute! */ protected java.math.BigInteger localNumStsHits ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumStsHits(){ return localNumStsHits; } /** * Auto generated setter method * @param param NumStsHits */ public void setNumStsHits(java.math.BigInteger param){ this.localNumStsHits=param; } /** * field for NumUnigeneCids * This was an Attribute! */ protected java.math.BigInteger localNumUnigeneCids ; /** * Auto generated getter method * @return java.math.BigInteger */ public java.math.BigInteger getNumUnigeneCids(){ return localNumUnigeneCids; } /** * Auto generated setter method * @param param NumUnigeneCids */ public void setNumUnigeneCids(java.math.BigInteger param){ this.localNumUnigeneCids=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":Summary_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "Summary_type0", xmlWriter); } } if (localNumRsIds != null){ writeAttribute("", "numRsIds", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumRsIds), xmlWriter); } if (localTotalSeqLength != null){ writeAttribute("", "totalSeqLength", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTotalSeqLength), xmlWriter); } if (localNumContigHits != null){ writeAttribute("", "numContigHits", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumContigHits), xmlWriter); } if (localNumGeneHits != null){ writeAttribute("", "numGeneHits", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumGeneHits), xmlWriter); } if (localNumGiHits != null){ writeAttribute("", "numGiHits", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumGiHits), xmlWriter); } if (localNum3DStructs != null){ writeAttribute("", "num3dStructs", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNum3DStructs), xmlWriter); } if (localNumAlleleFreqs != null){ writeAttribute("", "numAlleleFreqs", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumAlleleFreqs), xmlWriter); } if (localNumStsHits != null){ writeAttribute("", "numStsHits", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumStsHits), xmlWriter); } if (localNumUnigeneCids != null){ writeAttribute("", "numUnigeneCids", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumUnigeneCids), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","numRsIds")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumRsIds)); attribList.add( new javax.xml.namespace.QName("","totalSeqLength")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTotalSeqLength)); attribList.add( new javax.xml.namespace.QName("","numContigHits")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumContigHits)); attribList.add( new javax.xml.namespace.QName("","numGeneHits")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumGeneHits)); attribList.add( new javax.xml.namespace.QName("","numGiHits")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumGiHits)); attribList.add( new javax.xml.namespace.QName("","num3dStructs")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNum3DStructs)); attribList.add( new javax.xml.namespace.QName("","numAlleleFreqs")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumAlleleFreqs)); attribList.add( new javax.xml.namespace.QName("","numStsHits")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumStsHits)); attribList.add( new javax.xml.namespace.QName("","numUnigeneCids")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNumUnigeneCids)); 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 Summary_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ Summary_type0 object = new Summary_type0(); 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 (!"Summary_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (Summary_type0)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(); // handle attribute "numRsIds" java.lang.String tempAttribNumRsIds = reader.getAttributeValue(null,"numRsIds"); if (tempAttribNumRsIds!=null){ java.lang.String content = tempAttribNumRsIds; object.setNumRsIds( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumRsIds)); } else { } handledAttributes.add("numRsIds"); // handle attribute "totalSeqLength" java.lang.String tempAttribTotalSeqLength = reader.getAttributeValue(null,"totalSeqLength"); if (tempAttribTotalSeqLength!=null){ java.lang.String content = tempAttribTotalSeqLength; object.setTotalSeqLength( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribTotalSeqLength)); } else { } handledAttributes.add("totalSeqLength"); // handle attribute "numContigHits" java.lang.String tempAttribNumContigHits = reader.getAttributeValue(null,"numContigHits"); if (tempAttribNumContigHits!=null){ java.lang.String content = tempAttribNumContigHits; object.setNumContigHits( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumContigHits)); } else { } handledAttributes.add("numContigHits"); // handle attribute "numGeneHits" java.lang.String tempAttribNumGeneHits = reader.getAttributeValue(null,"numGeneHits"); if (tempAttribNumGeneHits!=null){ java.lang.String content = tempAttribNumGeneHits; object.setNumGeneHits( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumGeneHits)); } else { } handledAttributes.add("numGeneHits"); // handle attribute "numGiHits" java.lang.String tempAttribNumGiHits = reader.getAttributeValue(null,"numGiHits"); if (tempAttribNumGiHits!=null){ java.lang.String content = tempAttribNumGiHits; object.setNumGiHits( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumGiHits)); } else { } handledAttributes.add("numGiHits"); // handle attribute "num3dStructs" java.lang.String tempAttribNum3DStructs = reader.getAttributeValue(null,"num3dStructs"); if (tempAttribNum3DStructs!=null){ java.lang.String content = tempAttribNum3DStructs; object.setNum3DStructs( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNum3DStructs)); } else { } handledAttributes.add("num3dStructs"); // handle attribute "numAlleleFreqs" java.lang.String tempAttribNumAlleleFreqs = reader.getAttributeValue(null,"numAlleleFreqs"); if (tempAttribNumAlleleFreqs!=null){ java.lang.String content = tempAttribNumAlleleFreqs; object.setNumAlleleFreqs( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumAlleleFreqs)); } else { } handledAttributes.add("numAlleleFreqs"); // handle attribute "numStsHits" java.lang.String tempAttribNumStsHits = reader.getAttributeValue(null,"numStsHits"); if (tempAttribNumStsHits!=null){ java.lang.String content = tempAttribNumStsHits; object.setNumStsHits( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumStsHits)); } else { } handledAttributes.add("numStsHits"); // handle attribute "numUnigeneCids" java.lang.String tempAttribNumUnigeneCids = reader.getAttributeValue(null,"numUnigeneCids"); if (tempAttribNumUnigeneCids!=null){ java.lang.String content = tempAttribNumUnigeneCids; object.setNumUnigeneCids( org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger(tempAttribNumUnigeneCids)); } else { } handledAttributes.add("numUnigeneCids"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class MergeHistory_type0 implements org.apache.axis2.databinding.ADBBean{ /* This type was generated from the piece of schema that had name = MergeHistory_type0 Namespace URI = http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp Namespace Prefix = ns1 */ /** * field for RsId * This was an Attribute! */ protected int localRsId ; /** * Auto generated getter method * @return int */ public int getRsId(){ return localRsId; } /** * Auto generated setter method * @param param RsId */ public void setRsId(int param){ this.localRsId=param; } /** * field for BuildId * This was an Attribute! */ protected int localBuildId ; /** * Auto generated getter method * @return int */ public int getBuildId(){ return localBuildId; } /** * Auto generated setter method * @param param BuildId */ public void setBuildId(int param){ this.localBuildId=param; } /** * field for OrientFlip * This was an Attribute! */ protected boolean localOrientFlip ; /** * Auto generated getter method * @return boolean */ public boolean getOrientFlip(){ return localOrientFlip; } /** * Auto generated setter method * @param param OrientFlip */ public void setOrientFlip(boolean param){ this.localOrientFlip=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://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":MergeHistory_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "MergeHistory_type0", xmlWriter); } } if (localRsId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "rsId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsId), xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("required attribute localRsId is null"); } if (localBuildId!=java.lang.Integer.MIN_VALUE) { writeAttribute("", "buildId", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuildId), xmlWriter); } if (true) { writeAttribute("", "orientFlip", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrientFlip), xmlWriter); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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(); attribList.add( new javax.xml.namespace.QName("","rsId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localRsId)); attribList.add( new javax.xml.namespace.QName("","buildId")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBuildId)); attribList.add( new javax.xml.namespace.QName("","orientFlip")); attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOrientFlip)); 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 MergeHistory_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ MergeHistory_type0 object = new MergeHistory_type0(); 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 (!"MergeHistory_type0".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (MergeHistory_type0)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(); // handle attribute "rsId" java.lang.String tempAttribRsId = reader.getAttributeValue(null,"rsId"); if (tempAttribRsId!=null){ java.lang.String content = tempAttribRsId; object.setRsId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribRsId)); } else { throw new org.apache.axis2.databinding.ADBException("Required attribute rsId is missing"); } handledAttributes.add("rsId"); // handle attribute "buildId" java.lang.String tempAttribBuildId = reader.getAttributeValue(null,"buildId"); if (tempAttribBuildId!=null){ java.lang.String content = tempAttribBuildId; object.setBuildId( org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribBuildId)); } else { object.setBuildId(java.lang.Integer.MIN_VALUE); } handledAttributes.add("buildId"); // handle attribute "orientFlip" java.lang.String tempAttribOrientFlip = reader.getAttributeValue(null,"orientFlip"); if (tempAttribOrientFlip!=null){ java.lang.String content = tempAttribOrientFlip; object.setOrientFlip( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(tempAttribOrientFlip)); } else { } handledAttributes.add("orientFlip"); reader.next(); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } public static class SubSnpClass_type0 implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp", "subSnpClass_type0", "ns1"); /** * field for SubSnpClass_type0 */ protected java.lang.String localSubSnpClass_type0 ; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected SubSnpClass_type0(java.lang.String value, boolean isRegisterValue) { localSubSnpClass_type0 = value; if (isRegisterValue){ _table_.put(localSubSnpClass_type0, this); } } public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("snp"); public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("in-del"); public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("heterozygous"); public static final java.lang.String _value4 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("microsatellite"); public static final java.lang.String _value5 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("named-locus"); public static final java.lang.String _value6 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("no-variation"); public static final java.lang.String _value7 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("mixed"); public static final java.lang.String _value8 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("multinucleotide-polymorphism"); public static final SubSnpClass_type0 value1 = new SubSnpClass_type0(_value1,true); public static final SubSnpClass_type0 value2 = new SubSnpClass_type0(_value2,true); public static final SubSnpClass_type0 value3 = new SubSnpClass_type0(_value3,true); public static final SubSnpClass_type0 value4 = new SubSnpClass_type0(_value4,true); public static final SubSnpClass_type0 value5 = new SubSnpClass_type0(_value5,true); public static final SubSnpClass_type0 value6 = new SubSnpClass_type0(_value6,true); public static final SubSnpClass_type0 value7 = new SubSnpClass_type0(_value7,true); public static final SubSnpClass_type0 value8 = new SubSnpClass_type0(_value8,true); public java.lang.String getValue() { return localSubSnpClass_type0;} public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return localSubSnpClass_type0.toString(); } /** * * @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,MY_QNAME); return factory.createOMElement(dataSource,MY_QNAME); } 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{ //We can safely assume an element has only one type associated with it java.lang.String namespace = parentQName.getNamespaceURI(); java.lang.String _localName = parentQName.getLocalPart(); writeStartElement(null, namespace, _localName, xmlWriter); // add the type details if this is used in a simple type if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":subSnpClass_type0", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "subSnpClass_type0", xmlWriter); } } if (localSubSnpClass_type0==null){ throw new org.apache.axis2.databinding.ADBException("subSnpClass_type0 cannot be null !!"); }else{ xmlWriter.writeCharacters(localSubSnpClass_type0); } xmlWriter.writeEndElement(); } private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_snp")){ 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); javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext(); while (true) { java.lang.String uri = nsContext.getNamespaceURI(prefix); if (uri == null || uri.length() == 0) { break; } 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{ //We can safely assume an element has only one type associated with it return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME, new java.lang.Object[]{ org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT, org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSubSnpClass_type0) }, null); } /** * Factory class that keeps the parse method */ public static class Factory{ public static SubSnpClass_type0 fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { SubSnpClass_type0 enumeration = (SubSnpClass_type0) _table_.get(value); if ((enumeration == null) && !((value == null) || (value.equals("")))) { throw new java.lang.IllegalArgumentException(); } return enumeration; } public static SubSnpClass_type0 fromString(java.lang.String value,java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { try { return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); } catch (java.lang.Exception e) { throw new java.lang.IllegalArgumentException(); } } public static SubSnpClass_type0 fromString(javax.xml.stream.XMLStreamReader xmlStreamReader, java.lang.String content) { if (content.indexOf(":") > -1){ java.lang.String prefix = content.substring(0,content.indexOf(":")); java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); return SubSnpClass_type0.Factory.fromString(content,namespaceUri); } else { return SubSnpClass_type0.Factory.fromString(content,""); } } /** * 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 SubSnpClass_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ SubSnpClass_type0 object = null; // initialize a hash map to keep values java.util.Map attributeMap = new java.util.HashMap(); java.util.List extraAttributeList = new java.util.ArrayList(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); while(!reader.isEndElement()) { if (reader.isStartElement() || reader.hasText()){ 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: "+"subSnpClass_type0" +" cannot be null"); } java.lang.String content = reader.getElementText(); if (content.indexOf(":") > 0) { // this seems to be a Qname so find the namespace and send prefix = content.substring(0, content.indexOf(":")); namespaceuri = reader.getNamespaceURI(prefix); object = SubSnpClass_type0.Factory.fromString(content,namespaceuri); } else { // this seems to be not a qname send and empty namespace incase of it is // check is done in fromString method object = SubSnpClass_type0.Factory.fromString(content,""); } } else { reader.next(); } } // end of while loop } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class } private org.apache.axiom.om.OMElement toOM(gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest param, boolean optimizeContent) throws org.apache.axis2.AxisFault { try{ return param.getOMElement(gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest.MY_QNAME, org.apache.axiom.om.OMAbstractFactory.getOMFactory()); } catch(org.apache.axis2.databinding.ADBException e){ throw org.apache.axis2.AxisFault.makeFault(e); } } private org.apache.axiom.om.OMElement toOM(gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult param, boolean optimizeContent) throws org.apache.axis2.AxisFault { try{ return param.getOMElement(gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult.MY_QNAME, org.apache.axiom.om.OMAbstractFactory.getOMFactory()); } catch(org.apache.axis2.databinding.ADBException e){ throw org.apache.axis2.AxisFault.makeFault(e); } } private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest param, boolean optimizeContent, javax.xml.namespace.QName methodQName) throws org.apache.axis2.AxisFault{ try{ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); emptyEnvelope.getBody().addChild(param.getOMElement(gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest.MY_QNAME,factory)); return emptyEnvelope; } catch(org.apache.axis2.databinding.ADBException e){ throw org.apache.axis2.AxisFault.makeFault(e); } } /* methods to provide back word compatibility */ /** * get the default envelope */ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ return factory.getDefaultEnvelope(); } private java.lang.Object fromOM( org.apache.axiom.om.OMElement param, java.lang.Class type, java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ try { if (gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest.class.equals(type)){ return gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchRequest.Factory.parse(param.getXMLStreamReaderWithoutCaching()); } if (gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult.class.equals(type)){ return gov.nih.nlm.ncbi.www.soap.eutils.EFetchSnpServiceStub.EFetchResult.Factory.parse(param.getXMLStreamReaderWithoutCaching()); } } catch (java.lang.Exception e) { throw org.apache.axis2.AxisFault.makeFault(e); } return null; } }