Beispiel #1
0
 /**
  * @param mainEntityList mainEntityList
  * @param node node
  * @return entity
  */
 private static EntityInterface getFinalMainEntity(
     List<EntityInterface> mainEntityList, OutputTreeDataNode node) {
   EntityInterface entity;
   entity = getMainEntityFromParentHierarchy(mainEntityList, node.getParent());
   if (entity == null && node.getChildren().size() != 0) {
     entity = getMainEntityFromChildHierarchy(mainEntityList, node);
   }
   return entity;
 }
Beispiel #2
0
  /**
   * Recursively checks in child hierarchy for main entity.
   *
   * @param mainEntityList mainEntityList
   * @param node node
   * @return main Entity if found in child Hierarchy
   */
  private static EntityInterface getMainEntityFromChildHierarchy(
      List<EntityInterface> mainEntityList, OutputTreeDataNode node) {
    EntityInterface entity = isMainEntity(mainEntityList, node);
    if (entity == null) {
      List<OutputTreeDataNode> children = node.getChildren();

      for (OutputTreeDataNode childNode : children) {
        entity = getMainEntityFromChildHierarchy(mainEntityList, childNode);
        if (entity != null) {
          break;
        }
      }
    }
    return entity;
  }