public ReputationOptions unmarshall(StaxUnmarshallerContext context) throws Exception { ReputationOptions reputationOptions = new ReputationOptions(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return reputationOptions; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("SendingEnabled", targetDepth)) { reputationOptions.setSendingEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReputationMetricsEnabled", targetDepth)) { reputationOptions.setReputationMetricsEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("LastFreshStart", targetDepth)) { reputationOptions.setLastFreshStart(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return reputationOptions; } } } }
public ReputationOptions unmarshall(StaxUnmarshallerContext context) throws Exception { ReputationOptions reputationOptions = new ReputationOptions();
public ReputationOptions unmarshall(StaxUnmarshallerContext context) throws Exception { ReputationOptions reputationOptions = new ReputationOptions(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return reputationOptions; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("SendingEnabled", targetDepth)) { reputationOptions.setSendingEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReputationMetricsEnabled", targetDepth)) { reputationOptions.setReputationMetricsEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("LastFreshStart", targetDepth)) { reputationOptions.setLastFreshStart(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return reputationOptions; } } } }