/** * {@inheritDoc} */ @Override public void endGroup() { if (DEBUG) log("<!-- end group -->"); if (DEBUG) --indent; delegate.endGroup(); }
/** * {@inheritDoc} */ public void endGroup() { delegate.endGroup(); validateMissingFields(types.peek().asGroupType().getFieldCount()); types.pop(); previousField.pop(); }
final protected void endGroup(String field, int index) { if (endField != null) { // close the previous field recordConsumer.endField(endField, endIndex); endField = null; } if (DEBUG) LOG.debug("endGroup()"); recordConsumer.endGroup(); endField(field, index); }
private void writeGroup(Group group, GroupType type) { int fieldCount = type.getFieldCount(); for (int field = 0; field < fieldCount; ++field) { int valueCount = group.getFieldRepetitionCount(field); if (valueCount > 0) { Type fieldType = type.getType(field); String fieldName = fieldType.getName(); recordConsumer.startField(fieldName, field); for (int index = 0; index < valueCount; ++index) { if (fieldType.isPrimitive()) { group.writeValue(field, index, recordConsumer); } else { recordConsumer.startGroup(); writeGroup(group.getGroup(field, index), fieldType.asGroupType()); recordConsumer.endGroup(); } } recordConsumer.endField(fieldName, field); } } } }