public RawMessage unmarshall(StaxUnmarshallerContext context) throws Exception { RawMessage rawMessage = new RawMessage(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return rawMessage; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Data", targetDepth)) { rawMessage.setData(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return rawMessage; } } } }
public GetMetricWidgetImageResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetMetricWidgetImageResult getMetricWidgetImageResult = new GetMetricWidgetImageResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getMetricWidgetImageResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("MetricWidgetImage", targetDepth)) { getMetricWidgetImageResult.setMetricWidgetImage(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getMetricWidgetImageResult; } } } }
public GetCredentialReportResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetCredentialReportResult getCredentialReportResult = new GetCredentialReportResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getCredentialReportResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Content", targetDepth)) { getCredentialReportResult.setContent(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReportFormat", targetDepth)) { getCredentialReportResult.setReportFormat(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("GeneratedTime", targetDepth)) { getCredentialReportResult.setGeneratedTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getCredentialReportResult; } } } }
.unmarshall(context)); continue; .getInstance().unmarshall(context)); continue;
virtualMFADevice.setBase32StringSeed(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; virtualMFADevice.setQRCodePNG(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue;
messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; messageAttributeValue.withBinaryListValues(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue;
.unmarshall(context)); continue;
public GetCredentialReportResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetCredentialReportResult getCredentialReportResult = new GetCredentialReportResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getCredentialReportResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Content", targetDepth)) { getCredentialReportResult.setContent(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ReportFormat", targetDepth)) { getCredentialReportResult.setReportFormat(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("GeneratedTime", targetDepth)) { getCredentialReportResult.setGeneratedTime(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getCredentialReportResult; } } } }
public RawMessage unmarshall(StaxUnmarshallerContext context) throws Exception { RawMessage rawMessage = new RawMessage(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return rawMessage; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Data", targetDepth)) { rawMessage.setData(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return rawMessage; } } } }
.unmarshall(context)); continue; .getInstance().unmarshall(context)); continue;
.unmarshall(context)); continue;
public RawMessage unmarshall(StaxUnmarshallerContext context) throws Exception { RawMessage rawMessage = new RawMessage(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("Data", targetDepth)) { rawMessage .setData(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return rawMessage; }
@Test public void testByteBufferStaxUnmarshaller() throws Exception { SimpleTypeStaxUnmarshallers.ByteBufferStaxUnmarshaller unmarshaller = SimpleTypeStaxUnmarshallers.ByteBufferStaxUnmarshaller .getInstance(); ByteBuffer unmarshalled = unmarshaller.unmarshall(getContext(Base64.encodeAsString("byte" .getBytes(StringUtils.UTF8)))); assertEquals(unmarshalled, ByteBuffer.wrap("byte".getBytes(StringUtils.UTF8))); }
virtualMFADevice.setBase32StringSeed(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; virtualMFADevice.setQRCodePNG(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue;
public MessageAttributeValue unmarshall(StaxUnmarshallerContext context) throws Exception { MessageAttributeValue messageAttributeValue = new MessageAttributeValue(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return messageAttributeValue; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("DataType", targetDepth)) { messageAttributeValue.setDataType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("StringValue", targetDepth)) { messageAttributeValue.setStringValue(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("BinaryValue", targetDepth)) { messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return messageAttributeValue; } } } }
messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; messageAttributeValue.withBinaryListValues(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue;