if (printWriter == null) {
return null;
}
ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName, validatorClassName);
//TODO add imports here
composerFactory.addImport(BeanValidator.class.getName());
composerFactory.addImport(AbstractBeanValidator.class.getName());
composerFactory.addImport(ViolationRegistry.class.getName());
composerFactory.addImport(ConstraintValidator.class.getName());
composerFactory.addImport(PropertyDescriptor.class.getName());
composerFactory.addImport(BeanInfo.class.getName());
composerFactory.addImport(BeanInfoRegistry.class.getName());
composerFactory.addImport(ViolationRegistry.class.getName());
composerFactory.addImport(Set.class.getName());
composerFactory.addImport(HashSet.class.getName());
composerFactory.addImport(Map.class.getName());
composerFactory.addImport(Map.class.getName() + ".Entry");
composerFactory.addImport(List.class.getName());
composerFactory.addImport(ArrayList.class.getName());
composerFactory.addImport(HashMap.class.getName());
composerFactory.addImport(Default.class.getName());
composerFactory.addImport(PathImpl.class.getName());
composerFactory.addImport(PathImpl.class.getName() + ".NodeImpl");
composerFactory.addImport(Collection.class.getName());
composerFactory.setSuperclass(AbstractBeanValidator.class.getName() + "<" + beanClassName + ">");
return composerFactory.createSourceWriter(context, printWriter);
}