public ReplaceableItem unmarshall(StaxUnmarshallerContext context) throws Exception { ReplaceableItem replaceableItem = new ReplaceableItem(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return replaceableItem; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("ItemName", targetDepth)) { replaceableItem.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Attribute", targetDepth)) { replaceableItem.withAttributes(ReplaceableAttributeStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return replaceableItem; } } } }
while (iter.hasNext()) { Item item = iter.next(); updateItems.add(new ReplaceableItem(item.getName(), attributes)); count++; if (count%25 == 0) {
throw new TranslatorException("ItemName() column value is not specified, it can not be null. Please provide a value."); insertItems.add(new ReplaceableItem(itemName, attributes)); count++; if (count%25 == 0) {
public ReplaceableItem unmarshall(StaxUnmarshallerContext context) throws Exception { ReplaceableItem replaceableItem = new ReplaceableItem(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return replaceableItem; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("ItemName", targetDepth)) { replaceableItem.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Attribute", targetDepth)) { replaceableItem.withAttributes(ReplaceableAttributeStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return replaceableItem; } } } }