| // Licensed to the Apache Software Foundation (ASF) under one | |
| // or more contributor license agreements. See the NOTICE file | |
| // distributed with this work for additional information | |
| // regarding copyright ownership. The ASF licenses this file | |
| // to you under the Apache License, Version 2.0 (the | |
| // "License"); you may not use this file except in compliance | |
| // with the License. You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, | |
| // software distributed under the License is distributed on an | |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| // KIND, either express or implied. See the License for the | |
| // specific language governing permissions and limitations | |
| // under the License. | |
| /** | |
| * AmazonS3Stub.java | |
| * | |
| * This file was auto-generated from WSDL | |
| * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) | |
| */ | |
| package com.amazon.s3.client; | |
| /* | |
| * AmazonS3Stub java implementation | |
| */ | |
| public class AmazonS3Stub extends org.apache.axis2.client.Stub { | |
| protected org.apache.axis2.description.AxisOperation[] _operations; | |
| //hashmaps to keep the fault mapping | |
| private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); | |
| private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); | |
| private final 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(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("AmazonS3" + getUniqueSuffix()); | |
| addAnonymousOperations(); | |
| //creating the operations | |
| org.apache.axis2.description.AxisOperation __operation; | |
| _operations = new org.apache.axis2.description.AxisOperation[16]; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketLoggingStatus")); | |
| _service.addOperation(__operation); | |
| _operations[0] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "copyObject")); | |
| _service.addOperation(__operation); | |
| _operations[1] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getBucketAccessControlPolicy")); | |
| _service.addOperation(__operation); | |
| _operations[2] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listBucket")); | |
| _service.addOperation(__operation); | |
| _operations[3] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObject")); | |
| _service.addOperation(__operation); | |
| _operations[4] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "createBucket")); | |
| _service.addOperation(__operation); | |
| _operations[5] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "listAllMyBuckets")); | |
| _service.addOperation(__operation); | |
| _operations[6] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObject")); | |
| _service.addOperation(__operation); | |
| _operations[7] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteBucket")); | |
| _service.addOperation(__operation); | |
| _operations[8] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketLoggingStatus")); | |
| _service.addOperation(__operation); | |
| _operations[9] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectAccessControlPolicy")); | |
| _service.addOperation(__operation); | |
| _operations[10] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "deleteObject")); | |
| _service.addOperation(__operation); | |
| _operations[11] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setBucketAccessControlPolicy")); | |
| _service.addOperation(__operation); | |
| _operations[12] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "setObjectAccessControlPolicy")); | |
| _service.addOperation(__operation); | |
| _operations[13] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "putObjectInline")); | |
| _service.addOperation(__operation); | |
| _operations[14] = __operation; | |
| __operation = new org.apache.axis2.description.OutInAxisOperation(); | |
| __operation.setName(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "getObjectExtended")); | |
| _service.addOperation(__operation); | |
| _operations[15] = __operation; | |
| } | |
| //populates the faults | |
| private void populateFaults() { | |
| } | |
| /** | |
| *Constructor that takes in a configContext | |
| */ | |
| public AmazonS3Stub(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 AmazonS3Stub(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 AmazonS3Stub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { | |
| this(configurationContext, "http://s3.cloud.com/soap"); | |
| } | |
| /** | |
| * Default Constructor | |
| */ | |
| public AmazonS3Stub() throws org.apache.axis2.AxisFault { | |
| this("http://s3.cloud.com/soap"); | |
| } | |
| /** | |
| * Constructor taking the target endpoint | |
| */ | |
| public AmazonS3Stub(java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { | |
| this(null, targetEndpoint); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#getBucketLoggingStatus | |
| * @param getBucketLoggingStatus0 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse getBucketLoggingStatus( | |
| com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0) | |
| 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("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); | |
| _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()), getBucketLoggingStatus0, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getBucketLoggingStatus"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startgetBucketLoggingStatus | |
| * @param getBucketLoggingStatus0 | |
| */ | |
| public void startgetBucketLoggingStatus( | |
| com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus getBucketLoggingStatus0, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketLoggingStatusRequest"); | |
| _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()), getBucketLoggingStatus0, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getBucketLoggingStatus"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultgetBucketLoggingStatus((com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorgetBucketLoggingStatus(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorgetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketLoggingStatus(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorgetBucketLoggingStatus(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); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#copyObject | |
| * @param copyObject2 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse copyObject( | |
| com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); | |
| _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()), copyObject2, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "copyObject"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startcopyObject | |
| * @param copyObject2 | |
| */ | |
| public void startcopyObject( | |
| com.amazon.s3.client.AmazonS3Stub.CopyObject copyObject2, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CopyObjectRequest"); | |
| _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()), copyObject2, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "copyObject"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultcopyObject((com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorcopyObject(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorcopyObject(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcopyObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorcopyObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorcopyObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorcopyObject(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorcopyObject(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[1].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[1].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#getBucketAccessControlPolicy | |
| * @param getBucketAccessControlPolicy4 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse getBucketAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); | |
| _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()), getBucketAccessControlPolicy4, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getBucketAccessControlPolicy"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startgetBucketAccessControlPolicy | |
| * @param getBucketAccessControlPolicy4 | |
| */ | |
| public void startgetBucketAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy getBucketAccessControlPolicy4, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetBucketAccessControlPolicyRequest"); | |
| _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()), getBucketAccessControlPolicy4, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getBucketAccessControlPolicy"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultgetBucketAccessControlPolicy((com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorgetBucketAccessControlPolicy(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorgetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetBucketAccessControlPolicy(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorgetBucketAccessControlPolicy(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[2].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[2].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#listBucket | |
| * @param listBucket6 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.ListBucketResponse listBucket( | |
| com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); | |
| _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()), listBucket6, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "listBucket"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startlistBucket | |
| * @param listBucket6 | |
| */ | |
| public void startlistBucket( | |
| com.amazon.s3.client.AmazonS3Stub.ListBucket listBucket6, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListBucketRequest"); | |
| _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()), listBucket6, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "listBucket"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultlistBucket((com.amazon.s3.client.AmazonS3Stub.ListBucketResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorlistBucket(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorlistBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistBucket(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorlistBucket(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[3].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[3].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#putObject | |
| * @param putObject8 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.PutObjectResponse putObject( | |
| com.amazon.s3.client.AmazonS3Stub.PutObject putObject8) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); | |
| _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()), putObject8, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "putObject"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startputObject | |
| * @param putObject8 | |
| */ | |
| public void startputObject( | |
| com.amazon.s3.client.AmazonS3Stub.PutObject putObject8, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[4].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectRequest"); | |
| _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()), putObject8, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "putObject"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultputObject((com.amazon.s3.client.AmazonS3Stub.PutObjectResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorputObject(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorputObject(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObject(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorputObject(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[4].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[4].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#createBucket | |
| * @param createBucket10 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse createBucket( | |
| com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); | |
| _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()), createBucket10, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "createBucket"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startcreateBucket | |
| * @param createBucket10 | |
| */ | |
| public void startcreateBucket( | |
| com.amazon.s3.client.AmazonS3Stub.CreateBucket createBucket10, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/CreateBucketRequest"); | |
| _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()), createBucket10, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "createBucket"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultcreateBucket((com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorcreateBucket(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorcreateBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorcreateBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorcreateBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorcreateBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrorcreateBucket(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorcreateBucket(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[5].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[5].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#listAllMyBuckets | |
| * @param listAllMyBuckets12 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse listAllMyBuckets( | |
| com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); | |
| _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()), listAllMyBuckets12, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "listAllMyBuckets"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startlistAllMyBuckets | |
| * @param listAllMyBuckets12 | |
| */ | |
| public void startlistAllMyBuckets( | |
| com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets listAllMyBuckets12, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/ListAllMyBucketsRequest"); | |
| _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()), listAllMyBuckets12, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "listAllMyBuckets"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultlistAllMyBuckets((com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorlistAllMyBuckets(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorlistAllMyBuckets(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistAllMyBuckets(f); | |
| } | |
| } else { | |
| callback.receiveErrorlistAllMyBuckets(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorlistAllMyBuckets(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[6].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[6].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#getObject | |
| * @param getObject14 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.GetObjectResponse getObject( | |
| com.amazon.s3.client.AmazonS3Stub.GetObject getObject14) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); | |
| _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()), getObject14, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObject"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startgetObject | |
| * @param getObject14 | |
| */ | |
| public void startgetObject( | |
| com.amazon.s3.client.AmazonS3Stub.GetObject getObject14, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[7].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectRequest"); | |
| _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()), getObject14, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObject"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultgetObject((com.amazon.s3.client.AmazonS3Stub.GetObjectResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorgetObject(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorgetObject(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObject(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObject(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorgetObject(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[7].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[7].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#deleteBucket | |
| * @param deleteBucket16 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse deleteBucket( | |
| com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); | |
| _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()), deleteBucket16, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "deleteBucket"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startdeleteBucket | |
| * @param deleteBucket16 | |
| */ | |
| public void startdeleteBucket( | |
| com.amazon.s3.client.AmazonS3Stub.DeleteBucket deleteBucket16, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[8].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteBucketRequest"); | |
| _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()), deleteBucket16, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "deleteBucket"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultdeleteBucket((com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrordeleteBucket(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrordeleteBucket(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteBucket(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteBucket(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrordeleteBucket(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[8].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[8].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#setBucketLoggingStatus | |
| * @param setBucketLoggingStatus18 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse setBucketLoggingStatus( | |
| com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); | |
| _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()), setBucketLoggingStatus18, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setBucketLoggingStatus"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startsetBucketLoggingStatus | |
| * @param setBucketLoggingStatus18 | |
| */ | |
| public void startsetBucketLoggingStatus( | |
| com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus setBucketLoggingStatus18, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[9].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketLoggingStatusRequest"); | |
| _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()), setBucketLoggingStatus18, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setBucketLoggingStatus"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultsetBucketLoggingStatus((com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorsetBucketLoggingStatus(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorsetBucketLoggingStatus(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketLoggingStatus(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketLoggingStatus(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorsetBucketLoggingStatus(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[9].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[9].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#getObjectAccessControlPolicy | |
| * @param getObjectAccessControlPolicy20 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse getObjectAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); | |
| _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()), getObjectAccessControlPolicy20, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObjectAccessControlPolicy"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startgetObjectAccessControlPolicy | |
| * @param getObjectAccessControlPolicy20 | |
| */ | |
| public void startgetObjectAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy getObjectAccessControlPolicy20, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[10].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectAccessControlPolicyRequest"); | |
| _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()), getObjectAccessControlPolicy20, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObjectAccessControlPolicy"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultgetObjectAccessControlPolicy((com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorgetObjectAccessControlPolicy(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorgetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectAccessControlPolicy(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorgetObjectAccessControlPolicy(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[10].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[10].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#deleteObject | |
| * @param deleteObject22 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse deleteObject( | |
| com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); | |
| _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()), deleteObject22, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "deleteObject"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startdeleteObject | |
| * @param deleteObject22 | |
| */ | |
| public void startdeleteObject( | |
| com.amazon.s3.client.AmazonS3Stub.DeleteObject deleteObject22, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/DeleteObjectRequest"); | |
| _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()), deleteObject22, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "deleteObject"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultdeleteObject((com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrordeleteObject(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrordeleteObject(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrordeleteObject(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteObject(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteObject(f); | |
| } | |
| } else { | |
| callback.receiveErrordeleteObject(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrordeleteObject(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[11].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[11].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#setBucketAccessControlPolicy | |
| * @param setBucketAccessControlPolicy24 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); | |
| _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()), setBucketAccessControlPolicy24, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setBucketAccessControlPolicy"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startsetBucketAccessControlPolicy | |
| * @param setBucketAccessControlPolicy24 | |
| */ | |
| public void startsetBucketAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy setBucketAccessControlPolicy24, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[12].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetBucketAccessControlPolicyRequest"); | |
| _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()), setBucketAccessControlPolicy24, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setBucketAccessControlPolicy"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultsetBucketAccessControlPolicy((com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorsetBucketAccessControlPolicy(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorsetBucketAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetBucketAccessControlPolicy(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorsetBucketAccessControlPolicy(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[12].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[12].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#setObjectAccessControlPolicy | |
| * @param setObjectAccessControlPolicy26 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); | |
| _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()), setObjectAccessControlPolicy26, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setObjectAccessControlPolicy"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startsetObjectAccessControlPolicy | |
| * @param setObjectAccessControlPolicy26 | |
| */ | |
| public void startsetObjectAccessControlPolicy( | |
| com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy setObjectAccessControlPolicy26, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[13].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/SetObjectAccessControlPolicyRequest"); | |
| _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()), setObjectAccessControlPolicy26, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "setObjectAccessControlPolicy"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class, | |
| getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultsetObjectAccessControlPolicy((com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorsetObjectAccessControlPolicy(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorsetObjectAccessControlPolicy(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetObjectAccessControlPolicy(f); | |
| } | |
| } else { | |
| callback.receiveErrorsetObjectAccessControlPolicy(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorsetObjectAccessControlPolicy(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[13].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[13].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#putObjectInline | |
| * @param putObjectInline28 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse putObjectInline( | |
| com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); | |
| _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()), putObjectInline28, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "putObjectInline"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startputObjectInline | |
| * @param putObjectInline28 | |
| */ | |
| public void startputObjectInline( | |
| com.amazon.s3.client.AmazonS3Stub.PutObjectInline putObjectInline28, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[14].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/PutObjectInlineRequest"); | |
| _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()), putObjectInline28, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "putObjectInline"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultputObjectInline((com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorputObjectInline(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorputObjectInline(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorputObjectInline(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObjectInline(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObjectInline(f); | |
| } | |
| } else { | |
| callback.receiveErrorputObjectInline(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorputObjectInline(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[14].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[14].setMessageReceiver(_callbackReceiver); | |
| } | |
| //execute the operation client | |
| _operationClient.execute(false); | |
| } | |
| /** | |
| * Auto generated method signature | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#getObjectExtended | |
| * @param getObjectExtended30 | |
| */ | |
| public com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse getObjectExtended( | |
| com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30) | |
| throws java.rmi.RemoteException | |
| { | |
| org.apache.axis2.context.MessageContext _messageContext = null; | |
| try { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); | |
| _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()), getObjectExtended30, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObjectExtended"))); | |
| //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(), com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, getEnvelopeNamespaces(_returnEnv)); | |
| return (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object; | |
| } catch (org.apache.axis2.AxisFault f) { | |
| org.apache.axiom.om.OMElement faultElt = f.getDetail(); | |
| if (faultElt != null) { | |
| if (faultExceptionNameMap.containsKey(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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 { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } | |
| } | |
| /** | |
| * Auto generated method signature for Asynchronous Invocations | |
| * | |
| * @see com.amazon.s3.client.AmazonS3#startgetObjectExtended | |
| * @param getObjectExtended30 | |
| */ | |
| public void startgetObjectExtended( | |
| com.amazon.s3.client.AmazonS3Stub.GetObjectExtended getObjectExtended30, | |
| final com.amazon.s3.client.AmazonS3CallbackHandler callback) | |
| throws java.rmi.RemoteException { | |
| org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[15].getName()); | |
| _operationClient.getOptions().setAction("http://s3.amazonaws.com/doc/2006-03-01/AmazonS3/GetObjectExtendedRequest"); | |
| _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()), getObjectExtended30, optimizeContent(new javax.xml.namespace.QName( | |
| "http://s3.amazonaws.com/doc/2006-03-01/", "getObjectExtended"))); | |
| // 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() { | |
| @Override | |
| 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(), com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class, getEnvelopeNamespaces(resultEnv)); | |
| callback.receiveResultgetObjectExtended((com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse)object); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| callback.receiveErrorgetObjectExtended(e); | |
| } | |
| } | |
| @Override | |
| 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(faultElt.getQName())) { | |
| //make the fault by reflection | |
| try { | |
| java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName()); | |
| java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); | |
| java.lang.Exception ex = (java.lang.Exception)exceptionClass.newInstance(); | |
| //message class | |
| java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName()); | |
| 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.receiveErrorgetObjectExtended(new java.rmi.RemoteException(ex.getMessage(), ex)); | |
| } catch (java.lang.ClassCastException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (java.lang.ClassNotFoundException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (java.lang.NoSuchMethodException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (java.lang.reflect.InvocationTargetException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (java.lang.IllegalAccessException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (java.lang.InstantiationException e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } catch (org.apache.axis2.AxisFault e) { | |
| // we cannot intantiate the class - throw the original Axis fault | |
| callback.receiveErrorgetObjectExtended(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectExtended(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectExtended(f); | |
| } | |
| } else { | |
| callback.receiveErrorgetObjectExtended(error); | |
| } | |
| } | |
| @Override | |
| public void onFault(org.apache.axis2.context.MessageContext faultContext) { | |
| org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); | |
| onError(fault); | |
| } | |
| @Override | |
| public void onComplete() { | |
| try { | |
| _messageContext.getTransportOut().getSender().cleanup(_messageContext); | |
| } catch (org.apache.axis2.AxisFault axisFault) { | |
| callback.receiveErrorgetObjectExtended(axisFault); | |
| } | |
| } | |
| }); | |
| org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; | |
| if (_operations[15].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { | |
| _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); | |
| _operations[15].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 final 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://s3.cloud.com/soap | |
| public static class ListAllMyBuckets implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBuckets", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListAllMyBuckets.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListAllMyBuckets", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListAllMyBuckets", xmlWriter); | |
| } | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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 (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature 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 ListAllMyBuckets parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListAllMyBuckets object = new ListAllMyBuckets(); | |
| 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 (!"ListAllMyBuckets".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListAllMyBuckets)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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListAllMyBucketsEntry implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = ListAllMyBucketsEntry | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Name | |
| */ | |
| 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) { | |
| localName = param; | |
| } | |
| /** | |
| * field for CreationDate | |
| */ | |
| protected java.util.Calendar localCreationDate; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getCreationDate() { | |
| return localCreationDate; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CreationDate | |
| */ | |
| public void setCreationDate(java.util.Calendar param) { | |
| localCreationDate = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListAllMyBucketsEntry.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListAllMyBucketsEntry", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListAllMyBucketsEntry", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Name", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Name"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Name"); | |
| } | |
| if (localName == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localName); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "CreationDate", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "CreationDate"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("CreationDate"); | |
| } | |
| if (localCreationDate == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("CreationDate cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Name")); | |
| if (localName != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CreationDate")); | |
| if (localCreationDate != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCreationDate)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CreationDate 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 ListAllMyBucketsEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListAllMyBucketsEntry object = new ListAllMyBucketsEntry(); | |
| 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 (!"ListAllMyBucketsEntry".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListAllMyBucketsEntry)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://s3.amazonaws.com/doc/2006-03-01/", "Name").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setName(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CreationDate").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCreationDate(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListBucketResult implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = ListBucketResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Metadata | |
| * This was an Array! | |
| */ | |
| protected MetadataEntry[] localMetadata; | |
| /* 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 localMetadataTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataEntry[] | |
| */ | |
| public MetadataEntry[] getMetadata() { | |
| return localMetadata; | |
| } | |
| /** | |
| * validate the array for Metadata | |
| */ | |
| protected void validateMetadata(MetadataEntry[] param) { | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Metadata | |
| */ | |
| public void setMetadata(MetadataEntry[] param) { | |
| validateMetadata(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| } else { | |
| localMetadataTracker = false; | |
| } | |
| localMetadata = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param MetadataEntry | |
| */ | |
| public void addMetadata(MetadataEntry param) { | |
| if (localMetadata == null) { | |
| localMetadata = new MetadataEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); | |
| list.add(param); | |
| localMetadata = (MetadataEntry[])list.toArray(new MetadataEntry[list.size()]); | |
| } | |
| /** | |
| * field for Name | |
| */ | |
| 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) { | |
| localName = param; | |
| } | |
| /** | |
| * field for Prefix | |
| */ | |
| protected java.lang.String localPrefix; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getPrefix() { | |
| return localPrefix; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Prefix | |
| */ | |
| public void setPrefix(java.lang.String param) { | |
| localPrefix = param; | |
| } | |
| /** | |
| * field for Marker | |
| */ | |
| protected java.lang.String localMarker; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getMarker() { | |
| return localMarker; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Marker | |
| */ | |
| public void setMarker(java.lang.String param) { | |
| localMarker = param; | |
| } | |
| /** | |
| * field for NextMarker | |
| */ | |
| protected java.lang.String localNextMarker; | |
| /* 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 localNextMarkerTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getNextMarker() { | |
| return localNextMarker; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param NextMarker | |
| */ | |
| public void setNextMarker(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localNextMarkerTracker = true; | |
| } else { | |
| localNextMarkerTracker = false; | |
| } | |
| localNextMarker = param; | |
| } | |
| /** | |
| * field for MaxKeys | |
| */ | |
| protected int localMaxKeys; | |
| /** | |
| * Auto generated getter method | |
| * @return int | |
| */ | |
| public int getMaxKeys() { | |
| return localMaxKeys; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param MaxKeys | |
| */ | |
| public void setMaxKeys(int param) { | |
| localMaxKeys = param; | |
| } | |
| /** | |
| * field for Delimiter | |
| */ | |
| protected java.lang.String localDelimiter; | |
| /* 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 localDelimiterTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDelimiter() { | |
| return localDelimiter; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Delimiter | |
| */ | |
| public void setDelimiter(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localDelimiterTracker = true; | |
| } else { | |
| localDelimiterTracker = false; | |
| } | |
| localDelimiter = param; | |
| } | |
| /** | |
| * field for IsTruncated | |
| */ | |
| protected boolean localIsTruncated; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getIsTruncated() { | |
| return localIsTruncated; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param IsTruncated | |
| */ | |
| public void setIsTruncated(boolean param) { | |
| localIsTruncated = param; | |
| } | |
| /** | |
| * field for Contents | |
| * This was an Array! | |
| */ | |
| protected ListEntry[] localContents; | |
| /* 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 localContentsTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return ListEntry[] | |
| */ | |
| public ListEntry[] getContents() { | |
| return localContents; | |
| } | |
| /** | |
| * validate the array for Contents | |
| */ | |
| protected void validateContents(ListEntry[] param) { | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Contents | |
| */ | |
| public void setContents(ListEntry[] param) { | |
| validateContents(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localContentsTracker = true; | |
| } else { | |
| localContentsTracker = false; | |
| } | |
| localContents = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param ListEntry | |
| */ | |
| public void addContents(ListEntry param) { | |
| if (localContents == null) { | |
| localContents = new ListEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localContentsTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localContents); | |
| list.add(param); | |
| localContents = (ListEntry[])list.toArray(new ListEntry[list.size()]); | |
| } | |
| /** | |
| * field for CommonPrefixes | |
| * This was an Array! | |
| */ | |
| protected PrefixEntry[] localCommonPrefixes; | |
| /* 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 localCommonPrefixesTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return PrefixEntry[] | |
| */ | |
| public PrefixEntry[] getCommonPrefixes() { | |
| return localCommonPrefixes; | |
| } | |
| /** | |
| * validate the array for CommonPrefixes | |
| */ | |
| protected void validateCommonPrefixes(PrefixEntry[] param) { | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CommonPrefixes | |
| */ | |
| public void setCommonPrefixes(PrefixEntry[] param) { | |
| validateCommonPrefixes(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localCommonPrefixesTracker = true; | |
| } else { | |
| localCommonPrefixesTracker = false; | |
| } | |
| localCommonPrefixes = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param PrefixEntry | |
| */ | |
| public void addCommonPrefixes(PrefixEntry param) { | |
| if (localCommonPrefixes == null) { | |
| localCommonPrefixes = new PrefixEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localCommonPrefixesTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localCommonPrefixes); | |
| list.add(param); | |
| localCommonPrefixes = (PrefixEntry[])list.toArray(new PrefixEntry[list.size()]); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListBucketResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListBucketResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListBucketResult", xmlWriter); | |
| } | |
| } | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Name", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Name"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Name"); | |
| } | |
| if (localName == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localName); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Prefix", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Prefix"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Prefix"); | |
| } | |
| if (localPrefix == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localPrefix); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Marker", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Marker"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Marker"); | |
| } | |
| if (localMarker == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localMarker); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localNextMarkerTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "NextMarker", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "NextMarker"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("NextMarker"); | |
| } | |
| if (localNextMarker == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localNextMarker); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "MaxKeys", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "MaxKeys"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("MaxKeys"); | |
| } | |
| if (localMaxKeys == java.lang.Integer.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localDelimiterTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Delimiter", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Delimiter"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Delimiter"); | |
| } | |
| if (localDelimiter == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDelimiter); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "IsTruncated", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "IsTruncated"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("IsTruncated"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("IsTruncated cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localContentsTracker) { | |
| if (localContents != null) { | |
| for (int i = 0; i < localContents.length; i++) { | |
| if (localContents[i] != null) { | |
| localContents[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Contents"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); | |
| } | |
| } | |
| if (localCommonPrefixesTracker) { | |
| if (localCommonPrefixes != null) { | |
| for (int i = 0; i < localCommonPrefixes.length; i++) { | |
| if (localCommonPrefixes[i] != null) { | |
| localCommonPrefixes[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CommonPrefixes"), factory, | |
| xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CommonPrefixes cannot be null!!"); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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 (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata")); | |
| elementList.add(localMetadata[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Name")); | |
| if (localName != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Prefix")); | |
| if (localPrefix != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Marker")); | |
| if (localMarker != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); | |
| } | |
| if (localNextMarkerTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "NextMarker")); | |
| if (localNextMarker != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNextMarker)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("NextMarker cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MaxKeys")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); | |
| if (localDelimiterTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Delimiter")); | |
| if (localDelimiter != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IsTruncated")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIsTruncated)); | |
| if (localContentsTracker) { | |
| if (localContents != null) { | |
| for (int i = 0; i < localContents.length; i++) { | |
| if (localContents[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Contents")); | |
| elementList.add(localContents[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Contents cannot be null!!"); | |
| } | |
| } | |
| if (localCommonPrefixesTracker) { | |
| if (localCommonPrefixes != null) { | |
| for (int i = 0; i < localCommonPrefixes.length; i++) { | |
| if (localCommonPrefixes[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CommonPrefixes")); | |
| elementList.add(localCommonPrefixes[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CommonPrefixes 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 ListBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListBucketResult object = new ListBucketResult(); | |
| 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 (!"ListBucketResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListBucketResult)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 list9 = new java.util.ArrayList(); | |
| java.util.ArrayList list10 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list1.add(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| list1.add(MetadataEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone1 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setMetadata((MetadataEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Name").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setName(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Prefix").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setPrefix(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Marker").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setMarker(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "NextMarker").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setNextMarker(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://s3.amazonaws.com/doc/2006-03-01/", "MaxKeys").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setMaxKeys(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Delimiter").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDelimiter(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://s3.amazonaws.com/doc/2006-03-01/", "IsTruncated").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setIsTruncated(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Contents").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list9.add(ListEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Contents").equals(reader.getName())) { | |
| list9.add(ListEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone9 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setContents((ListEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(ListEntry.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://s3.amazonaws.com/doc/2006-03-01/", "CommonPrefixes").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list10.add(PrefixEntry.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://s3.amazonaws.com/doc/2006-03-01/", "CommonPrefixes").equals(reader.getName())) { | |
| list10.add(PrefixEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone10 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setCommonPrefixes((PrefixEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(PrefixEntry.class, list10)); | |
| } // 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class DeleteObject implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteObject", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| DeleteObject.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":DeleteObject", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DeleteObject", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 DeleteObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| DeleteObject object = new DeleteObject(); | |
| 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 (!"DeleteObject".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (DeleteObject)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListAllMyBucketsList implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = ListAllMyBucketsList | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| * This was an Array! | |
| */ | |
| protected ListAllMyBucketsEntry[] localBucket; | |
| /* 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 localBucketTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return ListAllMyBucketsEntry[] | |
| */ | |
| public ListAllMyBucketsEntry[] getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * validate the array for Bucket | |
| */ | |
| protected void validateBucket(ListAllMyBucketsEntry[] param) { | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(ListAllMyBucketsEntry[] param) { | |
| validateBucket(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localBucketTracker = true; | |
| } else { | |
| localBucketTracker = false; | |
| } | |
| localBucket = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param ListAllMyBucketsEntry | |
| */ | |
| public void addBucket(ListAllMyBucketsEntry param) { | |
| if (localBucket == null) { | |
| localBucket = new ListAllMyBucketsEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localBucketTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localBucket); | |
| list.add(param); | |
| localBucket = (ListAllMyBucketsEntry[])list.toArray(new ListAllMyBucketsEntry[list.size()]); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListAllMyBucketsList.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListAllMyBucketsList", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListAllMyBucketsList", xmlWriter); | |
| } | |
| } | |
| if (localBucketTracker) { | |
| if (localBucket != null) { | |
| for (int i = 0; i < localBucket.length; i++) { | |
| if (localBucket[i] != null) { | |
| localBucket[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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 (localBucketTracker) { | |
| if (localBucket != null) { | |
| for (int i = 0; i < localBucket.length; i++) { | |
| if (localBucket[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| elementList.add(localBucket[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket 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 ListAllMyBucketsList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListAllMyBucketsList object = new ListAllMyBucketsList(); | |
| 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 (!"ListAllMyBucketsList".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListAllMyBucketsList)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list1.add(ListAllMyBucketsEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| list1.add(ListAllMyBucketsEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone1 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setBucket((ListAllMyBucketsEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(ListAllMyBucketsEntry.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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PutObjectInline implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObjectInline", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for Metadata | |
| * This was an Array! | |
| */ | |
| protected MetadataEntry[] localMetadata; | |
| /* 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 localMetadataTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataEntry[] | |
| */ | |
| public MetadataEntry[] getMetadata() { | |
| return localMetadata; | |
| } | |
| /** | |
| * validate the array for Metadata | |
| */ | |
| protected void validateMetadata(MetadataEntry[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Metadata | |
| */ | |
| public void setMetadata(MetadataEntry[] param) { | |
| validateMetadata(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| } else { | |
| localMetadataTracker = false; | |
| } | |
| localMetadata = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param MetadataEntry | |
| */ | |
| public void addMetadata(MetadataEntry param) { | |
| if (localMetadata == null) { | |
| localMetadata = new MetadataEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); | |
| list.add(param); | |
| localMetadata = (MetadataEntry[])list.toArray(new MetadataEntry[list.size()]); | |
| } | |
| /** | |
| * field for Data | |
| */ | |
| protected javax.activation.DataHandler localData; | |
| /** | |
| * Auto generated getter method | |
| * @return javax.activation.DataHandler | |
| */ | |
| public javax.activation.DataHandler getData() { | |
| return localData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Data | |
| */ | |
| public void setData(javax.activation.DataHandler param) { | |
| localData = param; | |
| } | |
| /** | |
| * field for ContentLength | |
| */ | |
| protected long localContentLength; | |
| /** | |
| * Auto generated getter method | |
| * @return long | |
| */ | |
| public long getContentLength() { | |
| return localContentLength; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ContentLength | |
| */ | |
| public void setContentLength(long param) { | |
| localContentLength = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /* 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 localAccessControlListTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAccessControlListTracker = true; | |
| } else { | |
| localAccessControlListTracker = false; | |
| } | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for StorageClass | |
| */ | |
| protected StorageClass localStorageClass; | |
| /* 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 localStorageClassTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return StorageClass | |
| */ | |
| public StorageClass getStorageClass() { | |
| return localStorageClass; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param StorageClass | |
| */ | |
| public void setStorageClass(StorageClass param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localStorageClassTracker = true; | |
| } else { | |
| localStorageClassTracker = false; | |
| } | |
| localStorageClass = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PutObjectInline.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PutObjectInline", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PutObjectInline", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Data", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Data"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Data"); | |
| } | |
| if (localData != null) { | |
| xmlWriter.writeDataHandler(localData); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ContentLength", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ContentLength"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ContentLength"); | |
| } | |
| if (localContentLength == java.lang.Long.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAccessControlListTracker) { | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| } | |
| if (localStorageClassTracker) { | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass"), factory, xmlWriter); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata")); | |
| elementList.add(localMetadata[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Data")); | |
| elementList.add(localData); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ContentLength")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); | |
| if (localAccessControlListTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| } | |
| if (localStorageClassTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass")); | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| elementList.add(localStorageClass); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 PutObjectInline parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PutObjectInline object = new PutObjectInline(); | |
| 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 (!"PutObjectInline".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PutObjectInline)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 list3 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list3.add(MetadataEntry.Factory.parse(reader)); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone3 = false; | |
| while (!loopDone3) { | |
| // 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 | |
| loopDone3 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| list3.add(MetadataEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone3 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setMetadata((MetadataEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Data").equals(reader.getName())) { | |
| reader.next(); | |
| if (isReaderMTOMAware(reader) && java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) { | |
| //MTOM aware reader - get the datahandler directly and put it in the object | |
| object.setData((javax.activation.DataHandler)reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); | |
| } else { | |
| if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && | |
| reader.getName().equals( | |
| new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, | |
| org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) { | |
| java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); | |
| object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder)((org.apache.axiom.om.impl.llom.OMStAXWrapper)reader) | |
| .getBuilder()).getDataHandler(id)); | |
| reader.next(); | |
| reader.next(); | |
| } else if (reader.hasText()) { | |
| //Do the usual conversion | |
| java.lang.String content = reader.getText(); | |
| object.setData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); | |
| reader.next(); | |
| } | |
| } | |
| 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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ContentLength").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setContentLength(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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://s3.amazonaws.com/doc/2006-03-01/", "StorageClass").equals(reader.getName())) { | |
| object.setStorageClass(StorageClass.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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CreateBucketResult implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = CreateBucketResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for BucketName | |
| */ | |
| protected java.lang.String localBucketName; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucketName() { | |
| return localBucketName; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param BucketName | |
| */ | |
| public void setBucketName(java.lang.String param) { | |
| localBucketName = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CreateBucketResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CreateBucketResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CreateBucketResult", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "BucketName", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "BucketName"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("BucketName"); | |
| } | |
| if (localBucketName == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("BucketName cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucketName); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "BucketName")); | |
| if (localBucketName != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketName)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("BucketName 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 CreateBucketResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CreateBucketResult object = new CreateBucketResult(); | |
| 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 (!"CreateBucketResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CreateBucketResult)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://s3.amazonaws.com/doc/2006-03-01/", "BucketName").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucketName(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class Status implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = Status | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Code | |
| */ | |
| protected int localCode; | |
| /** | |
| * Auto generated getter method | |
| * @return int | |
| */ | |
| public int getCode() { | |
| return localCode; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Code | |
| */ | |
| public void setCode(int param) { | |
| localCode = param; | |
| } | |
| /** | |
| * field for Description | |
| */ | |
| protected java.lang.String localDescription; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDescription() { | |
| return localDescription; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Description | |
| */ | |
| public void setDescription(java.lang.String param) { | |
| localDescription = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| Status.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Status", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Status", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Code", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Code"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Code"); | |
| } | |
| if (localCode == java.lang.Integer.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("Code cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Description", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Description"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Description"); | |
| } | |
| if (localDescription == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Description cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDescription); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Code")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCode)); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Description")); | |
| if (localDescription != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescription)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Description 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 Status parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| Status object = new Status(); | |
| 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 (!"Status".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (Status)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://s3.amazonaws.com/doc/2006-03-01/", "Code").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCode(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Description").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDescription(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CreateBucketResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CreateBucketResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for CreateBucketReturn | |
| */ | |
| protected CreateBucketResult localCreateBucketReturn; | |
| /** | |
| * Auto generated getter method | |
| * @return CreateBucketResult | |
| */ | |
| public CreateBucketResult getCreateBucketReturn() { | |
| return localCreateBucketReturn; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CreateBucketReturn | |
| */ | |
| public void setCreateBucketReturn(CreateBucketResult param) { | |
| localCreateBucketReturn = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CreateBucketResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CreateBucketResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CreateBucketResponse", xmlWriter); | |
| } | |
| } | |
| if (localCreateBucketReturn == null) { | |
| throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); | |
| } | |
| localCreateBucketReturn.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CreateBucketReturn"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "CreateBucketReturn")); | |
| if (localCreateBucketReturn == null) { | |
| throw new org.apache.axis2.databinding.ADBException("CreateBucketReturn cannot be null!!"); | |
| } | |
| elementList.add(localCreateBucketReturn); | |
| 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 CreateBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CreateBucketResponse object = new CreateBucketResponse(); | |
| 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 (!"CreateBucketResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CreateBucketResponse)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://s3.amazonaws.com/doc/2006-03-01/", "CreateBucketReturn").equals(reader.getName())) { | |
| object.setCreateBucketReturn(CreateBucketResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObjectExtended implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectExtended", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for GetMetadata | |
| */ | |
| protected boolean localGetMetadata; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getGetMetadata() { | |
| return localGetMetadata; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetMetadata | |
| */ | |
| public void setGetMetadata(boolean param) { | |
| localGetMetadata = param; | |
| } | |
| /** | |
| * field for GetData | |
| */ | |
| protected boolean localGetData; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getGetData() { | |
| return localGetData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetData | |
| */ | |
| public void setGetData(boolean param) { | |
| localGetData = param; | |
| } | |
| /** | |
| * field for InlineData | |
| */ | |
| protected boolean localInlineData; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getInlineData() { | |
| return localInlineData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param InlineData | |
| */ | |
| public void setInlineData(boolean param) { | |
| localInlineData = param; | |
| } | |
| /** | |
| * field for ByteRangeStart | |
| */ | |
| protected long localByteRangeStart; | |
| /* 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 localByteRangeStartTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return long | |
| */ | |
| public long getByteRangeStart() { | |
| return localByteRangeStart; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ByteRangeStart | |
| */ | |
| public void setByteRangeStart(long param) { | |
| // setting primitive attribute tracker to true | |
| if (param == java.lang.Long.MIN_VALUE) { | |
| localByteRangeStartTracker = false; | |
| } else { | |
| localByteRangeStartTracker = true; | |
| } | |
| localByteRangeStart = param; | |
| } | |
| /** | |
| * field for ByteRangeEnd | |
| */ | |
| protected long localByteRangeEnd; | |
| /* 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 localByteRangeEndTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return long | |
| */ | |
| public long getByteRangeEnd() { | |
| return localByteRangeEnd; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ByteRangeEnd | |
| */ | |
| public void setByteRangeEnd(long param) { | |
| // setting primitive attribute tracker to true | |
| if (param == java.lang.Long.MIN_VALUE) { | |
| localByteRangeEndTracker = false; | |
| } else { | |
| localByteRangeEndTracker = true; | |
| } | |
| localByteRangeEnd = param; | |
| } | |
| /** | |
| * field for IfModifiedSince | |
| */ | |
| protected java.util.Calendar localIfModifiedSince; | |
| /* 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 localIfModifiedSinceTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getIfModifiedSince() { | |
| return localIfModifiedSince; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param IfModifiedSince | |
| */ | |
| public void setIfModifiedSince(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localIfModifiedSinceTracker = true; | |
| } else { | |
| localIfModifiedSinceTracker = false; | |
| } | |
| localIfModifiedSince = param; | |
| } | |
| /** | |
| * field for IfUnmodifiedSince | |
| */ | |
| protected java.util.Calendar localIfUnmodifiedSince; | |
| /* 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 localIfUnmodifiedSinceTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getIfUnmodifiedSince() { | |
| return localIfUnmodifiedSince; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param IfUnmodifiedSince | |
| */ | |
| public void setIfUnmodifiedSince(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localIfUnmodifiedSinceTracker = true; | |
| } else { | |
| localIfUnmodifiedSinceTracker = false; | |
| } | |
| localIfUnmodifiedSince = param; | |
| } | |
| /** | |
| * field for IfMatch | |
| * This was an Array! | |
| */ | |
| protected java.lang.String[] localIfMatch; | |
| /* 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 localIfMatchTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String[] | |
| */ | |
| public java.lang.String[] getIfMatch() { | |
| return localIfMatch; | |
| } | |
| /** | |
| * validate the array for IfMatch | |
| */ | |
| protected void validateIfMatch(java.lang.String[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param IfMatch | |
| */ | |
| public void setIfMatch(java.lang.String[] param) { | |
| validateIfMatch(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localIfMatchTracker = true; | |
| } else { | |
| localIfMatchTracker = false; | |
| } | |
| localIfMatch = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param java.lang.String | |
| */ | |
| public void addIfMatch(java.lang.String param) { | |
| if (localIfMatch == null) { | |
| localIfMatch = new java.lang.String[] {}; | |
| } | |
| //update the setting tracker | |
| localIfMatchTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfMatch); | |
| list.add(param); | |
| localIfMatch = (java.lang.String[])list.toArray(new java.lang.String[list.size()]); | |
| } | |
| /** | |
| * field for IfNoneMatch | |
| * This was an Array! | |
| */ | |
| protected java.lang.String[] localIfNoneMatch; | |
| /* 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 localIfNoneMatchTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String[] | |
| */ | |
| public java.lang.String[] getIfNoneMatch() { | |
| return localIfNoneMatch; | |
| } | |
| /** | |
| * validate the array for IfNoneMatch | |
| */ | |
| protected void validateIfNoneMatch(java.lang.String[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param IfNoneMatch | |
| */ | |
| public void setIfNoneMatch(java.lang.String[] param) { | |
| validateIfNoneMatch(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localIfNoneMatchTracker = true; | |
| } else { | |
| localIfNoneMatchTracker = false; | |
| } | |
| localIfNoneMatch = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param java.lang.String | |
| */ | |
| public void addIfNoneMatch(java.lang.String param) { | |
| if (localIfNoneMatch == null) { | |
| localIfNoneMatch = new java.lang.String[] {}; | |
| } | |
| //update the setting tracker | |
| localIfNoneMatchTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localIfNoneMatch); | |
| list.add(param); | |
| localIfNoneMatch = (java.lang.String[])list.toArray(new java.lang.String[list.size()]); | |
| } | |
| /** | |
| * field for ReturnCompleteObjectOnConditionFailure | |
| */ | |
| protected boolean localReturnCompleteObjectOnConditionFailure; | |
| /* 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 localReturnCompleteObjectOnConditionFailureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getReturnCompleteObjectOnConditionFailure() { | |
| return localReturnCompleteObjectOnConditionFailure; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ReturnCompleteObjectOnConditionFailure | |
| */ | |
| public void setReturnCompleteObjectOnConditionFailure(boolean param) { | |
| // setting primitive attribute tracker to true | |
| if (false) { | |
| localReturnCompleteObjectOnConditionFailureTracker = false; | |
| } else { | |
| localReturnCompleteObjectOnConditionFailureTracker = true; | |
| } | |
| localReturnCompleteObjectOnConditionFailure = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectExtended.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectExtended", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectExtended", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "GetMetadata", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "GetMetadata"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("GetMetadata"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "GetData", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "GetData"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("GetData"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "InlineData", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "InlineData"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("InlineData"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localByteRangeStartTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ByteRangeStart", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ByteRangeStart"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ByteRangeStart"); | |
| } | |
| if (localByteRangeStart == java.lang.Long.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("ByteRangeStart cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localByteRangeEndTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ByteRangeEnd", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ByteRangeEnd"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ByteRangeEnd"); | |
| } | |
| if (localByteRangeEnd == java.lang.Long.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("ByteRangeEnd cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localIfModifiedSinceTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "IfModifiedSince", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "IfModifiedSince"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("IfModifiedSince"); | |
| } | |
| if (localIfModifiedSince == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localIfUnmodifiedSinceTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "IfUnmodifiedSince", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "IfUnmodifiedSince"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("IfUnmodifiedSince"); | |
| } | |
| if (localIfUnmodifiedSince == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localIfMatchTracker) { | |
| if (localIfMatch != null) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| boolean emptyNamespace = namespace == null || namespace.length() == 0; | |
| prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); | |
| for (int i = 0; i < localIfMatch.length; i++) { | |
| if (localIfMatch[i] != null) { | |
| if (!emptyNamespace) { | |
| if (prefix == null) { | |
| java.lang.String prefix2 = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix2, "IfMatch", namespace); | |
| xmlWriter.writeNamespace(prefix2, namespace); | |
| xmlWriter.setPrefix(prefix2, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "IfMatch"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("IfMatch"); | |
| } | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); | |
| xmlWriter.writeEndElement(); | |
| } else { | |
| // we have to do nothing since minOccurs is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); | |
| } | |
| } | |
| if (localIfNoneMatchTracker) { | |
| if (localIfNoneMatch != null) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| boolean emptyNamespace = namespace == null || namespace.length() == 0; | |
| prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); | |
| for (int i = 0; i < localIfNoneMatch.length; i++) { | |
| if (localIfNoneMatch[i] != null) { | |
| if (!emptyNamespace) { | |
| if (prefix == null) { | |
| java.lang.String prefix2 = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix2, "IfNoneMatch", namespace); | |
| xmlWriter.writeNamespace(prefix2, namespace); | |
| xmlWriter.setPrefix(prefix2, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "IfNoneMatch"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("IfNoneMatch"); | |
| } | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); | |
| xmlWriter.writeEndElement(); | |
| } else { | |
| // we have to do nothing since minOccurs is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); | |
| } | |
| } | |
| if (localReturnCompleteObjectOnConditionFailureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ReturnCompleteObjectOnConditionFailure", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ReturnCompleteObjectOnConditionFailure"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ReturnCompleteObjectOnConditionFailure"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("ReturnCompleteObjectOnConditionFailure cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetMetadata")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetData")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "InlineData")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); | |
| if (localByteRangeStartTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ByteRangeStart")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeStart)); | |
| } | |
| if (localByteRangeEndTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ByteRangeEnd")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localByteRangeEnd)); | |
| } | |
| if (localIfModifiedSinceTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfModifiedSince")); | |
| if (localIfModifiedSince != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfModifiedSince)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfModifiedSince cannot be null!!"); | |
| } | |
| } | |
| if (localIfUnmodifiedSinceTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfUnmodifiedSince")); | |
| if (localIfUnmodifiedSince != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfUnmodifiedSince)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfUnmodifiedSince cannot be null!!"); | |
| } | |
| } | |
| if (localIfMatchTracker) { | |
| if (localIfMatch != null) { | |
| for (int i = 0; i < localIfMatch.length; i++) { | |
| if (localIfMatch[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfMatch")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfMatch[i])); | |
| } else { | |
| // have to do nothing | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfMatch cannot be null!!"); | |
| } | |
| } | |
| if (localIfNoneMatchTracker) { | |
| if (localIfNoneMatch != null) { | |
| for (int i = 0; i < localIfNoneMatch.length; i++) { | |
| if (localIfNoneMatch[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfNoneMatch")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localIfNoneMatch[i])); | |
| } else { | |
| // have to do nothing | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("IfNoneMatch cannot be null!!"); | |
| } | |
| } | |
| if (localReturnCompleteObjectOnConditionFailureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ReturnCompleteObjectOnConditionFailure")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localReturnCompleteObjectOnConditionFailure)); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 GetObjectExtended parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectExtended object = new GetObjectExtended(); | |
| 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 (!"GetObjectExtended".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectExtended)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 list10 = new java.util.ArrayList(); | |
| java.util.ArrayList list11 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetMetadata").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setGetMetadata(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetData").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setGetData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "InlineData").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setInlineData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ByteRangeStart").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setByteRangeStart(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); | |
| reader.next(); | |
| } // End of if for expected property start element | |
| else { | |
| object.setByteRangeStart(java.lang.Long.MIN_VALUE); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ByteRangeEnd").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setByteRangeEnd(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); | |
| reader.next(); | |
| } // End of if for expected property start element | |
| else { | |
| object.setByteRangeEnd(java.lang.Long.MIN_VALUE); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfModifiedSince").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setIfModifiedSince(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "IfUnmodifiedSince").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setIfUnmodifiedSince(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "IfMatch").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list10.add(reader.getElementText()); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone10 = false; | |
| while (!loopDone10) { | |
| // 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 | |
| loopDone10 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfMatch").equals(reader.getName())) { | |
| list10.add(reader.getElementText()); | |
| } else { | |
| loopDone10 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setIfMatch((java.lang.String[])list10.toArray(new java.lang.String[list10.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://s3.amazonaws.com/doc/2006-03-01/", "IfNoneMatch").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list11.add(reader.getElementText()); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone11 = false; | |
| while (!loopDone11) { | |
| // 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 | |
| loopDone11 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "IfNoneMatch").equals(reader.getName())) { | |
| list11.add(reader.getElementText()); | |
| } else { | |
| loopDone11 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setIfNoneMatch((java.lang.String[])list11.toArray(new java.lang.String[list11.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://s3.amazonaws.com/doc/2006-03-01/", "ReturnCompleteObjectOnConditionFailure").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setReturnCompleteObjectOnConditionFailure(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListAllMyBucketsResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBucketsResponse", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for ListAllMyBucketsResponse | |
| */ | |
| protected ListAllMyBucketsResult localListAllMyBucketsResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return ListAllMyBucketsResult | |
| */ | |
| public ListAllMyBucketsResult getListAllMyBucketsResponse() { | |
| return localListAllMyBucketsResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ListAllMyBucketsResponse | |
| */ | |
| public void setListAllMyBucketsResponse(ListAllMyBucketsResult param) { | |
| localListAllMyBucketsResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListAllMyBucketsResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListAllMyBucketsResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListAllMyBucketsResponse", xmlWriter); | |
| } | |
| } | |
| if (localListAllMyBucketsResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); | |
| } | |
| localListAllMyBucketsResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBucketsResponse"), factory, | |
| xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBucketsResponse")); | |
| if (localListAllMyBucketsResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("ListAllMyBucketsResponse cannot be null!!"); | |
| } | |
| elementList.add(localListAllMyBucketsResponse); | |
| 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 ListAllMyBucketsResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListAllMyBucketsResponse object = new ListAllMyBucketsResponse(); | |
| 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 (!"ListAllMyBucketsResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListAllMyBucketsResponse)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://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBucketsResponse").equals(reader.getName())) { | |
| object.setListAllMyBucketsResponse(ListAllMyBucketsResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetBucketAccessControlPolicy implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SetBucketAccessControlPolicy", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /* 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 localAccessControlListTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAccessControlListTracker = true; | |
| } else { | |
| localAccessControlListTracker = false; | |
| } | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetBucketAccessControlPolicy.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetBucketAccessControlPolicy", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetBucketAccessControlPolicy", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAccessControlListTracker) { | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAccessControlListTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 SetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetBucketAccessControlPolicy object = new SetBucketAccessControlPolicy(); | |
| 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 (!"SetBucketAccessControlPolicy".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetBucketAccessControlPolicy)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObjectAccessControlPolicyResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "GetObjectAccessControlPolicyResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for GetObjectAccessControlPolicyResponse | |
| */ | |
| protected AccessControlPolicy localGetObjectAccessControlPolicyResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlPolicy | |
| */ | |
| public AccessControlPolicy getGetObjectAccessControlPolicyResponse() { | |
| return localGetObjectAccessControlPolicyResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetObjectAccessControlPolicyResponse | |
| */ | |
| public void setGetObjectAccessControlPolicyResponse(AccessControlPolicy param) { | |
| localGetObjectAccessControlPolicyResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectAccessControlPolicyResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectAccessControlPolicyResponse", xmlWriter); | |
| } | |
| } | |
| if (localGetObjectAccessControlPolicyResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); | |
| } | |
| localGetObjectAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "GetObjectAccessControlPolicyResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectAccessControlPolicyResponse")); | |
| if (localGetObjectAccessControlPolicyResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectAccessControlPolicyResponse cannot be null!!"); | |
| } | |
| elementList.add(localGetObjectAccessControlPolicyResponse); | |
| 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 GetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectAccessControlPolicyResponse object = new GetObjectAccessControlPolicyResponse(); | |
| 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 (!"GetObjectAccessControlPolicyResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectAccessControlPolicyResponse)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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectAccessControlPolicyResponse").equals(reader.getName())) { | |
| object.setGetObjectAccessControlPolicyResponse(AccessControlPolicy.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class DeleteObjectResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteObjectResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for DeleteObjectResponse | |
| */ | |
| protected Status localDeleteObjectResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return Status | |
| */ | |
| public Status getDeleteObjectResponse() { | |
| return localDeleteObjectResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param DeleteObjectResponse | |
| */ | |
| public void setDeleteObjectResponse(Status param) { | |
| localDeleteObjectResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| DeleteObjectResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":DeleteObjectResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DeleteObjectResponse", xmlWriter); | |
| } | |
| } | |
| if (localDeleteObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); | |
| } | |
| localDeleteObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteObjectResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "DeleteObjectResponse")); | |
| if (localDeleteObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("DeleteObjectResponse cannot be null!!"); | |
| } | |
| elementList.add(localDeleteObjectResponse); | |
| 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 DeleteObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| DeleteObjectResponse object = new DeleteObjectResponse(); | |
| 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 (!"DeleteObjectResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (DeleteObjectResponse)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://s3.amazonaws.com/doc/2006-03-01/", "DeleteObjectResponse").equals(reader.getName())) { | |
| object.setDeleteObjectResponse(Status.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetBucketLoggingStatus implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = | |
| new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetBucketLoggingStatus", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetBucketLoggingStatus.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetBucketLoggingStatus", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetBucketLoggingStatus", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 GetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetBucketLoggingStatus object = new GetBucketLoggingStatus(); | |
| 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 (!"GetBucketLoggingStatus".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetBucketLoggingStatus)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class LoggingSettings implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = LoggingSettings | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for TargetBucket | |
| */ | |
| protected java.lang.String localTargetBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getTargetBucket() { | |
| return localTargetBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param TargetBucket | |
| */ | |
| public void setTargetBucket(java.lang.String param) { | |
| localTargetBucket = param; | |
| } | |
| /** | |
| * field for TargetPrefix | |
| */ | |
| protected java.lang.String localTargetPrefix; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getTargetPrefix() { | |
| return localTargetPrefix; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param TargetPrefix | |
| */ | |
| public void setTargetPrefix(java.lang.String param) { | |
| localTargetPrefix = param; | |
| } | |
| /** | |
| * field for TargetGrants | |
| */ | |
| protected AccessControlList localTargetGrants; | |
| /* 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 localTargetGrantsTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getTargetGrants() { | |
| return localTargetGrants; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param TargetGrants | |
| */ | |
| public void setTargetGrants(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTargetGrantsTracker = true; | |
| } else { | |
| localTargetGrantsTracker = false; | |
| } | |
| localTargetGrants = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| LoggingSettings.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":LoggingSettings", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LoggingSettings", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "TargetBucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "TargetBucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("TargetBucket"); | |
| } | |
| if (localTargetBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localTargetBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "TargetPrefix", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "TargetPrefix"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("TargetPrefix"); | |
| } | |
| if (localTargetPrefix == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localTargetPrefix); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localTargetGrantsTracker) { | |
| if (localTargetGrants == null) { | |
| throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); | |
| } | |
| localTargetGrants.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "TargetGrants"), factory, xmlWriter); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "TargetBucket")); | |
| if (localTargetBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("TargetBucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "TargetPrefix")); | |
| if (localTargetPrefix != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTargetPrefix)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("TargetPrefix cannot be null!!"); | |
| } | |
| if (localTargetGrantsTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "TargetGrants")); | |
| if (localTargetGrants == null) { | |
| throw new org.apache.axis2.databinding.ADBException("TargetGrants cannot be null!!"); | |
| } | |
| elementList.add(localTargetGrants); | |
| } | |
| 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 LoggingSettings parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| LoggingSettings object = new LoggingSettings(); | |
| 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 (!"LoggingSettings".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (LoggingSettings)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://s3.amazonaws.com/doc/2006-03-01/", "TargetBucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTargetBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "TargetPrefix").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTargetPrefix(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "TargetGrants").equals(reader.getName())) { | |
| object.setTargetGrants(AccessControlList.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.getLocalName()); | |
| } 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://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "ListAllMyBucketsResult".equals(typeName)) { | |
| return ListAllMyBucketsResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "PutObjectResult".equals(typeName)) { | |
| return PutObjectResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "BucketLoggingStatus".equals(typeName)) { | |
| return BucketLoggingStatus.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "AccessControlList".equals(typeName)) { | |
| return AccessControlList.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "ListAllMyBucketsEntry".equals(typeName)) { | |
| return ListAllMyBucketsEntry.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "MetadataDirective".equals(typeName)) { | |
| return MetadataDirective.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "ListBucketResult".equals(typeName)) { | |
| return ListBucketResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "AccessControlPolicy".equals(typeName)) { | |
| return AccessControlPolicy.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "PrefixEntry".equals(typeName)) { | |
| return PrefixEntry.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "GetObjectResult".equals(typeName)) { | |
| return GetObjectResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "Grant".equals(typeName)) { | |
| return Grant.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "ListAllMyBucketsList".equals(typeName)) { | |
| return ListAllMyBucketsList.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "CreateBucketResult".equals(typeName)) { | |
| return CreateBucketResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "Status".equals(typeName)) { | |
| return Status.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "MetadataEntry".equals(typeName)) { | |
| return MetadataEntry.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "LoggingSettings".equals(typeName)) { | |
| return LoggingSettings.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "CopyObjectResult".equals(typeName)) { | |
| return CopyObjectResult.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "CanonicalUser".equals(typeName)) { | |
| return CanonicalUser.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "ListEntry".equals(typeName)) { | |
| return ListEntry.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "Grantee".equals(typeName)) { | |
| return Grantee.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "StorageClass".equals(typeName)) { | |
| return StorageClass.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "Permission".equals(typeName)) { | |
| return Permission.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "Result".equals(typeName)) { | |
| return Result.Factory.parse(reader); | |
| } | |
| if ("http://s3.amazonaws.com/doc/2006-03-01/".equals(namespaceURI) && "User".equals(typeName)) { | |
| return User.Factory.parse(reader); | |
| } | |
| throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); | |
| } | |
| } | |
| public static class DeleteBucket implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteBucket", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| DeleteBucket.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":DeleteBucket", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DeleteBucket", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 DeleteBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| DeleteBucket object = new DeleteBucket(); | |
| 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 (!"DeleteBucket".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (DeleteBucket)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class DeleteBucketResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteBucketResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for DeleteBucketResponse | |
| */ | |
| protected Status localDeleteBucketResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return Status | |
| */ | |
| public Status getDeleteBucketResponse() { | |
| return localDeleteBucketResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param DeleteBucketResponse | |
| */ | |
| public void setDeleteBucketResponse(Status param) { | |
| localDeleteBucketResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| DeleteBucketResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":DeleteBucketResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DeleteBucketResponse", xmlWriter); | |
| } | |
| } | |
| if (localDeleteBucketResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); | |
| } | |
| localDeleteBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DeleteBucketResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "DeleteBucketResponse")); | |
| if (localDeleteBucketResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("DeleteBucketResponse cannot be null!!"); | |
| } | |
| elementList.add(localDeleteBucketResponse); | |
| 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 DeleteBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| DeleteBucketResponse object = new DeleteBucketResponse(); | |
| 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 (!"DeleteBucketResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (DeleteBucketResponse)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://s3.amazonaws.com/doc/2006-03-01/", "DeleteBucketResponse").equals(reader.getName())) { | |
| object.setDeleteBucketResponse(Status.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CopyObjectResult implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = CopyObjectResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for LastModified | |
| */ | |
| protected java.util.Calendar localLastModified; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getLastModified() { | |
| return localLastModified; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param LastModified | |
| */ | |
| public void setLastModified(java.util.Calendar param) { | |
| localLastModified = param; | |
| } | |
| /** | |
| * field for ETag | |
| */ | |
| protected java.lang.String localETag; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getETag() { | |
| return localETag; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ETag | |
| */ | |
| public void setETag(java.lang.String param) { | |
| localETag = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CopyObjectResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CopyObjectResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CopyObjectResult", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "LastModified", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "LastModified"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("LastModified"); | |
| } | |
| if (localLastModified == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ETag", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ETag"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ETag"); | |
| } | |
| if (localETag == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localETag); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "LastModified")); | |
| if (localLastModified != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag")); | |
| if (localETag != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("ETag 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 CopyObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CopyObjectResult object = new CopyObjectResult(); | |
| 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 (!"CopyObjectResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CopyObjectResult)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://s3.amazonaws.com/doc/2006-03-01/", "LastModified").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setLastModified(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setETag(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListEntry implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = ListEntry | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for LastModified | |
| */ | |
| protected java.util.Calendar localLastModified; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getLastModified() { | |
| return localLastModified; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param LastModified | |
| */ | |
| public void setLastModified(java.util.Calendar param) { | |
| localLastModified = param; | |
| } | |
| /** | |
| * field for ETag | |
| */ | |
| protected java.lang.String localETag; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getETag() { | |
| return localETag; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ETag | |
| */ | |
| public void setETag(java.lang.String param) { | |
| localETag = param; | |
| } | |
| /** | |
| * field for Size | |
| */ | |
| protected long localSize; | |
| /** | |
| * Auto generated getter method | |
| * @return long | |
| */ | |
| public long getSize() { | |
| return localSize; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Size | |
| */ | |
| public void setSize(long param) { | |
| localSize = param; | |
| } | |
| /** | |
| * field for Owner | |
| */ | |
| protected CanonicalUser localOwner; | |
| /* 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 localOwnerTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return CanonicalUser | |
| */ | |
| public CanonicalUser getOwner() { | |
| return localOwner; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Owner | |
| */ | |
| public void setOwner(CanonicalUser param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localOwnerTracker = true; | |
| } else { | |
| localOwnerTracker = false; | |
| } | |
| localOwner = param; | |
| } | |
| /** | |
| * field for StorageClass | |
| */ | |
| protected StorageClass localStorageClass; | |
| /** | |
| * Auto generated getter method | |
| * @return StorageClass | |
| */ | |
| public StorageClass getStorageClass() { | |
| return localStorageClass; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param StorageClass | |
| */ | |
| public void setStorageClass(StorageClass param) { | |
| localStorageClass = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListEntry.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListEntry", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListEntry", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "LastModified", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "LastModified"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("LastModified"); | |
| } | |
| if (localLastModified == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ETag", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ETag"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ETag"); | |
| } | |
| if (localETag == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localETag); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Size", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Size"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Size"); | |
| } | |
| if (localSize == java.lang.Long.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("Size cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localOwnerTracker) { | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Owner"), factory, xmlWriter); | |
| } | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified")); | |
| if (localLastModified != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag")); | |
| if (localETag != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Size")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSize)); | |
| if (localOwnerTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Owner")); | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| elementList.add(localOwner); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass")); | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| elementList.add(localStorageClass); | |
| 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 ListEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListEntry object = new ListEntry(); | |
| 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 (!"ListEntry".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListEntry)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://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setLastModified(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setETag(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Size").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSize(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Owner").equals(reader.getName())) { | |
| object.setOwner(CanonicalUser.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://s3.amazonaws.com/doc/2006-03-01/", "StorageClass").equals(reader.getName())) { | |
| object.setStorageClass(StorageClass.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class Permission implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Permission", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Permission | |
| */ | |
| protected java.lang.String localPermission; | |
| private static java.util.HashMap _table_ = new java.util.HashMap(); | |
| // Constructor | |
| protected Permission(java.lang.String value, boolean isRegisterValue) { | |
| localPermission = value; | |
| if (isRegisterValue) { | |
| _table_.put(localPermission, this); | |
| } | |
| } | |
| public static final java.lang.String _READ = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ"); | |
| public static final java.lang.String _WRITE = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE"); | |
| public static final java.lang.String _READ_ACP = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("READ_ACP"); | |
| public static final java.lang.String _WRITE_ACP = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("WRITE_ACP"); | |
| public static final java.lang.String _FULL_CONTROL = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FULL_CONTROL"); | |
| public static final Permission READ = new Permission(_READ, true); | |
| public static final Permission WRITE = new Permission(_WRITE, true); | |
| public static final Permission READ_ACP = new Permission(_READ_ACP, true); | |
| public static final Permission WRITE_ACP = new Permission(_WRITE_ACP, true); | |
| public static final Permission FULL_CONTROL = new Permission(_FULL_CONTROL, true); | |
| public java.lang.String getValue() { | |
| return localPermission; | |
| } | |
| @Override | |
| public boolean equals(java.lang.Object obj) { | |
| return (obj == this); | |
| } | |
| @Override | |
| public int hashCode() { | |
| return toString().hashCode(); | |
| } | |
| @Override | |
| public java.lang.String toString() { | |
| return localPermission.toString(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| Permission.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if (!namespace.equals("")) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, localName, namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, localName); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(localName); | |
| } | |
| // add the type details if this is used in a simple type | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Permission", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Permission", xmlWriter); | |
| } | |
| } | |
| if (localPermission == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); | |
| } else { | |
| xmlWriter.writeCharacters(localPermission); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(localPermission)}, null); | |
| } | |
| /** | |
| * Factory class that keeps the parse method | |
| */ | |
| public static class Factory { | |
| public static Permission fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { | |
| Permission enumeration = (Permission) | |
| _table_.get(value); | |
| if (enumeration == null) | |
| throw new java.lang.IllegalArgumentException(); | |
| return enumeration; | |
| } | |
| public static Permission 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 Permission 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 Permission.Factory.fromString(content, namespaceUri); | |
| } else { | |
| return Permission.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 Permission parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| Permission 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()) { | |
| 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 = Permission.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 = Permission.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 Grantee implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = Grantee | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| Grantee.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Grantee", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Grantee", xmlWriter); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(); | |
| 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 Grantee parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| Grantee object = null; | |
| 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 (!"Grantee".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (Grantee)ExtensionMapper.getTypeObject(nsUri, type, reader); | |
| } | |
| throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); | |
| } | |
| } | |
| // Note all attributes that were handled. Used to differ normal attributes | |
| // from anyAttributes. | |
| java.util.Vector handledAttributes = new java.util.Vector(); | |
| reader.next(); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListAllMyBucketsResult implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = ListAllMyBucketsResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Owner | |
| */ | |
| protected CanonicalUser localOwner; | |
| /** | |
| * Auto generated getter method | |
| * @return CanonicalUser | |
| */ | |
| public CanonicalUser getOwner() { | |
| return localOwner; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Owner | |
| */ | |
| public void setOwner(CanonicalUser param) { | |
| localOwner = param; | |
| } | |
| /** | |
| * field for Buckets | |
| */ | |
| protected ListAllMyBucketsList localBuckets; | |
| /** | |
| * Auto generated getter method | |
| * @return ListAllMyBucketsList | |
| */ | |
| public ListAllMyBucketsList getBuckets() { | |
| return localBuckets; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Buckets | |
| */ | |
| public void setBuckets(ListAllMyBucketsList param) { | |
| localBuckets = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListAllMyBucketsResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListAllMyBucketsResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListAllMyBucketsResult", xmlWriter); | |
| } | |
| } | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Owner"), factory, xmlWriter); | |
| if (localBuckets == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); | |
| } | |
| localBuckets.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Buckets"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Owner")); | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| elementList.add(localOwner); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Buckets")); | |
| if (localBuckets == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Buckets cannot be null!!"); | |
| } | |
| elementList.add(localBuckets); | |
| 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 ListAllMyBucketsResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListAllMyBucketsResult object = new ListAllMyBucketsResult(); | |
| 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 (!"ListAllMyBucketsResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListAllMyBucketsResult)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://s3.amazonaws.com/doc/2006-03-01/", "Owner").equals(reader.getName())) { | |
| object.setOwner(CanonicalUser.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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Buckets").equals(reader.getName())) { | |
| object.setBuckets(ListAllMyBucketsList.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CopyObject implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopyObject", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for SourceBucket | |
| */ | |
| protected java.lang.String localSourceBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSourceBucket() { | |
| return localSourceBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param SourceBucket | |
| */ | |
| public void setSourceBucket(java.lang.String param) { | |
| localSourceBucket = param; | |
| } | |
| /** | |
| * field for SourceKey | |
| */ | |
| protected java.lang.String localSourceKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSourceKey() { | |
| return localSourceKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param SourceKey | |
| */ | |
| public void setSourceKey(java.lang.String param) { | |
| localSourceKey = param; | |
| } | |
| /** | |
| * field for DestinationBucket | |
| */ | |
| protected java.lang.String localDestinationBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDestinationBucket() { | |
| return localDestinationBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param DestinationBucket | |
| */ | |
| public void setDestinationBucket(java.lang.String param) { | |
| localDestinationBucket = param; | |
| } | |
| /** | |
| * field for DestinationKey | |
| */ | |
| protected java.lang.String localDestinationKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDestinationKey() { | |
| return localDestinationKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param DestinationKey | |
| */ | |
| public void setDestinationKey(java.lang.String param) { | |
| localDestinationKey = param; | |
| } | |
| /** | |
| * field for MetadataDirective | |
| */ | |
| protected MetadataDirective localMetadataDirective; | |
| /* 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 localMetadataDirectiveTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataDirective | |
| */ | |
| public MetadataDirective getMetadataDirective() { | |
| return localMetadataDirective; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param MetadataDirective | |
| */ | |
| public void setMetadataDirective(MetadataDirective param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataDirectiveTracker = true; | |
| } else { | |
| localMetadataDirectiveTracker = false; | |
| } | |
| localMetadataDirective = param; | |
| } | |
| /** | |
| * field for Metadata | |
| * This was an Array! | |
| */ | |
| protected MetadataEntry[] localMetadata; | |
| /* 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 localMetadataTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataEntry[] | |
| */ | |
| public MetadataEntry[] getMetadata() { | |
| return localMetadata; | |
| } | |
| /** | |
| * validate the array for Metadata | |
| */ | |
| protected void validateMetadata(MetadataEntry[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Metadata | |
| */ | |
| public void setMetadata(MetadataEntry[] param) { | |
| validateMetadata(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| } else { | |
| localMetadataTracker = false; | |
| } | |
| localMetadata = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param MetadataEntry | |
| */ | |
| public void addMetadata(MetadataEntry param) { | |
| if (localMetadata == null) { | |
| localMetadata = new MetadataEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); | |
| list.add(param); | |
| localMetadata = (MetadataEntry[])list.toArray(new MetadataEntry[list.size()]); | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /* 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 localAccessControlListTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAccessControlListTracker = true; | |
| } else { | |
| localAccessControlListTracker = false; | |
| } | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for CopySourceIfModifiedSince | |
| */ | |
| protected java.util.Calendar localCopySourceIfModifiedSince; | |
| /* 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 localCopySourceIfModifiedSinceTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getCopySourceIfModifiedSince() { | |
| return localCopySourceIfModifiedSince; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CopySourceIfModifiedSince | |
| */ | |
| public void setCopySourceIfModifiedSince(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCopySourceIfModifiedSinceTracker = true; | |
| } else { | |
| localCopySourceIfModifiedSinceTracker = false; | |
| } | |
| localCopySourceIfModifiedSince = param; | |
| } | |
| /** | |
| * field for CopySourceIfUnmodifiedSince | |
| */ | |
| protected java.util.Calendar localCopySourceIfUnmodifiedSince; | |
| /* 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 localCopySourceIfUnmodifiedSinceTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getCopySourceIfUnmodifiedSince() { | |
| return localCopySourceIfUnmodifiedSince; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CopySourceIfUnmodifiedSince | |
| */ | |
| public void setCopySourceIfUnmodifiedSince(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCopySourceIfUnmodifiedSinceTracker = true; | |
| } else { | |
| localCopySourceIfUnmodifiedSinceTracker = false; | |
| } | |
| localCopySourceIfUnmodifiedSince = param; | |
| } | |
| /** | |
| * field for CopySourceIfMatch | |
| * This was an Array! | |
| */ | |
| protected java.lang.String[] localCopySourceIfMatch; | |
| /* 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 localCopySourceIfMatchTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String[] | |
| */ | |
| public java.lang.String[] getCopySourceIfMatch() { | |
| return localCopySourceIfMatch; | |
| } | |
| /** | |
| * validate the array for CopySourceIfMatch | |
| */ | |
| protected void validateCopySourceIfMatch(java.lang.String[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CopySourceIfMatch | |
| */ | |
| public void setCopySourceIfMatch(java.lang.String[] param) { | |
| validateCopySourceIfMatch(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localCopySourceIfMatchTracker = true; | |
| } else { | |
| localCopySourceIfMatchTracker = false; | |
| } | |
| localCopySourceIfMatch = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param java.lang.String | |
| */ | |
| public void addCopySourceIfMatch(java.lang.String param) { | |
| if (localCopySourceIfMatch == null) { | |
| localCopySourceIfMatch = new java.lang.String[] {}; | |
| } | |
| //update the setting tracker | |
| localCopySourceIfMatchTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfMatch); | |
| list.add(param); | |
| localCopySourceIfMatch = (java.lang.String[])list.toArray(new java.lang.String[list.size()]); | |
| } | |
| /** | |
| * field for CopySourceIfNoneMatch | |
| * This was an Array! | |
| */ | |
| protected java.lang.String[] localCopySourceIfNoneMatch; | |
| /* 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 localCopySourceIfNoneMatchTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String[] | |
| */ | |
| public java.lang.String[] getCopySourceIfNoneMatch() { | |
| return localCopySourceIfNoneMatch; | |
| } | |
| /** | |
| * validate the array for CopySourceIfNoneMatch | |
| */ | |
| protected void validateCopySourceIfNoneMatch(java.lang.String[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CopySourceIfNoneMatch | |
| */ | |
| public void setCopySourceIfNoneMatch(java.lang.String[] param) { | |
| validateCopySourceIfNoneMatch(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localCopySourceIfNoneMatchTracker = true; | |
| } else { | |
| localCopySourceIfNoneMatchTracker = false; | |
| } | |
| localCopySourceIfNoneMatch = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param java.lang.String | |
| */ | |
| public void addCopySourceIfNoneMatch(java.lang.String param) { | |
| if (localCopySourceIfNoneMatch == null) { | |
| localCopySourceIfNoneMatch = new java.lang.String[] {}; | |
| } | |
| //update the setting tracker | |
| localCopySourceIfNoneMatchTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localCopySourceIfNoneMatch); | |
| list.add(param); | |
| localCopySourceIfNoneMatch = (java.lang.String[])list.toArray(new java.lang.String[list.size()]); | |
| } | |
| /** | |
| * field for StorageClass | |
| */ | |
| protected StorageClass localStorageClass; | |
| /* 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 localStorageClassTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return StorageClass | |
| */ | |
| public StorageClass getStorageClass() { | |
| return localStorageClass; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param StorageClass | |
| */ | |
| public void setStorageClass(StorageClass param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localStorageClassTracker = true; | |
| } else { | |
| localStorageClassTracker = false; | |
| } | |
| localStorageClass = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CopyObject.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CopyObject", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CopyObject", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "SourceBucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "SourceBucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("SourceBucket"); | |
| } | |
| if (localSourceBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSourceBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "SourceKey", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "SourceKey"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("SourceKey"); | |
| } | |
| if (localSourceKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSourceKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "DestinationBucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "DestinationBucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("DestinationBucket"); | |
| } | |
| if (localDestinationBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDestinationBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "DestinationKey", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "DestinationKey"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("DestinationKey"); | |
| } | |
| if (localDestinationKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDestinationKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localMetadataDirectiveTracker) { | |
| if (localMetadataDirective == null) { | |
| throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); | |
| } | |
| localMetadataDirective.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MetadataDirective"), factory, xmlWriter); | |
| } | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| if (localAccessControlListTracker) { | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| } | |
| if (localCopySourceIfModifiedSinceTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "CopySourceIfModifiedSince", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "CopySourceIfModifiedSince"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("CopySourceIfModifiedSince"); | |
| } | |
| if (localCopySourceIfModifiedSince == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCopySourceIfUnmodifiedSinceTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "CopySourceIfUnmodifiedSince", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "CopySourceIfUnmodifiedSince"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("CopySourceIfUnmodifiedSince"); | |
| } | |
| if (localCopySourceIfUnmodifiedSince == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCopySourceIfMatchTracker) { | |
| if (localCopySourceIfMatch != null) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| boolean emptyNamespace = namespace == null || namespace.length() == 0; | |
| prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); | |
| for (int i = 0; i < localCopySourceIfMatch.length; i++) { | |
| if (localCopySourceIfMatch[i] != null) { | |
| if (!emptyNamespace) { | |
| if (prefix == null) { | |
| java.lang.String prefix2 = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix2, "CopySourceIfMatch", namespace); | |
| xmlWriter.writeNamespace(prefix2, namespace); | |
| xmlWriter.setPrefix(prefix2, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "CopySourceIfMatch"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("CopySourceIfMatch"); | |
| } | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); | |
| xmlWriter.writeEndElement(); | |
| } else { | |
| // we have to do nothing since minOccurs is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); | |
| } | |
| } | |
| if (localCopySourceIfNoneMatchTracker) { | |
| if (localCopySourceIfNoneMatch != null) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| boolean emptyNamespace = namespace == null || namespace.length() == 0; | |
| prefix = emptyNamespace ? null : xmlWriter.getPrefix(namespace); | |
| for (int i = 0; i < localCopySourceIfNoneMatch.length; i++) { | |
| if (localCopySourceIfNoneMatch[i] != null) { | |
| if (!emptyNamespace) { | |
| if (prefix == null) { | |
| java.lang.String prefix2 = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix2, "CopySourceIfNoneMatch", namespace); | |
| xmlWriter.writeNamespace(prefix2, namespace); | |
| xmlWriter.setPrefix(prefix2, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "CopySourceIfNoneMatch"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("CopySourceIfNoneMatch"); | |
| } | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); | |
| xmlWriter.writeEndElement(); | |
| } else { | |
| // we have to do nothing since minOccurs is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); | |
| } | |
| } | |
| if (localStorageClassTracker) { | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass"), factory, xmlWriter); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "SourceBucket")); | |
| if (localSourceBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("SourceBucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SourceKey")); | |
| if (localSourceKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSourceKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("SourceKey cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DestinationBucket")); | |
| if (localDestinationBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("DestinationBucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DestinationKey")); | |
| if (localDestinationKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDestinationKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("DestinationKey cannot be null!!"); | |
| } | |
| if (localMetadataDirectiveTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MetadataDirective")); | |
| if (localMetadataDirective == null) { | |
| throw new org.apache.axis2.databinding.ADBException("MetadataDirective cannot be null!!"); | |
| } | |
| elementList.add(localMetadataDirective); | |
| } | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata")); | |
| elementList.add(localMetadata[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| if (localAccessControlListTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| } | |
| if (localCopySourceIfModifiedSinceTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfModifiedSince")); | |
| if (localCopySourceIfModifiedSince != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfModifiedSince)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfModifiedSince cannot be null!!"); | |
| } | |
| } | |
| if (localCopySourceIfUnmodifiedSinceTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfUnmodifiedSince")); | |
| if (localCopySourceIfUnmodifiedSince != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfUnmodifiedSince)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfUnmodifiedSince cannot be null!!"); | |
| } | |
| } | |
| if (localCopySourceIfMatchTracker) { | |
| if (localCopySourceIfMatch != null) { | |
| for (int i = 0; i < localCopySourceIfMatch.length; i++) { | |
| if (localCopySourceIfMatch[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfMatch")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfMatch[i])); | |
| } else { | |
| // have to do nothing | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfMatch cannot be null!!"); | |
| } | |
| } | |
| if (localCopySourceIfNoneMatchTracker) { | |
| if (localCopySourceIfNoneMatch != null) { | |
| for (int i = 0; i < localCopySourceIfNoneMatch.length; i++) { | |
| if (localCopySourceIfNoneMatch[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfNoneMatch")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCopySourceIfNoneMatch[i])); | |
| } else { | |
| // have to do nothing | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("CopySourceIfNoneMatch cannot be null!!"); | |
| } | |
| } | |
| if (localStorageClassTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass")); | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| elementList.add(localStorageClass); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 CopyObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CopyObject object = new CopyObject(); | |
| 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 (!"CopyObject".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CopyObject)ExtensionMapper.getTypeObject(nsUri, type, reader); | |
| } | |
| } | |
| } | |
| // Note all attributes that were handled. Used to differ normal attributes | |
| // from anyAttributes. | |
| java.util.Vector handledAttributes = new java.util.Vector(); | |
| reader.next(); | |
| java.util.ArrayList list6 = new java.util.ArrayList(); | |
| java.util.ArrayList list10 = new java.util.ArrayList(); | |
| java.util.ArrayList list11 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SourceBucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSourceBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SourceKey").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSourceKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DestinationBucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDestinationBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DestinationKey").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDestinationKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MetadataDirective").equals(reader.getName())) { | |
| object.setMetadataDirective(MetadataDirective.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://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list6.add(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| list6.add(MetadataEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone6 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setMetadata((MetadataEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(MetadataEntry.class, list6)); | |
| } // 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://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfModifiedSince").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCopySourceIfModifiedSince(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfUnmodifiedSince").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCopySourceIfUnmodifiedSince(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfMatch").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list10.add(reader.getElementText()); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone10 = false; | |
| while (!loopDone10) { | |
| // 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 | |
| loopDone10 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfMatch").equals(reader.getName())) { | |
| list10.add(reader.getElementText()); | |
| } else { | |
| loopDone10 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setCopySourceIfMatch((java.lang.String[])list10.toArray(new java.lang.String[list10.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://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfNoneMatch").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list11.add(reader.getElementText()); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone11 = false; | |
| while (!loopDone11) { | |
| // 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 | |
| loopDone11 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopySourceIfNoneMatch").equals(reader.getName())) { | |
| list11.add(reader.getElementText()); | |
| } else { | |
| loopDone11 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setCopySourceIfNoneMatch((java.lang.String[])list11.toArray(new java.lang.String[list11.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://s3.amazonaws.com/doc/2006-03-01/", "StorageClass").equals(reader.getName())) { | |
| object.setStorageClass(StorageClass.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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class BucketLoggingStatus implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = BucketLoggingStatus | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for LoggingEnabled | |
| */ | |
| protected LoggingSettings localLoggingEnabled; | |
| /* 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 localLoggingEnabledTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return LoggingSettings | |
| */ | |
| public LoggingSettings getLoggingEnabled() { | |
| return localLoggingEnabled; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param LoggingEnabled | |
| */ | |
| public void setLoggingEnabled(LoggingSettings param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localLoggingEnabledTracker = true; | |
| } else { | |
| localLoggingEnabledTracker = false; | |
| } | |
| localLoggingEnabled = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| BucketLoggingStatus.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":BucketLoggingStatus", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "BucketLoggingStatus", xmlWriter); | |
| } | |
| } | |
| if (localLoggingEnabledTracker) { | |
| if (localLoggingEnabled == null) { | |
| throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); | |
| } | |
| localLoggingEnabled.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LoggingEnabled"), factory, xmlWriter); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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 (localLoggingEnabledTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LoggingEnabled")); | |
| if (localLoggingEnabled == null) { | |
| throw new org.apache.axis2.databinding.ADBException("LoggingEnabled cannot be null!!"); | |
| } | |
| elementList.add(localLoggingEnabled); | |
| } | |
| 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 BucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| BucketLoggingStatus object = new BucketLoggingStatus(); | |
| 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 (!"BucketLoggingStatus".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (BucketLoggingStatus)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://s3.amazonaws.com/doc/2006-03-01/", "LoggingEnabled").equals(reader.getName())) { | |
| object.setLoggingEnabled(LoggingSettings.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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PutObject implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObject", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for Metadata | |
| * This was an Array! | |
| */ | |
| protected MetadataEntry[] localMetadata; | |
| /* 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 localMetadataTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataEntry[] | |
| */ | |
| public MetadataEntry[] getMetadata() { | |
| return localMetadata; | |
| } | |
| /** | |
| * validate the array for Metadata | |
| */ | |
| protected void validateMetadata(MetadataEntry[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Metadata | |
| */ | |
| public void setMetadata(MetadataEntry[] param) { | |
| validateMetadata(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| } else { | |
| localMetadataTracker = false; | |
| } | |
| localMetadata = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param MetadataEntry | |
| */ | |
| public void addMetadata(MetadataEntry param) { | |
| if (localMetadata == null) { | |
| localMetadata = new MetadataEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); | |
| list.add(param); | |
| localMetadata = (MetadataEntry[])list.toArray(new MetadataEntry[list.size()]); | |
| } | |
| /** | |
| * field for ContentLength | |
| */ | |
| protected long localContentLength; | |
| /** | |
| * Auto generated getter method | |
| * @return long | |
| */ | |
| public long getContentLength() { | |
| return localContentLength; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ContentLength | |
| */ | |
| public void setContentLength(long param) { | |
| localContentLength = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /* 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 localAccessControlListTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAccessControlListTracker = true; | |
| } else { | |
| localAccessControlListTracker = false; | |
| } | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for StorageClass | |
| */ | |
| protected StorageClass localStorageClass; | |
| /* 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 localStorageClassTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return StorageClass | |
| */ | |
| public StorageClass getStorageClass() { | |
| return localStorageClass; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param StorageClass | |
| */ | |
| public void setStorageClass(StorageClass param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localStorageClassTracker = true; | |
| } else { | |
| localStorageClassTracker = false; | |
| } | |
| localStorageClass = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PutObject.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PutObject", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PutObject", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ContentLength", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ContentLength"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ContentLength"); | |
| } | |
| if (localContentLength == java.lang.Long.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("ContentLength cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAccessControlListTracker) { | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| } | |
| if (localStorageClassTracker) { | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| localStorageClass.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass"), factory, xmlWriter); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata")); | |
| elementList.add(localMetadata[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ContentLength")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localContentLength)); | |
| if (localAccessControlListTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| } | |
| if (localStorageClassTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass")); | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("StorageClass cannot be null!!"); | |
| } | |
| elementList.add(localStorageClass); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 PutObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PutObject object = new PutObject(); | |
| 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 (!"PutObject".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PutObject)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 list3 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list3.add(MetadataEntry.Factory.parse(reader)); | |
| //loop until we find a start element that is not part of this array | |
| boolean loopDone3 = false; | |
| while (!loopDone3) { | |
| // 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 | |
| loopDone3 = true; | |
| } else { | |
| if (new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| list3.add(MetadataEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone3 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setMetadata((MetadataEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "ContentLength").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setContentLength(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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://s3.amazonaws.com/doc/2006-03-01/", "StorageClass").equals(reader.getName())) { | |
| object.setStorageClass(StorageClass.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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class MetadataDirective implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MetadataDirective", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for MetadataDirective | |
| */ | |
| protected java.lang.String localMetadataDirective; | |
| private static java.util.HashMap _table_ = new java.util.HashMap(); | |
| // Constructor | |
| protected MetadataDirective(java.lang.String value, boolean isRegisterValue) { | |
| localMetadataDirective = value; | |
| if (isRegisterValue) { | |
| _table_.put(localMetadataDirective, this); | |
| } | |
| } | |
| public static final java.lang.String _COPY = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COPY"); | |
| public static final java.lang.String _REPLACE = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REPLACE"); | |
| public static final MetadataDirective COPY = new MetadataDirective(_COPY, true); | |
| public static final MetadataDirective REPLACE = new MetadataDirective(_REPLACE, true); | |
| public java.lang.String getValue() { | |
| return localMetadataDirective; | |
| } | |
| @Override | |
| public boolean equals(java.lang.Object obj) { | |
| return (obj == this); | |
| } | |
| @Override | |
| public int hashCode() { | |
| return toString().hashCode(); | |
| } | |
| @Override | |
| public java.lang.String toString() { | |
| return localMetadataDirective.toString(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| MetadataDirective.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if (!namespace.equals("")) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, localName, namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, localName); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(localName); | |
| } | |
| // add the type details if this is used in a simple type | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":MetadataDirective", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "MetadataDirective", xmlWriter); | |
| } | |
| } | |
| if (localMetadataDirective == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); | |
| } else { | |
| xmlWriter.writeCharacters(localMetadataDirective); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(localMetadataDirective)}, null); | |
| } | |
| /** | |
| * Factory class that keeps the parse method | |
| */ | |
| public static class Factory { | |
| public static MetadataDirective fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { | |
| MetadataDirective enumeration = (MetadataDirective) | |
| _table_.get(value); | |
| if (enumeration == null) | |
| throw new java.lang.IllegalArgumentException(); | |
| return enumeration; | |
| } | |
| public static MetadataDirective 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 MetadataDirective 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 MetadataDirective.Factory.fromString(content, namespaceUri); | |
| } else { | |
| return MetadataDirective.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 MetadataDirective parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| MetadataDirective 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()) { | |
| 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 = MetadataDirective.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 = MetadataDirective.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 GetObjectResult extends Result implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = GetObjectResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Metadata | |
| * This was an Array! | |
| */ | |
| protected MetadataEntry[] localMetadata; | |
| /* 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 localMetadataTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return MetadataEntry[] | |
| */ | |
| public MetadataEntry[] getMetadata() { | |
| return localMetadata; | |
| } | |
| /** | |
| * validate the array for Metadata | |
| */ | |
| protected void validateMetadata(MetadataEntry[] param) { | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Metadata | |
| */ | |
| public void setMetadata(MetadataEntry[] param) { | |
| validateMetadata(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| } else { | |
| localMetadataTracker = false; | |
| } | |
| localMetadata = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param MetadataEntry | |
| */ | |
| public void addMetadata(MetadataEntry param) { | |
| if (localMetadata == null) { | |
| localMetadata = new MetadataEntry[] {}; | |
| } | |
| //update the setting tracker | |
| localMetadataTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localMetadata); | |
| list.add(param); | |
| localMetadata = (MetadataEntry[])list.toArray(new MetadataEntry[list.size()]); | |
| } | |
| /** | |
| * field for Data | |
| */ | |
| protected javax.activation.DataHandler localData; | |
| /** | |
| * Auto generated getter method | |
| * @return javax.activation.DataHandler | |
| */ | |
| public javax.activation.DataHandler getData() { | |
| return localData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Data | |
| */ | |
| public void setData(javax.activation.DataHandler param) { | |
| localData = param; | |
| } | |
| /** | |
| * field for LastModified | |
| */ | |
| protected java.util.Calendar localLastModified; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getLastModified() { | |
| return localLastModified; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param LastModified | |
| */ | |
| public void setLastModified(java.util.Calendar param) { | |
| localLastModified = param; | |
| } | |
| /** | |
| * field for ETag | |
| */ | |
| protected java.lang.String localETag; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getETag() { | |
| return localETag; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ETag | |
| */ | |
| public void setETag(java.lang.String param) { | |
| localETag = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @param parentQName | |
| * @param factory | |
| * @return org.apache.axiom.om.OMElement | |
| */ | |
| @Override | |
| 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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectResult", xmlWriter); | |
| } | |
| if (localStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); | |
| } | |
| localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Status"), factory, xmlWriter); | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| localMetadata[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Data", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Data"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Data"); | |
| } | |
| if (localData != null) { | |
| xmlWriter.writeDataHandler(localData); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "LastModified", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "LastModified"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("LastModified"); | |
| } | |
| if (localLastModified == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ETag", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ETag"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ETag"); | |
| } | |
| if (localETag == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localETag); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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("http://www.w3.org/2001/XMLSchema-instance", "type")); | |
| attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResult")); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Status")); | |
| if (localStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); | |
| } | |
| elementList.add(localStatus); | |
| if (localMetadataTracker) { | |
| if (localMetadata != null) { | |
| for (int i = 0; i < localMetadata.length; i++) { | |
| if (localMetadata[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata")); | |
| elementList.add(localMetadata[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Metadata cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Data")); | |
| elementList.add(localData); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified")); | |
| if (localLastModified != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag")); | |
| if (localETag != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("ETag 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 GetObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectResult object = new GetObjectResult(); | |
| 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 (!"GetObjectResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectResult)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 list2 = new java.util.ArrayList(); | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Status").equals(reader.getName())) { | |
| object.setStatus(Status.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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list2.add(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Metadata").equals(reader.getName())) { | |
| list2.add(MetadataEntry.Factory.parse(reader)); | |
| } else { | |
| loopDone2 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setMetadata((MetadataEntry[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(MetadataEntry.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://s3.amazonaws.com/doc/2006-03-01/", "Data").equals(reader.getName())) { | |
| reader.next(); | |
| if (isReaderMTOMAware(reader) && java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_BINARY))) { | |
| //MTOM aware reader - get the datahandler directly and put it in the object | |
| object.setData((javax.activation.DataHandler)reader.getProperty(org.apache.axiom.om.OMConstants.DATA_HANDLER)); | |
| } else { | |
| if (reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT && | |
| reader.getName().equals( | |
| new javax.xml.namespace.QName(org.apache.axiom.om.impl.MTOMConstants.XOP_NAMESPACE_URI, | |
| org.apache.axiom.om.impl.MTOMConstants.XOP_INCLUDE))) { | |
| java.lang.String id = org.apache.axiom.om.util.ElementHelper.getContentID(reader, "UTF-8"); | |
| object.setData(((org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder)((org.apache.axiom.om.impl.llom.OMStAXWrapper)reader).getBuilder()).getDataHandler(id)); | |
| reader.next(); | |
| reader.next(); | |
| } else if (reader.hasText()) { | |
| //Do the usual conversion | |
| java.lang.String content = reader.getText(); | |
| object.setData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBase64Binary(content)); | |
| reader.next(); | |
| } | |
| } | |
| 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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setLastModified(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setETag(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class Grant implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = Grant | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Grantee | |
| */ | |
| protected Grantee localGrantee; | |
| /** | |
| * Auto generated getter method | |
| * @return Grantee | |
| */ | |
| public Grantee getGrantee() { | |
| return localGrantee; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Grantee | |
| */ | |
| public void setGrantee(Grantee param) { | |
| localGrantee = param; | |
| } | |
| /** | |
| * field for Permission | |
| */ | |
| protected Permission localPermission; | |
| /** | |
| * Auto generated getter method | |
| * @return Permission | |
| */ | |
| public Permission getPermission() { | |
| return localPermission; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Permission | |
| */ | |
| public void setPermission(Permission param) { | |
| localPermission = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| Grant.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Grant", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Grant", xmlWriter); | |
| } | |
| } | |
| if (localGrantee == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); | |
| } | |
| localGrantee.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Grantee"), factory, xmlWriter); | |
| if (localPermission == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); | |
| } | |
| localPermission.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Permission"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Grantee")); | |
| if (localGrantee == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Grantee cannot be null!!"); | |
| } | |
| elementList.add(localGrantee); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Permission")); | |
| if (localPermission == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Permission cannot be null!!"); | |
| } | |
| elementList.add(localPermission); | |
| 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 Grant parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| Grant object = new Grant(); | |
| 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 (!"Grant".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (Grant)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://s3.amazonaws.com/doc/2006-03-01/", "Grantee").equals(reader.getName())) { | |
| object.setGrantee(Grantee.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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Permission").equals(reader.getName())) { | |
| object.setPermission(Permission.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetBucketAccessControlPolicyResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "GetBucketAccessControlPolicyResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for GetBucketAccessControlPolicyResponse | |
| */ | |
| protected AccessControlPolicy localGetBucketAccessControlPolicyResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlPolicy | |
| */ | |
| public AccessControlPolicy getGetBucketAccessControlPolicyResponse() { | |
| return localGetBucketAccessControlPolicyResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetBucketAccessControlPolicyResponse | |
| */ | |
| public void setGetBucketAccessControlPolicyResponse(AccessControlPolicy param) { | |
| localGetBucketAccessControlPolicyResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetBucketAccessControlPolicyResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetBucketAccessControlPolicyResponse", xmlWriter); | |
| } | |
| } | |
| if (localGetBucketAccessControlPolicyResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); | |
| } | |
| localGetBucketAccessControlPolicyResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "GetBucketAccessControlPolicyResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "GetBucketAccessControlPolicyResponse")); | |
| if (localGetBucketAccessControlPolicyResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetBucketAccessControlPolicyResponse cannot be null!!"); | |
| } | |
| elementList.add(localGetBucketAccessControlPolicyResponse); | |
| 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 GetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetBucketAccessControlPolicyResponse object = new GetBucketAccessControlPolicyResponse(); | |
| 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 (!"GetBucketAccessControlPolicyResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetBucketAccessControlPolicyResponse)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://s3.amazonaws.com/doc/2006-03-01/", "GetBucketAccessControlPolicyResponse").equals(reader.getName())) { | |
| object.setGetBucketAccessControlPolicyResponse(AccessControlPolicy.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetObjectAccessControlPolicyResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "SetObjectAccessControlPolicyResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetObjectAccessControlPolicyResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetObjectAccessControlPolicyResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetObjectAccessControlPolicyResponse", xmlWriter); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(); | |
| 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 SetObjectAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetObjectAccessControlPolicyResponse object = new SetObjectAccessControlPolicyResponse(); | |
| 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 (!"SetObjectAccessControlPolicyResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetObjectAccessControlPolicyResponse)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()) | |
| // A start element we are not expecting indicates a trailing invalid property | |
| throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetObjectAccessControlPolicy implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SetObjectAccessControlPolicy", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetObjectAccessControlPolicy.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetObjectAccessControlPolicy", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetObjectAccessControlPolicy", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 SetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetObjectAccessControlPolicy object = new SetObjectAccessControlPolicy(); | |
| 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 (!"SetObjectAccessControlPolicy".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetObjectAccessControlPolicy)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListBucket implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListBucket", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Prefix | |
| */ | |
| protected java.lang.String localPrefix; | |
| /* 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 localPrefixTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getPrefix() { | |
| return localPrefix; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Prefix | |
| */ | |
| public void setPrefix(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localPrefixTracker = true; | |
| } else { | |
| localPrefixTracker = false; | |
| } | |
| localPrefix = param; | |
| } | |
| /** | |
| * field for Marker | |
| */ | |
| protected java.lang.String localMarker; | |
| /* 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 localMarkerTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getMarker() { | |
| return localMarker; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Marker | |
| */ | |
| public void setMarker(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localMarkerTracker = true; | |
| } else { | |
| localMarkerTracker = false; | |
| } | |
| localMarker = param; | |
| } | |
| /** | |
| * field for MaxKeys | |
| */ | |
| protected int localMaxKeys; | |
| /* 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 localMaxKeysTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return int | |
| */ | |
| public int getMaxKeys() { | |
| return localMaxKeys; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param MaxKeys | |
| */ | |
| public void setMaxKeys(int param) { | |
| // setting primitive attribute tracker to true | |
| if (param == java.lang.Integer.MIN_VALUE) { | |
| localMaxKeysTracker = false; | |
| } else { | |
| localMaxKeysTracker = true; | |
| } | |
| localMaxKeys = param; | |
| } | |
| /** | |
| * field for Delimiter | |
| */ | |
| protected java.lang.String localDelimiter; | |
| /* 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 localDelimiterTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDelimiter() { | |
| return localDelimiter; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Delimiter | |
| */ | |
| public void setDelimiter(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localDelimiterTracker = true; | |
| } else { | |
| localDelimiterTracker = false; | |
| } | |
| localDelimiter = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListBucket.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListBucket", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListBucket", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localPrefixTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Prefix", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Prefix"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Prefix"); | |
| } | |
| if (localPrefix == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localPrefix); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localMarkerTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Marker", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Marker"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Marker"); | |
| } | |
| if (localMarker == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localMarker); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localMaxKeysTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "MaxKeys", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "MaxKeys"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("MaxKeys"); | |
| } | |
| if (localMaxKeys == java.lang.Integer.MIN_VALUE) { | |
| throw new org.apache.axis2.databinding.ADBException("MaxKeys cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localDelimiterTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Delimiter", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Delimiter"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Delimiter"); | |
| } | |
| if (localDelimiter == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDelimiter); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localPrefixTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Prefix")); | |
| if (localPrefix != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); | |
| } | |
| } | |
| if (localMarkerTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Marker")); | |
| if (localMarker != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMarker)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Marker cannot be null!!"); | |
| } | |
| } | |
| if (localMaxKeysTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "MaxKeys")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMaxKeys)); | |
| } | |
| if (localDelimiterTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Delimiter")); | |
| if (localDelimiter != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDelimiter)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Delimiter cannot be null!!"); | |
| } | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 ListBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListBucket object = new ListBucket(); | |
| 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 (!"ListBucket".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListBucket)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Prefix").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setPrefix(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://s3.amazonaws.com/doc/2006-03-01/", "Marker").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setMarker(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://s3.amazonaws.com/doc/2006-03-01/", "MaxKeys").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setMaxKeys(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); | |
| reader.next(); | |
| } // End of if for expected property start element | |
| else { | |
| object.setMaxKeys(java.lang.Integer.MIN_VALUE); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Delimiter").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDelimiter(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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class MetadataEntry implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = MetadataEntry | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Name | |
| */ | |
| 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) { | |
| localName = param; | |
| } | |
| /** | |
| * field for Value | |
| */ | |
| protected java.lang.String localValue; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getValue() { | |
| return localValue; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Value | |
| */ | |
| public void setValue(java.lang.String param) { | |
| localValue = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| MetadataEntry.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":MetadataEntry", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "MetadataEntry", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Name", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Name"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Name"); | |
| } | |
| if (localName == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localName); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Value", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Value"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Value"); | |
| } | |
| if (localValue == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Value cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localValue); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Name")); | |
| if (localName != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localName)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Name cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Value")); | |
| if (localValue != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Value 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 MetadataEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| MetadataEntry object = new MetadataEntry(); | |
| 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 (!"MetadataEntry".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (MetadataEntry)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://s3.amazonaws.com/doc/2006-03-01/", "Name").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setName(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Value").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setValue(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetBucketAccessControlPolicy implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetBucketAccessControlPolicy", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetBucketAccessControlPolicy.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetBucketAccessControlPolicy", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetBucketAccessControlPolicy", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 GetBucketAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetBucketAccessControlPolicy object = new GetBucketAccessControlPolicy(); | |
| 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 (!"GetBucketAccessControlPolicy".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetBucketAccessControlPolicy)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObjectExtendedResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectExtendedResponse", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for GetObjectResponse | |
| */ | |
| protected GetObjectResult localGetObjectResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return GetObjectResult | |
| */ | |
| public GetObjectResult getGetObjectResponse() { | |
| return localGetObjectResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetObjectResponse | |
| */ | |
| public void setGetObjectResponse(GetObjectResult param) { | |
| localGetObjectResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectExtendedResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectExtendedResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectExtendedResponse", xmlWriter); | |
| } | |
| } | |
| if (localGetObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); | |
| } | |
| localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse")); | |
| if (localGetObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); | |
| } | |
| elementList.add(localGetObjectResponse); | |
| 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 GetObjectExtendedResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectExtendedResponse object = new GetObjectExtendedResponse(); | |
| 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 (!"GetObjectExtendedResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectExtendedResponse)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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse").equals(reader.getName())) { | |
| object.setGetObjectResponse(GetObjectResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class StorageClass implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "StorageClass", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for StorageClass | |
| */ | |
| protected java.lang.String localStorageClass; | |
| private static java.util.HashMap _table_ = new java.util.HashMap(); | |
| // Constructor | |
| protected StorageClass(java.lang.String value, boolean isRegisterValue) { | |
| localStorageClass = value; | |
| if (isRegisterValue) { | |
| _table_.put(localStorageClass, this); | |
| } | |
| } | |
| public static final java.lang.String _STANDARD = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STANDARD"); | |
| public static final java.lang.String _UNKNOWN = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNKNOWN"); | |
| public static final StorageClass STANDARD = new StorageClass(_STANDARD, true); | |
| public static final StorageClass UNKNOWN = new StorageClass(_UNKNOWN, true); | |
| public java.lang.String getValue() { | |
| return localStorageClass; | |
| } | |
| @Override | |
| public boolean equals(java.lang.Object obj) { | |
| return (obj == this); | |
| } | |
| @Override | |
| public int hashCode() { | |
| return toString().hashCode(); | |
| } | |
| @Override | |
| public java.lang.String toString() { | |
| return localStorageClass.toString(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| StorageClass.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if (!namespace.equals("")) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, localName, namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, localName); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(localName); | |
| } | |
| // add the type details if this is used in a simple type | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":StorageClass", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "StorageClass", xmlWriter); | |
| } | |
| } | |
| if (localStorageClass == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Value cannot be null !!"); | |
| } else { | |
| xmlWriter.writeCharacters(localStorageClass); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(localStorageClass)}, null); | |
| } | |
| /** | |
| * Factory class that keeps the parse method | |
| */ | |
| public static class Factory { | |
| public static StorageClass fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { | |
| StorageClass enumeration = (StorageClass) | |
| _table_.get(value); | |
| if (enumeration == null) | |
| throw new java.lang.IllegalArgumentException(); | |
| return enumeration; | |
| } | |
| public static StorageClass 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 StorageClass 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 StorageClass.Factory.fromString(content, namespaceUri); | |
| } else { | |
| return StorageClass.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 StorageClass parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| StorageClass 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()) { | |
| 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 = StorageClass.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 = StorageClass.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 PutObjectResult implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = PutObjectResult | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for ETag | |
| */ | |
| protected java.lang.String localETag; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getETag() { | |
| return localETag; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ETag | |
| */ | |
| public void setETag(java.lang.String param) { | |
| localETag = param; | |
| } | |
| /** | |
| * field for LastModified | |
| */ | |
| protected java.util.Calendar localLastModified; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getLastModified() { | |
| return localLastModified; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param LastModified | |
| */ | |
| public void setLastModified(java.util.Calendar param) { | |
| localLastModified = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PutObjectResult.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PutObjectResult", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PutObjectResult", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ETag", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ETag"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ETag"); | |
| } | |
| if (localETag == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localETag); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "LastModified", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "LastModified"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("LastModified"); | |
| } | |
| if (localLastModified == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("LastModified cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "ETag")); | |
| if (localETag != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified")); | |
| if (localLastModified != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLastModified)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("LastModified 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 PutObjectResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PutObjectResult object = new PutObjectResult(); | |
| 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 (!"PutObjectResult".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PutObjectResult)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://s3.amazonaws.com/doc/2006-03-01/", "ETag").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setETag(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "LastModified").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setLastModified(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class AccessControlList implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = AccessControlList | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Grant | |
| * This was an Array! | |
| */ | |
| protected Grant[] localGrant; | |
| /* 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 localGrantTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return Grant[] | |
| */ | |
| public Grant[] getGrant() { | |
| return localGrant; | |
| } | |
| /** | |
| * validate the array for Grant | |
| */ | |
| protected void validateGrant(Grant[] param) { | |
| if ((param != null) && (param.length > 100)) { | |
| throw new java.lang.RuntimeException(); | |
| } | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Grant | |
| */ | |
| public void setGrant(Grant[] param) { | |
| validateGrant(param); | |
| if (param != null) { | |
| //update the setting tracker | |
| localGrantTracker = true; | |
| } else { | |
| localGrantTracker = false; | |
| } | |
| localGrant = param; | |
| } | |
| /** | |
| * Auto generated add method for the array for convenience | |
| * @param param Grant | |
| */ | |
| public void addGrant(Grant param) { | |
| if (localGrant == null) { | |
| localGrant = new Grant[] {}; | |
| } | |
| //update the setting tracker | |
| localGrantTracker = true; | |
| java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(localGrant); | |
| list.add(param); | |
| localGrant = (Grant[])list.toArray(new Grant[list.size()]); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| AccessControlList.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":AccessControlList", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AccessControlList", xmlWriter); | |
| } | |
| } | |
| if (localGrantTracker) { | |
| if (localGrant != null) { | |
| for (int i = 0; i < localGrant.length; i++) { | |
| if (localGrant[i] != null) { | |
| localGrant[i].serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Grant"), factory, xmlWriter); | |
| } else { | |
| // we don't have to do any thing since minOccures is zero | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Grant cannot be null!!"); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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 (localGrantTracker) { | |
| if (localGrant != null) { | |
| for (int i = 0; i < localGrant.length; i++) { | |
| if (localGrant[i] != null) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Grant")); | |
| elementList.add(localGrant[i]); | |
| } else { | |
| // nothing to do | |
| } | |
| } | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Grant 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 AccessControlList parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| AccessControlList object = new AccessControlList(); | |
| 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 (!"AccessControlList".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (AccessControlList)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://s3.amazonaws.com/doc/2006-03-01/", "Grant").equals(reader.getName())) { | |
| // Process the array and step past its final element's end. | |
| list1.add(Grant.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://s3.amazonaws.com/doc/2006-03-01/", "Grant").equals(reader.getName())) { | |
| list1.add(Grant.Factory.parse(reader)); | |
| } else { | |
| loopDone1 = true; | |
| } | |
| } | |
| } | |
| // call the converter utility to convert and set the array | |
| object.setGrant((Grant[])org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(Grant.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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class ListBucketResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListBucketResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for ListBucketResponse | |
| */ | |
| protected ListBucketResult localListBucketResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return ListBucketResult | |
| */ | |
| public ListBucketResult getListBucketResponse() { | |
| return localListBucketResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ListBucketResponse | |
| */ | |
| public void setListBucketResponse(ListBucketResult param) { | |
| localListBucketResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| ListBucketResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":ListBucketResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListBucketResponse", xmlWriter); | |
| } | |
| } | |
| if (localListBucketResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); | |
| } | |
| localListBucketResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ListBucketResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "ListBucketResponse")); | |
| if (localListBucketResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("ListBucketResponse cannot be null!!"); | |
| } | |
| elementList.add(localListBucketResponse); | |
| 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 ListBucketResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| ListBucketResponse object = new ListBucketResponse(); | |
| 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 (!"ListBucketResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (ListBucketResponse)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://s3.amazonaws.com/doc/2006-03-01/", "ListBucketResponse").equals(reader.getName())) { | |
| object.setListBucketResponse(ListBucketResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class AccessControlPolicy implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = AccessControlPolicy | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Owner | |
| */ | |
| protected CanonicalUser localOwner; | |
| /** | |
| * Auto generated getter method | |
| * @return CanonicalUser | |
| */ | |
| public CanonicalUser getOwner() { | |
| return localOwner; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Owner | |
| */ | |
| public void setOwner(CanonicalUser param) { | |
| localOwner = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| AccessControlPolicy.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":AccessControlPolicy", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AccessControlPolicy", xmlWriter); | |
| } | |
| } | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| localOwner.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Owner"), factory, xmlWriter); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Owner")); | |
| if (localOwner == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Owner cannot be null!!"); | |
| } | |
| elementList.add(localOwner); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| 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 AccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| AccessControlPolicy object = new AccessControlPolicy(); | |
| 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 (!"AccessControlPolicy".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (AccessControlPolicy)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://s3.amazonaws.com/doc/2006-03-01/", "Owner").equals(reader.getName())) { | |
| object.setOwner(CanonicalUser.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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PrefixEntry implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = PrefixEntry | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Prefix | |
| */ | |
| protected java.lang.String localPrefix; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getPrefix() { | |
| return localPrefix; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Prefix | |
| */ | |
| public void setPrefix(java.lang.String param) { | |
| localPrefix = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PrefixEntry.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PrefixEntry", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PrefixEntry", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Prefix", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Prefix"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Prefix"); | |
| } | |
| if (localPrefix == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Prefix cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localPrefix); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Prefix")); | |
| if (localPrefix != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPrefix)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Prefix 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 PrefixEntry parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PrefixEntry object = new PrefixEntry(); | |
| 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 (!"PrefixEntry".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PrefixEntry)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://s3.amazonaws.com/doc/2006-03-01/", "Prefix").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setPrefix(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObjectAccessControlPolicy implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectAccessControlPolicy", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectAccessControlPolicy.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectAccessControlPolicy", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectAccessControlPolicy", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 GetObjectAccessControlPolicy parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectAccessControlPolicy object = new GetObjectAccessControlPolicy(); | |
| 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 (!"GetObjectAccessControlPolicy".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectAccessControlPolicy)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObject implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObject", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for GetMetadata | |
| */ | |
| protected boolean localGetMetadata; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getGetMetadata() { | |
| return localGetMetadata; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetMetadata | |
| */ | |
| public void setGetMetadata(boolean param) { | |
| localGetMetadata = param; | |
| } | |
| /** | |
| * field for GetData | |
| */ | |
| protected boolean localGetData; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getGetData() { | |
| return localGetData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetData | |
| */ | |
| public void setGetData(boolean param) { | |
| localGetData = param; | |
| } | |
| /** | |
| * field for InlineData | |
| */ | |
| protected boolean localInlineData; | |
| /** | |
| * Auto generated getter method | |
| * @return boolean | |
| */ | |
| public boolean getInlineData() { | |
| return localInlineData; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param InlineData | |
| */ | |
| public void setInlineData(boolean param) { | |
| localInlineData = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObject.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObject", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObject", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "GetMetadata", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "GetMetadata"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("GetMetadata"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("GetMetadata cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "GetData", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "GetData"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("GetData"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("GetData cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "InlineData", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "InlineData"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("InlineData"); | |
| } | |
| if (false) { | |
| throw new org.apache.axis2.databinding.ADBException("InlineData cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetMetadata")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetMetadata)); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetData")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetData)); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "InlineData")); | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localInlineData)); | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential 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 GetObject parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObject object = new GetObject(); | |
| 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 (!"GetObject".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObject)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetMetadata").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setGetMetadata(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetData").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setGetData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "InlineData").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setInlineData(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CanonicalUser extends User implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = CanonicalUser | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for ID | |
| */ | |
| 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) { | |
| localID = param; | |
| } | |
| /** | |
| * field for DisplayName | |
| */ | |
| protected java.lang.String localDisplayName; | |
| /* 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 localDisplayNameTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getDisplayName() { | |
| return localDisplayName; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param DisplayName | |
| */ | |
| public void setDisplayName(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localDisplayNameTracker = true; | |
| } else { | |
| localDisplayNameTracker = false; | |
| } | |
| localDisplayName = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @param parentQName | |
| * @param factory | |
| * @return org.apache.axiom.om.OMElement | |
| */ | |
| @Override | |
| 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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CanonicalUser.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CanonicalUser", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CanonicalUser", xmlWriter); | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ID", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ID"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ID"); | |
| } | |
| 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 (localDisplayNameTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "DisplayName", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "DisplayName"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("DisplayName"); | |
| } | |
| if (localDisplayName == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("DisplayName cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localDisplayName); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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("http://www.w3.org/2001/XMLSchema-instance", "type")); | |
| attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CanonicalUser")); | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "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 (localDisplayNameTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DisplayName")); | |
| if (localDisplayName != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDisplayName)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("DisplayName 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 CanonicalUser parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CanonicalUser object = new CanonicalUser(); | |
| 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 (!"CanonicalUser".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CanonicalUser)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://s3.amazonaws.com/doc/2006-03-01/", "ID").equals(reader.getName())) { | |
| 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 { | |
| // A start element we are not expecting indicates an invalid parameter was passed | |
| throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "DisplayName").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setDisplayName(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetBucketLoggingStatusResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "GetBucketLoggingStatusResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for GetBucketLoggingStatusResponse | |
| */ | |
| protected BucketLoggingStatus localGetBucketLoggingStatusResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return BucketLoggingStatus | |
| */ | |
| public BucketLoggingStatus getGetBucketLoggingStatusResponse() { | |
| return localGetBucketLoggingStatusResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetBucketLoggingStatusResponse | |
| */ | |
| public void setGetBucketLoggingStatusResponse(BucketLoggingStatus param) { | |
| localGetBucketLoggingStatusResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetBucketLoggingStatusResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetBucketLoggingStatusResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetBucketLoggingStatusResponse", xmlWriter); | |
| } | |
| } | |
| if (localGetBucketLoggingStatusResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); | |
| } | |
| localGetBucketLoggingStatusResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetBucketLoggingStatusResponse"), | |
| factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "GetBucketLoggingStatusResponse")); | |
| if (localGetBucketLoggingStatusResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetBucketLoggingStatusResponse cannot be null!!"); | |
| } | |
| elementList.add(localGetBucketLoggingStatusResponse); | |
| 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 GetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetBucketLoggingStatusResponse object = new GetBucketLoggingStatusResponse(); | |
| 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 (!"GetBucketLoggingStatusResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetBucketLoggingStatusResponse)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://s3.amazonaws.com/doc/2006-03-01/", "GetBucketLoggingStatusResponse").equals(reader.getName())) { | |
| object.setGetBucketLoggingStatusResponse(BucketLoggingStatus.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class Result implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = Result | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Status | |
| */ | |
| protected Status localStatus; | |
| /** | |
| * Auto generated getter method | |
| * @return Status | |
| */ | |
| public Status getStatus() { | |
| return localStatus; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Status | |
| */ | |
| public void setStatus(Status param) { | |
| localStatus = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| Result.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Result", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Result", xmlWriter); | |
| } | |
| } | |
| if (localStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); | |
| } | |
| localStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Status"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Status")); | |
| if (localStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("Status cannot be null!!"); | |
| } | |
| elementList.add(localStatus); | |
| 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 Result parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| Result object = new Result(); | |
| 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 (!"Result".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (Result)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://s3.amazonaws.com/doc/2006-03-01/", "Status").equals(reader.getName())) { | |
| object.setStatus(Status.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CopyObjectResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopyObjectResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for CopyObjectResult | |
| */ | |
| protected CopyObjectResult localCopyObjectResult; | |
| /** | |
| * Auto generated getter method | |
| * @return CopyObjectResult | |
| */ | |
| public CopyObjectResult getCopyObjectResult() { | |
| return localCopyObjectResult; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param CopyObjectResult | |
| */ | |
| public void setCopyObjectResult(CopyObjectResult param) { | |
| localCopyObjectResult = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CopyObjectResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CopyObjectResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CopyObjectResponse", xmlWriter); | |
| } | |
| } | |
| if (localCopyObjectResult == null) { | |
| throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); | |
| } | |
| localCopyObjectResult.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CopyObjectResult"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "CopyObjectResult")); | |
| if (localCopyObjectResult == null) { | |
| throw new org.apache.axis2.databinding.ADBException("CopyObjectResult cannot be null!!"); | |
| } | |
| elementList.add(localCopyObjectResult); | |
| 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 CopyObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CopyObjectResponse object = new CopyObjectResponse(); | |
| 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 (!"CopyObjectResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CopyObjectResponse)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://s3.amazonaws.com/doc/2006-03-01/", "CopyObjectResult").equals(reader.getName())) { | |
| object.setCopyObjectResult(CopyObjectResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class GetObjectResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for GetObjectResponse | |
| */ | |
| protected GetObjectResult localGetObjectResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return GetObjectResult | |
| */ | |
| public GetObjectResult getGetObjectResponse() { | |
| return localGetObjectResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param GetObjectResponse | |
| */ | |
| public void setGetObjectResponse(GetObjectResult param) { | |
| localGetObjectResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| GetObjectResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":GetObjectResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "GetObjectResponse", xmlWriter); | |
| } | |
| } | |
| if (localGetObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); | |
| } | |
| localGetObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse")); | |
| if (localGetObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("GetObjectResponse cannot be null!!"); | |
| } | |
| elementList.add(localGetObjectResponse); | |
| 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 GetObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| GetObjectResponse object = new GetObjectResponse(); | |
| 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 (!"GetObjectResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (GetObjectResponse)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://s3.amazonaws.com/doc/2006-03-01/", "GetObjectResponse").equals(reader.getName())) { | |
| object.setGetObjectResponse(GetObjectResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PutObjectInlineResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObjectInlineResponse", | |
| "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for PutObjectInlineResponse | |
| */ | |
| protected PutObjectResult localPutObjectInlineResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return PutObjectResult | |
| */ | |
| public PutObjectResult getPutObjectInlineResponse() { | |
| return localPutObjectInlineResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param PutObjectInlineResponse | |
| */ | |
| public void setPutObjectInlineResponse(PutObjectResult param) { | |
| localPutObjectInlineResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PutObjectInlineResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PutObjectInlineResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PutObjectInlineResponse", xmlWriter); | |
| } | |
| } | |
| if (localPutObjectInlineResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); | |
| } | |
| localPutObjectInlineResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObjectInlineResponse"), factory, | |
| xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "PutObjectInlineResponse")); | |
| if (localPutObjectInlineResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("PutObjectInlineResponse cannot be null!!"); | |
| } | |
| elementList.add(localPutObjectInlineResponse); | |
| 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 PutObjectInlineResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PutObjectInlineResponse object = new PutObjectInlineResponse(); | |
| 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 (!"PutObjectInlineResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PutObjectInlineResponse)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://s3.amazonaws.com/doc/2006-03-01/", "PutObjectInlineResponse").equals(reader.getName())) { | |
| object.setPutObjectInlineResponse(PutObjectResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class CreateBucket implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "CreateBucket", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AccessControlList | |
| */ | |
| protected AccessControlList localAccessControlList; | |
| /* 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 localAccessControlListTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return AccessControlList | |
| */ | |
| public AccessControlList getAccessControlList() { | |
| return localAccessControlList; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AccessControlList | |
| */ | |
| public void setAccessControlList(AccessControlList param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAccessControlListTracker = true; | |
| } else { | |
| localAccessControlListTracker = false; | |
| } | |
| localAccessControlList = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| CreateBucket.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":CreateBucket", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CreateBucket", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAccessControlListTracker) { | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| localAccessControlList.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList"), factory, xmlWriter); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAccessControlListTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList")); | |
| if (localAccessControlList == null) { | |
| throw new org.apache.axis2.databinding.ADBException("AccessControlList cannot be null!!"); | |
| } | |
| elementList.add(localAccessControlList); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature 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 CreateBucket parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| CreateBucket object = new CreateBucket(); | |
| 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 (!"CreateBucket".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (CreateBucket)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AccessControlList").equals(reader.getName())) { | |
| object.setAccessControlList(AccessControlList.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://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PutObjectResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObjectResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for PutObjectResponse | |
| */ | |
| protected PutObjectResult localPutObjectResponse; | |
| /** | |
| * Auto generated getter method | |
| * @return PutObjectResult | |
| */ | |
| public PutObjectResult getPutObjectResponse() { | |
| return localPutObjectResponse; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param PutObjectResponse | |
| */ | |
| public void setPutObjectResponse(PutObjectResult param) { | |
| localPutObjectResponse = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PutObjectResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PutObjectResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PutObjectResponse", xmlWriter); | |
| } | |
| } | |
| if (localPutObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); | |
| } | |
| localPutObjectResponse.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PutObjectResponse"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "PutObjectResponse")); | |
| if (localPutObjectResponse == null) { | |
| throw new org.apache.axis2.databinding.ADBException("PutObjectResponse cannot be null!!"); | |
| } | |
| elementList.add(localPutObjectResponse); | |
| 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 PutObjectResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PutObjectResponse object = new PutObjectResponse(); | |
| 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 (!"PutObjectResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PutObjectResponse)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://s3.amazonaws.com/doc/2006-03-01/", "PutObjectResponse").equals(reader.getName())) { | |
| object.setPutObjectResponse(PutObjectResult.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class PostResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "PostResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Location | |
| */ | |
| protected org.apache.axis2.databinding.types.URI localLocation; | |
| /** | |
| * Auto generated getter method | |
| * @return org.apache.axis2.databinding.types.URI | |
| */ | |
| public org.apache.axis2.databinding.types.URI getLocation() { | |
| return localLocation; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Location | |
| */ | |
| public void setLocation(org.apache.axis2.databinding.types.URI param) { | |
| localLocation = param; | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for Key | |
| */ | |
| protected java.lang.String localKey; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getKey() { | |
| return localKey; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Key | |
| */ | |
| public void setKey(java.lang.String param) { | |
| localKey = param; | |
| } | |
| /** | |
| * field for ETag | |
| */ | |
| protected java.lang.String localETag; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getETag() { | |
| return localETag; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param ETag | |
| */ | |
| public void setETag(java.lang.String param) { | |
| localETag = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| PostResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":PostResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PostResponse", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Location", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Location"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Location"); | |
| } | |
| if (localLocation == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Key", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Key"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Key"); | |
| } | |
| if (localKey == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localKey); | |
| } | |
| xmlWriter.writeEndElement(); | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "ETag", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "ETag"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("ETag"); | |
| } | |
| if (localETag == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("ETag cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localETag); | |
| } | |
| xmlWriter.writeEndElement(); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Location")); | |
| if (localLocation != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLocation)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Location cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key")); | |
| if (localKey != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localKey)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Key cannot be null!!"); | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag")); | |
| if (localETag != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localETag)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("ETag 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 PostResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| PostResponse object = new PostResponse(); | |
| 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 (!"PostResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (PostResponse)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://s3.amazonaws.com/doc/2006-03-01/", "Location").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setLocation(org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Key").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setKey(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "ETag").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setETag(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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetBucketAccessControlPolicyResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "SetBucketAccessControlPolicyResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetBucketAccessControlPolicyResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetBucketAccessControlPolicyResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetBucketAccessControlPolicyResponse", xmlWriter); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(); | |
| 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 SetBucketAccessControlPolicyResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetBucketAccessControlPolicyResponse object = new SetBucketAccessControlPolicyResponse(); | |
| 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 (!"SetBucketAccessControlPolicyResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetBucketAccessControlPolicyResponse)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()) | |
| // A start element we are not expecting indicates a trailing invalid property | |
| throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetBucketLoggingStatusResponse implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", | |
| "SetBucketLoggingStatusResponse", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetBucketLoggingStatusResponse.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetBucketLoggingStatusResponse", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetBucketLoggingStatusResponse", xmlWriter); | |
| } | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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(); | |
| 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 SetBucketLoggingStatusResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetBucketLoggingStatusResponse object = new SetBucketLoggingStatusResponse(); | |
| 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 (!"SetBucketLoggingStatusResponse".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetBucketLoggingStatusResponse)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()) | |
| // A start element we are not expecting indicates a trailing invalid property | |
| throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class User extends Grantee implements org.apache.axis2.databinding.ADBBean { | |
| /* This type was generated from the piece of schema that had | |
| name = User | |
| Namespace URI = http://s3.amazonaws.com/doc/2006-03-01/ | |
| Namespace Prefix = ns1 | |
| */ | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @param parentQName | |
| * @param factory | |
| * @return org.apache.axiom.om.OMElement | |
| */ | |
| @Override | |
| 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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| User.this.serialize(parentQName, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":User", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "User", xmlWriter); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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("http://www.w3.org/2001/XMLSchema-instance", "type")); | |
| attribList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "User")); | |
| 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 User parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| User object = null; | |
| 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 (!"User".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (User)ExtensionMapper.getTypeObject(nsUri, type, reader); | |
| } | |
| throw new org.apache.axis2.databinding.ADBException("The an abstract class can not be instantiated !!!"); | |
| } | |
| } | |
| // Note all attributes that were handled. Used to differ normal attributes | |
| // from anyAttributes. | |
| java.util.Vector handledAttributes = new java.util.Vector(); | |
| reader.next(); | |
| } catch (javax.xml.stream.XMLStreamException e) { | |
| throw new java.lang.Exception(e); | |
| } | |
| return object; | |
| } | |
| }//end of factory class | |
| } | |
| public static class SetBucketLoggingStatus implements org.apache.axis2.databinding.ADBBean { | |
| public static final javax.xml.namespace.QName MY_QNAME = | |
| new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "SetBucketLoggingStatus", "ns1"); | |
| private static java.lang.String generatePrefix(java.lang.String namespace) { | |
| if (namespace.equals("http://s3.amazonaws.com/doc/2006-03-01/")) { | |
| return "ns1"; | |
| } | |
| return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| /** | |
| * field for Bucket | |
| */ | |
| protected java.lang.String localBucket; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getBucket() { | |
| return localBucket; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Bucket | |
| */ | |
| public void setBucket(java.lang.String param) { | |
| localBucket = param; | |
| } | |
| /** | |
| * field for AWSAccessKeyId | |
| */ | |
| protected java.lang.String localAWSAccessKeyId; | |
| /* 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 localAWSAccessKeyIdTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getAWSAccessKeyId() { | |
| return localAWSAccessKeyId; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param AWSAccessKeyId | |
| */ | |
| public void setAWSAccessKeyId(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localAWSAccessKeyIdTracker = true; | |
| } else { | |
| localAWSAccessKeyIdTracker = false; | |
| } | |
| localAWSAccessKeyId = param; | |
| } | |
| /** | |
| * field for Timestamp | |
| */ | |
| protected java.util.Calendar localTimestamp; | |
| /* 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 localTimestampTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.util.Calendar | |
| */ | |
| public java.util.Calendar getTimestamp() { | |
| return localTimestamp; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Timestamp | |
| */ | |
| public void setTimestamp(java.util.Calendar param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localTimestampTracker = true; | |
| } else { | |
| localTimestampTracker = false; | |
| } | |
| localTimestamp = param; | |
| } | |
| /** | |
| * field for Signature | |
| */ | |
| protected java.lang.String localSignature; | |
| /* 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 localSignatureTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getSignature() { | |
| return localSignature; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Signature | |
| */ | |
| public void setSignature(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localSignatureTracker = true; | |
| } else { | |
| localSignatureTracker = false; | |
| } | |
| localSignature = param; | |
| } | |
| /** | |
| * field for Credential | |
| */ | |
| protected java.lang.String localCredential; | |
| /* 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 localCredentialTracker = false; | |
| /** | |
| * Auto generated getter method | |
| * @return java.lang.String | |
| */ | |
| public java.lang.String getCredential() { | |
| return localCredential; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param Credential | |
| */ | |
| public void setCredential(java.lang.String param) { | |
| if (param != null) { | |
| //update the setting tracker | |
| localCredentialTracker = true; | |
| } else { | |
| localCredentialTracker = false; | |
| } | |
| localCredential = param; | |
| } | |
| /** | |
| * field for BucketLoggingStatus | |
| */ | |
| protected BucketLoggingStatus localBucketLoggingStatus; | |
| /** | |
| * Auto generated getter method | |
| * @return BucketLoggingStatus | |
| */ | |
| public BucketLoggingStatus getBucketLoggingStatus() { | |
| return localBucketLoggingStatus; | |
| } | |
| /** | |
| * Auto generated setter method | |
| * @param param BucketLoggingStatus | |
| */ | |
| public void setBucketLoggingStatus(BucketLoggingStatus param) { | |
| localBucketLoggingStatus = param; | |
| } | |
| /** | |
| * isReaderMTOMAware | |
| * @return true if the reader supports MTOM | |
| */ | |
| public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { | |
| boolean isReaderMTOMAware = false; | |
| try { | |
| isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); | |
| } catch (java.lang.IllegalArgumentException e) { | |
| isReaderMTOMAware = false; | |
| } | |
| return isReaderMTOMAware; | |
| } | |
| /** | |
| * | |
| * @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) { | |
| @Override | |
| public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| SetBucketLoggingStatus.this.serialize(MY_QNAME, factory, xmlWriter); | |
| } | |
| }; | |
| return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, | |
| org.apache.axis2.databinding.ADBException { | |
| serialize(parentQName, factory, xmlWriter, false); | |
| } | |
| @Override | |
| public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, | |
| org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter 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(); | |
| if ((namespace != null) && (namespace.trim().length() > 0)) { | |
| java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); | |
| if (writerPrefix != null) { | |
| xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); | |
| } else { | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| } | |
| xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement(parentQName.getLocalPart()); | |
| } | |
| if (serializeType) { | |
| java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://s3.amazonaws.com/doc/2006-03-01/"); | |
| if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":SetBucketLoggingStatus", xmlWriter); | |
| } else { | |
| writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SetBucketLoggingStatus", xmlWriter); | |
| } | |
| } | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Bucket", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Bucket"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Bucket"); | |
| } | |
| if (localBucket == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localBucket); | |
| } | |
| xmlWriter.writeEndElement(); | |
| if (localAWSAccessKeyIdTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "AWSAccessKeyId", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "AWSAccessKeyId"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("AWSAccessKeyId"); | |
| } | |
| if (localAWSAccessKeyId == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localAWSAccessKeyId); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localTimestampTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Timestamp", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Timestamp"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Timestamp"); | |
| } | |
| if (localTimestamp == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localSignatureTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Signature", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Signature"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Signature"); | |
| } | |
| if (localSignature == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localSignature); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localCredentialTracker) { | |
| namespace = "http://s3.amazonaws.com/doc/2006-03-01/"; | |
| if (!namespace.equals("")) { | |
| prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| xmlWriter.writeStartElement(prefix, "Credential", namespace); | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } else { | |
| xmlWriter.writeStartElement(namespace, "Credential"); | |
| } | |
| } else { | |
| xmlWriter.writeStartElement("Credential"); | |
| } | |
| if (localCredential == null) { | |
| // write the nil attribute | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } else { | |
| xmlWriter.writeCharacters(localCredential); | |
| } | |
| xmlWriter.writeEndElement(); | |
| } | |
| if (localBucketLoggingStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); | |
| } | |
| localBucketLoggingStatus.serialize(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "BucketLoggingStatus"), factory, xmlWriter); | |
| xmlWriter.writeEndElement(); | |
| } | |
| /** | |
| * Util method to write an attribute with the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String prefix, java.lang.String namespace, java.lang.String attName, java.lang.String attValue, | |
| javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (xmlWriter.getPrefix(namespace) == null) { | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void writeAttribute(java.lang.String namespace, java.lang.String attName, java.lang.String attValue, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attValue); | |
| } | |
| } | |
| /** | |
| * Util method to write an attribute without the ns prefix | |
| */ | |
| private void | |
| writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) | |
| throws javax.xml.stream.XMLStreamException { | |
| java.lang.String attributeNamespace = qname.getNamespaceURI(); | |
| java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); | |
| if (attributePrefix == null) { | |
| attributePrefix = registerPrefix(xmlWriter, attributeNamespace); | |
| } | |
| java.lang.String attributeValue; | |
| if (attributePrefix.trim().length() > 0) { | |
| attributeValue = attributePrefix + ":" + qname.getLocalPart(); | |
| } else { | |
| attributeValue = qname.getLocalPart(); | |
| } | |
| if (namespace.equals("")) { | |
| xmlWriter.writeAttribute(attName, attributeValue); | |
| } else { | |
| registerPrefix(xmlWriter, namespace); | |
| xmlWriter.writeAttribute(namespace, attName, attributeValue); | |
| } | |
| } | |
| /** | |
| * method to handle Qnames | |
| */ | |
| private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String namespaceURI = qname.getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } else { | |
| // i.e this is the default namespace | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } else { | |
| xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); | |
| } | |
| } | |
| private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { | |
| if (qnames != null) { | |
| // we have to store this data until last moment since it is not possible to write any | |
| // namespace data after writing the charactor data | |
| java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); | |
| java.lang.String namespaceURI = null; | |
| java.lang.String prefix = null; | |
| for (int i = 0; i < qnames.length; i++) { | |
| if (i > 0) { | |
| stringToWrite.append(" "); | |
| } | |
| namespaceURI = qnames[i].getNamespaceURI(); | |
| if (namespaceURI != null) { | |
| prefix = xmlWriter.getPrefix(namespaceURI); | |
| if ((prefix == null) || (prefix.length() == 0)) { | |
| prefix = generatePrefix(namespaceURI); | |
| xmlWriter.writeNamespace(prefix, namespaceURI); | |
| xmlWriter.setPrefix(prefix, namespaceURI); | |
| } | |
| if (prefix.trim().length() > 0) { | |
| stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } else { | |
| stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); | |
| } | |
| } | |
| xmlWriter.writeCharacters(stringToWrite.toString()); | |
| } | |
| } | |
| /** | |
| * Register a namespace prefix | |
| */ | |
| private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { | |
| java.lang.String prefix = xmlWriter.getPrefix(namespace); | |
| if (prefix == null) { | |
| prefix = generatePrefix(namespace); | |
| while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { | |
| prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); | |
| } | |
| xmlWriter.writeNamespace(prefix, namespace); | |
| xmlWriter.setPrefix(prefix, namespace); | |
| } | |
| return prefix; | |
| } | |
| /** | |
| * databinding method to get an XML representation of this object | |
| * | |
| */ | |
| @Override | |
| 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://s3.amazonaws.com/doc/2006-03-01/", "Bucket")); | |
| if (localBucket != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucket)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Bucket cannot be null!!"); | |
| } | |
| if (localAWSAccessKeyIdTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId")); | |
| if (localAWSAccessKeyId != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAWSAccessKeyId)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("AWSAccessKeyId cannot be null!!"); | |
| } | |
| } | |
| if (localTimestampTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Timestamp")); | |
| if (localTimestamp != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimestamp)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Timestamp cannot be null!!"); | |
| } | |
| } | |
| if (localSignatureTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Signature")); | |
| if (localSignature != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSignature)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Signature cannot be null!!"); | |
| } | |
| } | |
| if (localCredentialTracker) { | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "Credential")); | |
| if (localCredential != null) { | |
| elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localCredential)); | |
| } else { | |
| throw new org.apache.axis2.databinding.ADBException("Credential cannot be null!!"); | |
| } | |
| } | |
| elementList.add(new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "BucketLoggingStatus")); | |
| if (localBucketLoggingStatus == null) { | |
| throw new org.apache.axis2.databinding.ADBException("BucketLoggingStatus cannot be null!!"); | |
| } | |
| elementList.add(localBucketLoggingStatus); | |
| 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 SetBucketLoggingStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { | |
| SetBucketLoggingStatus object = new SetBucketLoggingStatus(); | |
| 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 (!"SetBucketLoggingStatus".equals(type)) { | |
| //find namespace for the prefix | |
| java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); | |
| return (SetBucketLoggingStatus)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://s3.amazonaws.com/doc/2006-03-01/", "Bucket").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setBucket(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.getLocalName()); | |
| } | |
| while (!reader.isStartElement() && !reader.isEndElement()) | |
| reader.next(); | |
| if (reader.isStartElement() && new javax.xml.namespace.QName("http://s3.amazonaws.com/doc/2006-03-01/", "AWSAccessKeyId").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setAWSAccessKeyId(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://s3.amazonaws.com/doc/2006-03-01/", "Timestamp").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setTimestamp(org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(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://s3.amazonaws.com/doc/2006-03-01/", "Signature").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setSignature(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://s3.amazonaws.com/doc/2006-03-01/", "Credential").equals(reader.getName())) { | |
| java.lang.String content = reader.getElementText(); | |
| object.setCredential(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://s3.amazonaws.com/doc/2006-03-01/", "BucketLoggingStatus").equals(reader.getName())) { | |
| object.setBucketLoggingStatus(BucketLoggingStatus.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.getLocalName()); | |
| } | |
| 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.getLocalName()); | |
| } 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(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.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(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.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(com.amazon.s3.client.AmazonS3Stub.CopyObject param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.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(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.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(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.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(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.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(com.amazon.s3.client.AmazonS3Stub.ListBucket param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.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(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.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(com.amazon.s3.client.AmazonS3Stub.PutObject param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.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(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.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(com.amazon.s3.client.AmazonS3Stub.CreateBucket param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.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(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.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(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.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(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.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(com.amazon.s3.client.AmazonS3Stub.GetObject param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.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(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.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(com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.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(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.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(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.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(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.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(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.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(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.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(com.amazon.s3.client.AmazonS3Stub.DeleteObject param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.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(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.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(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.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(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.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(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.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(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.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(com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.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(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.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(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.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(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse param, boolean optimizeContent) | |
| throws org.apache.axis2.AxisFault { | |
| try { | |
| return param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.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, com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CopyObject param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CopyObject.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, | |
| com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListBucket param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListBucket.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObject param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObject.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.CreateBucket param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.CreateBucket.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObject param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObject.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteBucket param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteBucket.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, | |
| com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.DeleteObject param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.DeleteObject.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, | |
| com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, | |
| com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy param, boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.PutObjectInline param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.PutObjectInline.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 */ | |
| private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.amazon.s3.client.AmazonS3Stub.GetObjectExtended param, | |
| boolean optimizeContent) throws org.apache.axis2.AxisFault { | |
| try { | |
| org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); | |
| emptyEnvelope.getBody().addChild(param.getOMElement(com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.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 (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.CopyObject.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.CopyObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.CopyObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.ListBucket.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.ListBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.ListBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.PutObject.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.PutObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.PutObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.CreateBucket.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.CreateBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.CreateBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.ListAllMyBuckets.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.ListAllMyBucketsResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObject.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.DeleteBucket.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.DeleteBucket.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.DeleteBucketResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetBucketLoggingStatusResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.DeleteObject.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.DeleteObject.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.DeleteObjectResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetBucketAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicy.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.SetObjectAccessControlPolicyResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.PutObjectInline.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.PutObjectInline.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.PutObjectInlineResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObjectExtended.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| if (com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.class.equals(type)) { | |
| return com.amazon.s3.client.AmazonS3Stub.GetObjectExtendedResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); | |
| } | |
| } catch (java.lang.Exception e) { | |
| throw org.apache.axis2.AxisFault.makeFault(e); | |
| } | |
| return null; | |
| } | |
| } |