marshallerDelegate.marshall(fieldName, fd, value, this, messageContext.out);
}
@Override
public <E> void writeCollection(String fieldName, Collection<? super E> collection, Class<E> elementClass) throws IOException {
FieldDescriptor fd = messageContext.marshallerDelegate.getFieldsByName().get(fieldName);
if (collection == null) {
// a repeated field is never flagged as required
return;
}
checkFieldWrite(fd, true);
if (fd.getType() == Type.GROUP) {
for (Object t : collection) {
writeGroup(fieldName, fd, t, elementClass);
}
} else if (fd.getType() == Type.MESSAGE) {
for (Object t : collection) {
writeMessage(fieldName, fd, t, elementClass);
}
} else if (fd.getType() == Type.ENUM) {
for (Object t : collection) {
writeEnum(fieldName, fd, (Enum) t);
}
} else {
writePrimitiveCollection(fd, collection, elementClass);