protected void setResourcesInDescriptors(Collection<? extends PackageDescr> packageDescrs) {
   for (PackageDescr packageDescr : packageDescrs) {
     for (AbstractClassTypeDeclarationDescr typeDescr :
         packageDescr.getClassAndEnumDeclarationDescrs()) {
       if (typeDescr.getResource() == null) {
         typeDescr.setResource(kbuilder.getCurrentResource());
       }
     }
   }
 }
  public TypeDeclaration processTypeDeclaration(
      PackageRegistry pkgRegistry, AbstractClassTypeDeclarationDescr typeDescr) {

    TypeDeclaration type =
        kbuilder.getTypeBuilder().getExistingTypeDeclaration(typeDescr.getFullTypeName());
    if (type == null) {
      type = new TypeDeclaration(typeDescr.getTypeName());
      type.setResource(typeDescr.getResource());

      // if is not new, search the already existing declaration and
      // compare them o see if they are at least compatibles
      // check whether it is necessary to build the class or not
      type.setNovel(TypeDeclarationUtils.isNovelClass(typeDescr, pkgRegistry));
      type.setNature(
          type.isNovel() ? TypeDeclaration.Nature.DEFINITION : TypeDeclaration.Nature.DECLARATION);
    }

    processTypeAnnotations(typeDescr, type);
    return type;
  }