Beispiel #1
0
  public Model buildAuto(String fileName, String fileType) {
    FileIO builder = new FileIO();
    _autoModel = new Model();
    if (fileType.indexOf("prop") > -1) {
      try {
        _autoModel = builder.buildAutoModelFromProperties(fileName, _autoModel);
      } catch (AutoException ae) {
        System.out.print(ae.getErrMessage());
      }
    } else {
      try {

        _autoModel = builder.buildAutoModelObject(fileName, _autoModel);
      } catch (AutoException ae) {
        System.out.print(ae.getErrMessage());
        try {
          _autoModel = builder.buildAutoModelObject(fileName, _autoModel);
        } catch (AutoException e) {
          System.out.print("Could not resolve error " + ae.getErrMessage());
        }
      }
    }
    if (_autoModel != null) {
      _autoModel.setDefaultOptionChoices();
      addAuto(_autoModel);
    }
    return _autoModel;
  }
Beispiel #2
0
  public boolean buildAuto(Properties autoProp) {
    FileIO builder = new FileIO();
    _autoModel = new Model();
    try {
      builder.parseProperties(autoProp, _autoModel);
    } catch (AutoException e) {
      System.err.println(e.getMessage());
      if (e.getErrCode() == 102065) // missing properties, don't continue with this file.
      _autoModel = null;
    }

    if (_autoModel != null) {
      _autoModel.setDefaultOptionChoices();
      addAuto(_autoModel);
      return this.isAutoHere(_autoModel.getModelName());
    } else return false;
  }