private static StaxUnmarshallerContext payloadUnmarshaller(Message message) throws XMLStreamException { InputStream payloadStream = new ByteArrayInputStream(message.getPayload()); XMLEventReader xmlEventReader = XmlUtils.getXmlInputFactory().createXMLEventReader(payloadStream); return new StaxUnmarshallerContext(xmlEventReader); } }
StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(eventReader, response.getHeaders()); unmarshallerContext.registerMetadataExpression("ResponseMetadata/RequestId", 2, ResponseMetadata.AWS_REQUEST_ID); unmarshallerContext.registerMetadataExpression("requestId", 2, ResponseMetadata.AWS_REQUEST_ID);
@Override public BucketNotificationConfiguration unmarshall(InputStream inputStream) throws Exception { StaxUnmarshallerContext context = new StaxUnmarshallerContext(XmlUtils.getXmlInputFactory().createXMLEventReader(inputStream)); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1;
@Override public GetBucketEncryptionResult unmarshall(InputStream inputStream) throws Exception { StaxUnmarshallerContext context = new StaxUnmarshallerContext(XmlUtils.getXmlInputFactory().createXMLEventReader(inputStream)); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1;
@Override public GetBucketPolicyStatusResult unmarshall(InputStream inputStream) throws Exception { StaxUnmarshallerContext context = new StaxUnmarshallerContext(XmlUtils.getXmlInputFactory().createXMLEventReader(inputStream)); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) { targetDepth += 1; } GetBucketPolicyStatusResult result = new GetBucketPolicyStatusResult(); PolicyStatus policyStatus = new PolicyStatus(); result.setPolicyStatus(policyStatus); while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) { return result; } if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("IsPublic", targetDepth)) { policyStatus.setIsPublic(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return result; } } } }
@Override public GetPublicAccessBlockResult unmarshall(InputStream inputStream) throws Exception { StaxUnmarshallerContext context = new StaxUnmarshallerContext(XmlUtils.getXmlInputFactory().createXMLEventReader(inputStream)); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1;
private StaxUnmarshallerContext getContext(String xml, Map<String, String> headers) throws Exception { XmlPullParser xpp = factory.newPullParser(); Reader reader = new StringReader(xml); xpp.setInput(reader); return new StaxUnmarshallerContext(xpp, headers); }
private StaxUnmarshallerContext getContext(String elementData) throws XmlPullParserException, IOException { XmlPullParser xpp = xmlPullParserFactory.newPullParser(); String xml = "<tag>" + elementData + "</tag>"; StringReader sr = new StringReader(xml); xpp.setInput(sr); StaxUnmarshallerContext suc = new StaxUnmarshallerContext(xpp); suc.nextEvent(); return suc; } }
private StaxUnmarshallerContext getContext(String elementData) throws XmlPullParserException, IOException { XmlPullParser xpp = xmlPullParserFactory.newPullParser(); String xml = "<tag>" + elementData + "</tag>"; StringReader sr = new StringReader(xml); xpp.setInput(sr); StaxUnmarshallerContext suc = new StaxUnmarshallerContext(xpp); suc.nextEvent(); return suc; }
StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(eventReader, response.getHeaders()); unmarshallerContext.registerMetadataExpression("ResponseMetadata/RequestId", 2, ResponseMetadata.AWS_REQUEST_ID); unmarshallerContext.registerMetadataExpression("requestId", 2, ResponseMetadata.AWS_REQUEST_ID);
StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp, response.getHeaders()); unmarshallerContext.registerMetadataExpression("ResponseMetadata/RequestId", 2,
xpp.setInput(inputStream, null); final StaxUnmarshallerContext context = new StaxUnmarshallerContext(xpp, null);
XmlPullParser xpp = xmlPullParserFactory.newPullParser(); xpp.setInput(reader); StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp);
XmlPullParser xpp = xmlPullParserFactory.newPullParser(); xpp.setInput(reader); StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp);
XmlPullParser xpp = xmlPullParserFactory.newPullParser(); xpp.setInput(reader); StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp);
XmlPullParser xpp = xmlPullParserFactory.newPullParser(); xpp.setInput(reader); StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp);
StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp, response.getHeaders()); unmarshallerContext.registerMetadataExpression("ResponseMetadata/RequestId", 2,
StaxUnmarshallerContext unmarshallerContext = new StaxUnmarshallerContext(xpp, response.getHeaders()); unmarshallerContext.registerMetadataExpression("ResponseMetadata/RequestId", 2,
xpp.setInput(inputStream, null); final StaxUnmarshallerContext context = new StaxUnmarshallerContext(xpp, null);
StaxUnmarshallerContext context; synchronized (inputFactory) { context = new StaxUnmarshallerContext(inputFactory.createXMLEventReader(inputStream));