private void processElements(
      List<? extends SubEntityElement> subElements, SubclassEntityContainer container) {
    for (final SubEntityElement subElement : subElements) {
      final SubclassEntitySourceImpl subclassEntitySource =
          createSubClassEntitySource(subElement, (EntitySource) container);
      container.add(subclassEntitySource);
      final String subEntityName = subclassEntitySource.getEntityName();
      subEntityContainerMap.put(subEntityName, subclassEntitySource);

      // Re-run the sub element to handle, as an example, subclasses
      // within a subclass.
      processSubElements(subElement, subclassEntitySource);
    }
  }
 private void processSubclassElement(SubEntityElement element) {
   // we have to see if this things super-type has been found yet, and if not add it to the
   // extends queue
   final String entityItExtends =
       currentMappingDocument
           .getMappingLocalBindingContext()
           .qualifyClassName(element.getExtends());
   final SubclassEntityContainer container = subEntityContainerMap.get(entityItExtends);
   final SubclassEntitySourceImpl subClassEntitySource =
       createSubClassEntitySource(element, (EntitySource) container);
   final String entityName = subClassEntitySource.getEntityName();
   subEntityContainerMap.put(entityName, subClassEntitySource);
   processSubElements(element, subClassEntitySource);
   if (container != null) {
     // we already have this entity's super, attach it and continue
     container.add(subClassEntitySource);
   } else {
     // we do not yet have the super and have to wait, so add it fto the extends queue
     extendsQueue.add(new ExtendsQueueEntry(subClassEntitySource, entityItExtends));
   }
 }