@Override
  public String toString() {
    int tabLevel = TransformationConstants.ELEMENT_LEVEL1_TAB_LEVEL;
    String node = super.toString();

    StringBuffer sb = TransformationUtils.displayNode(tabLevel, node);
    TransformationUtils.displayChildren(
        this.oldOptionFilterList, tabLevel, sb, "oldOptionFilterList");
    TransformationUtils.displayChildren(
        this.oldSpecificFilterContentList, tabLevel, sb, "oldSpecificFilterContentList");
    TransformationUtils.displayChildren(
        this.oldOptionValueList, tabLevel, sb, "oldOptionValueList");

    /*sb.append(MartConfigutarorUtils.getTabSpace(tabLevel) + "oldSpecificFilterContentList.size() = " + oldSpecificFilterContentList.size() + MyUtils.LINE_SEPARATOR);
    for (OldSpecificFilterContent oldSpecificFilterContent : this.oldSpecificFilterContentList) {
    	sb.append(MartConfigutarorUtils.getTabSpace(tabLevel+1) + "oldSpecificFilterContent = {" + oldSpecificFilterContent);
    	sb.append(MartConfigutarorUtils.getTabSpace(tabLevel+1) + "}" + MyUtils.LINE_SEPARATOR);
    }

    sb.append(MartConfigutarorUtils.getTabSpace(tabLevel) + "oldOptionValueList.size() = " + oldOptionValueList.size() + MyUtils.LINE_SEPARATOR);
    for (OldOptionValue oldOptionValue : this.oldOptionValueList) {
    	sb.append(MartConfigutarorUtils.getTabSpace(tabLevel+1) + "oldOptionValue = {" + oldOptionValue);
    	sb.append(MartConfigutarorUtils.getTabSpace(tabLevel+1) + "}" + MyUtils.LINE_SEPARATOR);
    }*/

    return sb.toString();
  }
  public OldFilterDescription(Element jdomElement) throws FunctionalException {
    super(jdomElement);

    this.oldOptionFilterList = new ArrayList<OldOptionFilter>();
    this.oldSpecificFilterContentList = new ArrayList<OldSpecificFilterContent>();
    this.oldEmptySpecificFilterContentList = new ArrayList<OldEmptySpecificElementContent>();
    this.oldOptionValueList = new ArrayList<OldOptionValue>();

    TransformationUtils.checkJdomElementProperties(
        jdomElement,
        OldElementPlaceHolder.propertyList,
        OldElement.propertyList,
        OldFilter.propertyList,
        OldFilterDescription.propertyList);
  }
Beispiel #3
0
  private OldElement(
      boolean isAttribute,
      Element jdomElement,
      String value,
      List<Element> childrenList,
      String internalName,
      String hidden,
      String hideDisplay,
      String description,
      String displayName,
      String tableConstraint,
      String key,
      String field,
      String pointerDataset,
      String pointerInterface,
      String pointerElement,
      String checkForNulls)
      throws FunctionalException {

    super(jdomElement, internalName);

    if (this.hidden) { // assigned in OldNode
      this.valid = false;
      return;
    }

    this.isAttribute = isAttribute;

    this.hideDisplay = TransformationUtils.getBooleanValueFromString(hideDisplay, "hideDisplay");
    this.description = description;
    this.displayName = displayName;
    this.tableConstraint = tableConstraint;
    this.key = key;
    this.field = field;
    this.pointerDataset = pointerDataset;
    this.pointerInterface = pointerInterface;
    this.pointerElement = pointerElement;
    this.checkForNulls =
        TransformationUtils.getBooleanValueFromString(checkForNulls, "checkForNulls");

    this.hasChildren = childrenList != null && childrenList.size() != 0;
    this.hasSubChildren = false;
    this.tree = false;
    if (this.hasChildren) {
      Element firstChild = childrenList.get(0);
      this.firstChildrenType = ElementChildrenType.getElementChildrenType(firstChild);

      // Will check for the 1st child that has subChildren (if any) and check the type of the
      // subchild
      for (Element child : childrenList) {
        List<Element> subChildrenList = child.getChildren();
        this.hasSubChildren = subChildrenList != null && subChildrenList.size() != 0;
        if (this.hasSubChildren) {
          ElementChildrenType subChildrenType =
              ElementChildrenType.getElementChildrenType(subChildrenList.get(0));
          this.tree =
              ElementChildrenType.OPTION_VALUE.equals(this.firstChildrenType)
                  && ElementChildrenType.OPTION_VALUE.equals(subChildrenType);
          break;
        }
      }
    }

    this.pointer =
        this.pointerElement != null && this.pointerInterface != null && this.pointerDataset != null;

    this.main =
        !this.pointer && tableConstraint != null && TransformationUtils.isMain(tableConstraint);
    this.dimension = !this.pointer && tableConstraint != null && !this.main;

    this.option = this instanceof OldOptionFilter;
    if (this.main || this.dimension) {
      this.nctm = new NamingConventionTableName(this.tableConstraint);
    } else {
      this.filterGroup = !pointer && !this.option;
      MyUtils.checkStatusProgram(
          !this.filterGroup || hasChildren, XmlUtils.displayJdomElement(jdomElement));
    }

    this.dimensionPartition = new DimensionPartition(this.tableConstraint, this.key);
    if (this.dimension) {
      this.dimensionPartition.searchForPotentialDimensionTablePartition();
    }

    if (!finalChecks()) {
      // System.out.println(this.internalName + "
      // ##########@@@@@@@@@@@@@######################*****************####################################");
      System.err.println(
          "######################### element has failed final checks" + this.internalName);
      this.valid = false;
    }
  }