public ResourceTargetDefinition unmarshall(StaxUnmarshallerContext context) throws Exception { ResourceTargetDefinition resourceTargetDefinition = new ResourceTargetDefinition(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return resourceTargetDefinition; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Attribute", targetDepth)) { resourceTargetDefinition.setAttribute(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Name", targetDepth)) { resourceTargetDefinition.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RequiresRecreation", targetDepth)) { resourceTargetDefinition.setRequiresRecreation(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return resourceTargetDefinition; } } } }
public ResourceTargetDefinition unmarshall(StaxUnmarshallerContext context) throws Exception { ResourceTargetDefinition resourceTargetDefinition = new ResourceTargetDefinition(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return resourceTargetDefinition; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Attribute", targetDepth)) { resourceTargetDefinition.setAttribute(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Name", targetDepth)) { resourceTargetDefinition.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RequiresRecreation", targetDepth)) { resourceTargetDefinition.setRequiresRecreation(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return resourceTargetDefinition; } } } }