Package civquest.parser.ruleset.exception

Examples of civquest.parser.ruleset.exception.InvalidFieldValueException


    Field infoOnField = section.getField("infoOn");
    if (infoOnField == null) {
      throw new MissingFieldException(section, "infoOn",
                      "Happened in Messages.getInfoOn");
    } else if (!infoOnField.isBoolValue()) {
      throw new InvalidFieldValueException(infoOnField, "Bool",
                         "Happ1ened in Messages.getInfoOn");
    } else {
      return infoOnField.getBoolValue();
    }
  }
View Full Code Here


                      "Happened within Messages.setErrorDests");
    } else {
      errDests = new Destination[errorField.getNumberOfValues()];
      for (int n = 0; n < errorField.getNumberOfValues(); n++) {
        if (!errorField.isStringValue(n)) {
          throw new InvalidFieldValueException
            (errorField, n, "String", "Happened within Messages.setErrorDests");
        } else {
          if (!dests.containsKey(errorField.getStringValue(n))) {
            System.err.println("[Messages] ERROR! " + errorField.getStringValue(n)
                       + " is not a valid error-destination");
View Full Code Here

  public boolean getBoolValue(int index, String commentIfFail)
    throws RulesetException {

    if (!isStringValue(index)) {
      throw new InvalidFieldValueException(this, index, "Boolean", commentIfFail);
    } else {
      if (isBoolValue(index)) {
        String stringValue = getStringValue(index);
        return Boolean.valueOf(stringValue).booleanValue();
      } else {
        throw new InvalidFieldValueException(this, index, "Boolean", commentIfFail);
      }
    }
  }
View Full Code Here

    throws RulesetException {

    Object value = getValue(index);

    if (!(value instanceof String)) {
      throw new InvalidFieldValueException(this, index, "Integer", commentIfFail);
    } else {
      int retvalue = 0;
      try {
        retvalue = Integer.parseInt((String)(value));
      } catch(NumberFormatException e) {
        throw new InvalidFieldValueException(this, index, "Integer", commentIfFail);
      }

      return retvalue;
    }
    }
View Full Code Here

    throws RulesetException {

    Object value = getValue(index);

    if (!(value instanceof String)) {
      throw new InvalidFieldValueException(this, index, "Double", commentIfFail);
    } else {
      double retvalue = 0;
      try {
        retvalue = (Double.valueOf((String)(value))).doubleValue();
      } catch(NumberFormatException e) {
        throw new InvalidFieldValueException(this, index, "Double", commentIfFail);
      }

      return retvalue;     
    }
    }
View Full Code Here

  public String getStringValue(int index, String commentIfFail) throws RulesetException {
    Object value = getValue(index);
    if (value instanceof String) {
      return (String)(value);
    } else {
      throw new InvalidFieldValueException(this, index, "String", commentIfFail);
    }
  }
View Full Code Here

    return getTableValue(0);
  }

  public Table getTableValue(int index) throws RulesetException {
    if (!isTableValue(index)) {
      throw new InvalidFieldValueException(this, index, "Table", "");
    } else {
      return (Table)(getValue(index));
    }
  }
View Full Code Here

  }

  public java.util.List getListValue(int index, String commentIfFail)
    throws RulesetException {
    if (!isListValue(index)) {
      throw new InvalidFieldValueException(this, index, "List", commentIfFail);
    } else {
      return (java.util.List)(getValue(index));
    }
  }
View Full Code Here

TOP

Related Classes of civquest.parser.ruleset.exception.InvalidFieldValueException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.