public static AttributeValueTargetStaxUnmarshaller getInstance() { if (instance == null) instance = new AttributeValueTargetStaxUnmarshaller(); return instance; } }
public AccountAttribute unmarshall(StaxUnmarshallerContext context) throws Exception { AccountAttribute accountAttribute = new AccountAttribute(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return accountAttribute; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("AttributeName", targetDepth)) { accountAttribute.setAttributeName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("AttributeValues", targetDepth)) { accountAttribute.withAttributeValues(new ArrayList<AttributeValueTarget>()); continue; } if (context.testExpression("AttributeValues/AttributeValueTarget", targetDepth)) { accountAttribute.withAttributeValues(AttributeValueTargetStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return accountAttribute; } } } }
public AccountAttribute unmarshall(StaxUnmarshallerContext context) throws Exception { AccountAttribute accountAttribute = new AccountAttribute(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return accountAttribute; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("AttributeName", targetDepth)) { accountAttribute.setAttributeName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("AttributeValues", targetDepth)) { accountAttribute.withAttributeValues(new ArrayList<AttributeValueTarget>()); continue; } if (context.testExpression("AttributeValues/AttributeValueTarget", targetDepth)) { accountAttribute.withAttributeValues(AttributeValueTargetStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return accountAttribute; } } } }
public static AttributeValueTargetStaxUnmarshaller getInstance() { if (instance == null) instance = new AttributeValueTargetStaxUnmarshaller(); return instance; } }