public DescribeStacksResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeStacksResult describeStacksResult = new DescribeStacksResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeStacksResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Stacks", targetDepth)) { describeStacksResult.withStacks(new ArrayList<Stack>()); continue; } if (context.testExpression("Stacks/member", targetDepth)) { describeStacksResult.withStacks(StackStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { describeStacksResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeStacksResult; } } } }
public DescribeStacksResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeStacksResult describeStacksResult = new DescribeStacksResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeStacksResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Stacks", targetDepth)) { describeStacksResult.withStacks(new ArrayList<Stack>()); continue; } if (context.testExpression("Stacks/member", targetDepth)) { describeStacksResult.withStacks(StackStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { describeStacksResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeStacksResult; } } } }