private void gatherTypes(Set<? extends Element> types)
 {
  for (Element type : types)
  {
   if (!ElementKind.CLASS.equals(type.getKind()))
    continue;
   final PackageElement packageElement = packageOf(type);
   final String qName = ((TypeElement)type).getQualifiedName().toString();
   if (null == packageElement)
   {
    messager.printMessage(Diagnostic.Kind.WARNING, "Skipped class "
      + qName 
      + " that is not contained in a package.");
    continue;
   }
   final String packageName = packageElement.getQualifiedName().toString();
   PUData unit = packages.get(packageName);
   if (null == unit)
   {
    for (String sup = superPackage(packageName); null != sup; sup = superPackage(sup))
    {
     unit = packages.get(sup);
     if (null != unit && unit.isRecursive())
      break;
     unit = null;
    }
   }
   if (null == unit)
   {
    messager.printMessage(Diagnostic.Kind.NOTE, "Skipped class "
      + qName 
      + " outside of the configured persistence unit packages.");
    continue;
   }
   unit.addPersistentClass(qName);
  }
 }