@Override
    public void onSerialize(Serializer target) {
        if (target instanceof DocumentWriter) {
            ((DocumentWriter) target).write(this);
        }
        // TODO: what if it's not a DocumentWriter?
    }
Returns an iterator over all fields in this documenttype

@return An iterator for iterating the fields in this documenttype.
document/src/main/java/com/yahoo/document/DocumentType.java