private void serialize(Serializer serializer, Collection<EntityType> models) {
        for (EntityType model : models) {
            try {
                String className = getClassName(model);

                // skip if type is excluded class or in excluded package
                if (conf.isExcludedPackage(model.getPackageName()) || conf.isExcludedClass(model.getFullName())) {
                    continue;
                }

                Set<TypeElement> elements = context.typeElements.get(model.getFullName());

                if (elements == null) {
                    elements = new HashSet<TypeElement>();
                }
                for (Property property : model.getProperties()) {
                    if (property.getType().getCategory() == TypeCategory.CUSTOM) {
                        Set<TypeElement> customElements = context.typeElements.get(property.getType().getFullName());
                        if (customElements != null) {
                            elements.addAll(customElements);
                        }
                    }
                }

                logInfo("Generating " + className + " for " + elements);
                try (Writer writer = conf.getFiler().createFile(processingEnv, className, elements)) {
                    SerializerConfig serializerConfig = conf.getSerializerConfig(model);
                    serializer.serialize(model, serializerConfig, new JavaWriter(writer));
                }

            } catch (IOException e) {
                System.err.println(e.getMessage());
                processingEnv.getMessager().printMessage(Kind.ERROR, e.getMessage());
            }
        }
    }
{@code AbstractQuerydslProcessor} is the base class for Querydsl annotation processors and
contains the main processing logic. The subclasses just provide the configuration.

@author tiwe
querydsl-apt/src/main/java/com/querydsl/apt/AbstractQuerydslProcessor.java