private static void exportGetField(Writer out, int ind) throws IOException {
        out.write(ind(ind) + "private com.yahoo.document.ExtendedStringField ensureExtendedString(com.yahoo.document.Field f) {\n");
        out.write(ind(ind+1) + "return (com.yahoo.document.ExtendedStringField)((f instanceof com.yahoo.document.ExtendedStringField) ? f : getField(f.getName()));\n");
        out.write(ind(ind) + "}\n\n");
        out.write(ind(ind) + "private com.yahoo.document.ExtendedField ensureExtended(com.yahoo.document.Field f) {\n");
        out.write(ind(ind+1) + "return (com.yahoo.document.ExtendedField)((f instanceof com.yahoo.document.ExtendedField) ? f : getField(f.getName()));\n");
        out.write(ind(ind) + "}\n\n");
        out.write(ind(ind)   + "@Override public com.yahoo.document.Field getField(String fieldName) {\n");
        out.write(ind(ind+1) + "if (fieldName==null) return null;\n");
        out.write(ind(ind+1) + "return type.getField(fieldName);\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