public InvalidationSummary unmarshall(StaxUnmarshallerContext context) throws Exception { InvalidationSummary invalidationSummary = new InvalidationSummary(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return invalidationSummary; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Id", targetDepth)) { invalidationSummary.setId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Status", targetDepth)) { invalidationSummary.setStatus(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return invalidationSummary; } } } }
public CloudFrontOriginAccessIdentity unmarshall(StaxUnmarshallerContext context) throws Exception { CloudFrontOriginAccessIdentity cloudFrontOriginAccessIdentity = new CloudFrontOriginAccessIdentity(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return cloudFrontOriginAccessIdentity; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Id", targetDepth)) { cloudFrontOriginAccessIdentity.setId( StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("S3CanonicalUserId", targetDepth)) { cloudFrontOriginAccessIdentity.setS3CanonicalUserId( StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("CloudFrontOriginAccessIdentityConfig", targetDepth)) { cloudFrontOriginAccessIdentity.setCloudFrontOriginAccessIdentityConfig( CloudFrontOriginAccessIdentityConfigStaxUnmarshaller.getInstance() .unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return cloudFrontOriginAccessIdentity; } } } }
public DistributionConfig unmarshall(StaxUnmarshallerContext context) throws Exception { DistributionConfig distributionConfig = new DistributionConfig(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return distributionConfig; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("S3Origin", targetDepth)) { distributionConfig.setS3Origin( S3OriginStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("CustomOrigin", targetDepth)) { distributionConfig.setCustomOrigin( CustomOriginStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("CallerReference", targetDepth)) { distributionConfig.setCallerReference( StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("CNAME", targetDepth)) { distributionConfig .getCNAME() .add(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Comment", targetDepth)) { distributionConfig.setComment(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Enabled", targetDepth)) { distributionConfig.setEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Logging", targetDepth)) { distributionConfig.setLogging( LoggingConfigStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("TrustedSigners", targetDepth)) { distributionConfig.setTrustedSigners( TrustedSignersStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RequiredProtocols", targetDepth)) { distributionConfig.setRequiredProtocols( RequiredProtocolsStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("DefaultRootObject", targetDepth)) { distributionConfig.setDefaultRootObject( StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("CachingBehavior", targetDepth)) { distributionConfig.setCachingBehavior( CachingBehaviorStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return distributionConfig; } } } }