public MaxCountRule unmarshall(StaxUnmarshallerContext context) throws Exception { MaxCountRule maxCountRule = new MaxCountRule(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return maxCountRule; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Enabled", targetDepth)) { maxCountRule.setEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("MaxCount", targetDepth)) { maxCountRule.setMaxCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("DeleteSourceFromS3", targetDepth)) { maxCountRule.setDeleteSourceFromS3(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return maxCountRule; } } } }
public MaxCountRule unmarshall(StaxUnmarshallerContext context) throws Exception { MaxCountRule maxCountRule = new MaxCountRule(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return maxCountRule; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Enabled", targetDepth)) { maxCountRule.setEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("MaxCount", targetDepth)) { maxCountRule.setMaxCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("DeleteSourceFromS3", targetDepth)) { maxCountRule.setDeleteSourceFromS3(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return maxCountRule; } } } }