private String exportImportProvidedAnnotationRefs(AnnotationType annType) {
        if (annType.getDataType()==null) return "";
        StringBuilder ret = new StringBuilder();
        for (Field f : ((StructDataType)annType.getDataType()).getFields()) {
            if (f.getDataType() instanceof AnnotationReferenceDataType) {
                AnnotationReferenceDataType refType = (AnnotationReferenceDataType) f.getDataType();
                AnnotationType referenced = refType.getAnnotationType();
                String providedClass = provided(referenced.getName());
                if (providedClass!=null) {
                    // Annotationreference is to a type that is user-provided
                    ret.append("import ").append(providedClass).append(";\n");
                }
            }
        }
        return ret.toString();
    }
Handle the case of an annotation reference with a type that is user provided, we need to know the class name then
vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java