@Override
          public ImmutableSet<FactoryMethodDescriptor> visitTypeAsClass(TypeElement type, Void p) {
            if (type.getModifiers().contains(ABSTRACT)) {
              // applied to an abstract factory
              messager.printMessage(
                  ERROR,
                  "Auto-factory doesn't support being applied to abstract classes.",
                  type,
                  mirror);
              return ImmutableSet.of();
            } else {
              // applied to the type to be created
              ImmutableSet<ExecutableElement> constructors = Elements2.getConstructors(type);
              if (constructors.isEmpty()) {
                return generateDescriptorForDefaultConstructor(declaration.get(), type);
              } else {
                return FluentIterable.from(constructors)
                    .transform(
                        new Function<ExecutableElement, FactoryMethodDescriptor>() {
                          @Override
                          public FactoryMethodDescriptor apply(ExecutableElement constructor) {
                            return generateDescriptorForConstructor(declaration.get(), constructor);
                          }
                        })
                    .toSet();
              }
            }
          }
A service that traverses an element and returns the set of factory methods defined therein.

@author Gregory Kick
factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptorGenerator.java