Example #1
0
  // This function populates the ArchDescriptionAnalogInstances object
  private void setInstance(
      String containerType,
      String containerValue,
      ArchDescriptionAnalogInstances instance,
      int status) {
    if (status == 0 || (status == 2 && instance.getContainer1Type().length() == 0)) {
      EADHelper.setProperty(instance, "container1Type", (String) containerType);
      if (instance.getInstanceType() == null || instance.getInstanceType().length() == 0)
        instance.setInstanceType("Mixed Materials");

      if (containerValue instanceof java.lang.String) {
        try {
          instance.setContainer1NumericIndicator(Double.valueOf((String) containerValue));
        } catch (NumberFormatException ne) {
          instance.setContainer1NumericIndicator(null);
          instance.setContainer1AlphaNumericIndicator(containerValue);
        }
      }
    } else if (status > 0) {

      if (instance.getContainer2Type() != null && instance.getContainer2Type().length() == 0) {

        EADHelper.setProperty(instance, "container2Type", (String) containerType);

        if (containerValue instanceof java.lang.String) {
          try {
            instance.setContainer2NumericIndicator(Double.valueOf((String) containerValue));
          } catch (NumberFormatException ne) {
            instance.setContainer2NumericIndicator(null);
            instance.setContainer2AlphaNumericIndicator(containerValue);
          }
        }
      } else {
        EADHelper.setProperty(instance, "container3Type", (String) containerType);

        if (containerValue instanceof java.lang.String) {
          try {
            instance.setContainer3NumericIndicator(Double.valueOf((String) containerValue));
          } catch (NumberFormatException ne) {
            instance.setContainer3NumericIndicator(null);
            instance.setContainer3AlphaNumericIndicator(containerValue);
          }
        }
      }
    }
  }