public DescribeStackResourcesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeStackResourcesResult describeStackResourcesResult = new DescribeStackResourcesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeStackResourcesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackResources", targetDepth)) { describeStackResourcesResult.withStackResources(new ArrayList<StackResource>()); continue; } if (context.testExpression("StackResources/member", targetDepth)) { describeStackResourcesResult.withStackResources(StackResourceStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeStackResourcesResult; } } } }
public DescribeStackResourcesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeStackResourcesResult describeStackResourcesResult = new DescribeStackResourcesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeStackResourcesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackResources", targetDepth)) { describeStackResourcesResult.withStackResources(new ArrayList<StackResource>()); continue; } if (context.testExpression("StackResources/member", targetDepth)) { describeStackResourcesResult.withStackResources(StackResourceStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeStackResourcesResult; } } } }