private static void exportGetFieldValue(Collection<Field> fieldSet, Writer out, int ind) throws IOException {
        out.write(ind(ind)+"@Override public com.yahoo.document.datatypes.FieldValue getFieldValue(com.yahoo.document.Field field) {\n");
        out.write(ind(ind+1)+"if (field==null) return null;\n");
        out.write(ind(ind+1)+"if (field.getDataType() instanceof com.yahoo.document.StructDataType) {\n");
        for (Field field: fieldSet) {
            String name = field.getName();
            if (field.getDataType() instanceof StructDataType) {
                out.write(ind(ind+2)+"if (\""+name+"\".equals(field.getName())) return "+name+";\n");
            }
        }
        out.write(ind(ind+1)+"}\n");

        out.write(ind(ind+1)+"com.yahoo.document.ExtendedField ef = ensureExtended(field);\n");
        out.write(ind(ind+1)+"return (ef != null) ? ef.getFieldValue(this) : super.getFieldValue(field);\n");
        out.write(ind(ind)+"}\n\n");
    }
Exports the necessary overridden methods from Document/StructuredFieldValue
vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java