public SlotMigration unmarshall(StaxUnmarshallerContext context) throws Exception { SlotMigration slotMigration = new SlotMigration(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return slotMigration; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("ProgressPercentage", targetDepth)) { slotMigration.setProgressPercentage(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return slotMigration; } } } }
public PricingDetail unmarshall(StaxUnmarshallerContext context) throws Exception { PricingDetail pricingDetail = new PricingDetail(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return pricingDetail; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("price", targetDepth)) { pricingDetail.setPrice(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("count", targetDepth)) { pricingDetail.setCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return pricingDetail; } } } }
/** * Constructor. * @return the instance. */ public static DoubleStaxUnmarshaller getInstance() { if (instance == null) instance = new DoubleStaxUnmarshaller(); return instance; } }
@Test public void testDoubleStaxUnmarshaller() throws Exception { Double data = new Double(1000.0); SimpleTypeStaxUnmarshallers.DoubleStaxUnmarshaller unmarshaller = SimpleTypeStaxUnmarshallers.DoubleStaxUnmarshaller .getInstance(); Double unmarshalled = unmarshaller.unmarshall(getContext(data.toString())); assertEquals(unmarshalled, 1000.0, .01); }
/** * Constructor. * @return the instance. */ public static DoubleStaxUnmarshaller getInstance() { if (instance == null) instance = new DoubleStaxUnmarshaller(); return instance; } }
/** * Constructor. * @return the instance. */ public static DoubleStaxUnmarshaller getInstance() { if (instance == null) instance = new DoubleStaxUnmarshaller(); return instance; } }
public RecurringCharge unmarshall(StaxUnmarshallerContext context) throws Exception { RecurringCharge recurringCharge = new RecurringCharge(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return recurringCharge; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("frequency", targetDepth)) { recurringCharge.setFrequency(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("amount", targetDepth)) { recurringCharge.setAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return recurringCharge; } } } }
public PricingDetail unmarshall(StaxUnmarshallerContext context) throws Exception { PricingDetail pricingDetail = new PricingDetail(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return pricingDetail; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("count", targetDepth)) { pricingDetail.setCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("price", targetDepth)) { pricingDetail.setPrice(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return pricingDetail; } } } }
public StepAdjustment unmarshall(StaxUnmarshallerContext context) throws Exception { StepAdjustment stepAdjustment = new StepAdjustment(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (context.testExpression("MetricIntervalLowerBound", targetDepth)) { stepAdjustment.setMetricIntervalLowerBound(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("MetricIntervalUpperBound", targetDepth)) { stepAdjustment.setMetricIntervalUpperBound(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("ScalingAdjustment", targetDepth)) { stepAdjustment.setScalingAdjustment(IntegerStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
public RecurringCharge unmarshall(StaxUnmarshallerContext context) throws Exception { RecurringCharge recurringCharge = new RecurringCharge(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 3; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return recurringCharge; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("RecurringChargeAmount", targetDepth)) { recurringCharge.setRecurringChargeAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RecurringChargeFrequency", targetDepth)) { recurringCharge.setRecurringChargeFrequency(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return recurringCharge; } } } }
public PriceSchedule unmarshall(StaxUnmarshallerContext context) throws Exception { PriceSchedule priceSchedule = new PriceSchedule(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return priceSchedule; if (context.testExpression("price", targetDepth)) { priceSchedule.setPrice(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; if (context.testExpression("currencyCode", targetDepth)) { priceSchedule.setCurrencyCode(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; if (context.testExpression("active", targetDepth)) { priceSchedule.setActive(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue;
public RecurringCharge unmarshall(StaxUnmarshallerContext context) throws Exception { RecurringCharge recurringCharge = new RecurringCharge(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 3; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return recurringCharge; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("RecurringChargeAmount", targetDepth)) { recurringCharge.setRecurringChargeAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RecurringChargeFrequency", targetDepth)) { recurringCharge.setRecurringChargeFrequency(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return recurringCharge; } } } }
public GetSendQuotaResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetSendQuotaResult getSendQuotaResult = new GetSendQuotaResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (context.testExpression("Max24HourSend", targetDepth)) { getSendQuotaResult.setMax24HourSend(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("MaxSendRate", targetDepth)) { getSendQuotaResult.setMaxSendRate(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("SentLast24Hours", targetDepth)) { getSendQuotaResult.setSentLast24Hours(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
public RecurringCharge unmarshall(StaxUnmarshallerContext context) throws Exception { RecurringCharge recurringCharge = new RecurringCharge(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return recurringCharge; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("amount", targetDepth)) { recurringCharge.setAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("frequency", targetDepth)) { recurringCharge.setFrequency(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return recurringCharge; } } } }
public StatisticSet unmarshall(StaxUnmarshallerContext context) throws Exception { StatisticSet statisticSet = new StatisticSet(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; if (context.testExpression("SampleCount", targetDepth)) { statisticSet.setSampleCount(DoubleStaxUnmarshaller.getInstance().unmarshall( context)); continue; if (context.testExpression("Sum", targetDepth)) { statisticSet.setSum(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; if (context.testExpression("Minimum", targetDepth)) { statisticSet.setMinimum(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("Maximum", targetDepth)) { statisticSet.setMaximum(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
public ReservedInstanceLimitPrice unmarshall(StaxUnmarshallerContext context) throws Exception { ReservedInstanceLimitPrice reservedInstanceLimitPrice = new ReservedInstanceLimitPrice(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return reservedInstanceLimitPrice; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("amount", targetDepth)) { reservedInstanceLimitPrice.setAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("currencyCode", targetDepth)) { reservedInstanceLimitPrice.setCurrencyCode(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return reservedInstanceLimitPrice; } } } }
public TargetTrackingConfiguration unmarshall(StaxUnmarshallerContext context) throws Exception { TargetTrackingConfiguration targetTrackingConfiguration = new TargetTrackingConfiguration(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (context.testExpression("TargetValue", targetDepth)) { targetTrackingConfiguration.setTargetValue(DoubleStaxUnmarshaller.getInstance() .unmarshall(context)); continue; if (context.testExpression("DisableScaleIn", targetDepth)) { targetTrackingConfiguration.setDisableScaleIn(BooleanStaxUnmarshaller .getInstance().unmarshall(context)); continue;
public RecurringCharge unmarshall(StaxUnmarshallerContext context) throws Exception { RecurringCharge recurringCharge = new RecurringCharge(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 3; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return recurringCharge; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("RecurringChargeAmount", targetDepth)) { recurringCharge.setRecurringChargeAmount(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RecurringChargeFrequency", targetDepth)) { recurringCharge.setRecurringChargeFrequency(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return recurringCharge; } } } }
public MetricDatum unmarshall(StaxUnmarshallerContext context) throws Exception { MetricDatum metricDatum = new MetricDatum(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (context.testExpression("MetricName", targetDepth)) { metricDatum.setMetricName(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; if (context.testExpression("Value", targetDepth)) { metricDatum.setValue(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; if (context.testExpression("Unit", targetDepth)) { metricDatum.setUnit(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public Entry<String, Double> unmarshall(StaxUnmarshallerContext context) throws Exception { int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; MapEntry<String, Double> entry = new MapEntry<String, Double>(); while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return entry; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("key", targetDepth)) { entry.setKey(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("value", targetDepth)) { entry.setValue(DoubleStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) return entry; } } }