1 /*
2  * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5  * the License. A copy of the License is located at
6  * 
7  * http://aws.amazon.com/apache2.0
8  * 
9  * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11  * and limitations under the License.
12  */

13 package com.amazonaws.services.sqs.model.transform;
14
15 import javax.xml.stream.events.XMLEvent;
16 import javax.annotation.Generated;
17
18 import com.amazonaws.services.sqs.model.*;
19 import com.amazonaws.transform.Unmarshaller;
20
21 import com.amazonaws.transform.StaxUnmarshallerContext;
22 import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;
23
24 /**
25  * GetQueueUrlResult StAX Unmarshaller
26  */

27
28 @Generated("com.amazonaws:aws-java-sdk-code-generator")
29 public class GetQueueUrlResultStaxUnmarshaller implements Unmarshaller<GetQueueUrlResult, StaxUnmarshallerContext> {
30
31     public GetQueueUrlResult unmarshall(StaxUnmarshallerContext context) throws Exception {
32         GetQueueUrlResult getQueueUrlResult = new GetQueueUrlResult();
33         int originalDepth = context.getCurrentDepth();
34         int targetDepth = originalDepth + 1;
35
36         if (context.isStartOfDocument())
37             targetDepth += 2;
38
39         while (true) {
40             XMLEvent xmlEvent = context.nextEvent();
41             if (xmlEvent.isEndDocument())
42                 return getQueueUrlResult;
43
44             if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
45
46                 if (context.testExpression("QueueUrl", targetDepth)) {
47                     getQueueUrlResult.setQueueUrl(StringStaxUnmarshaller.getInstance().unmarshall(context));
48                     continue;
49                 }
50             } else if (xmlEvent.isEndElement()) {
51                 if (context.getCurrentDepth() < originalDepth) {
52                     return getQueueUrlResult;
53                 }
54             }
55         }
56     }
57
58     private static GetQueueUrlResultStaxUnmarshaller instance;
59
60     public static GetQueueUrlResultStaxUnmarshaller getInstance() {
61         if (instance == null)
62             instance = new GetQueueUrlResultStaxUnmarshaller();
63         return instance;
64     }
65 }
66