Package com.google.visualization.datasource.base

Examples of com.google.visualization.datasource.base.InvalidQueryException


      if (!groupColumns.contains(col)) {
        String messageToLogAndUser = "Column [" + col.getId()
            + "] should be added to GROUP BY, removed from SELECT, or "
            + "aggregated in SELECT.";
        log.error(messageToLogAndUser);
        throw new InvalidQueryException(messageToLogAndUser);
      }
    } else if (col instanceof ScalarFunctionColumn) {
      // A selected scalar function column is valid if it is grouped by, or if
      // its inner columns are all valid.
      if (!groupColumns.contains(col)) {
View Full Code Here


  public void addPattern(AbstractColumn column, String pattern) throws InvalidQueryException {
    if (columnPatterns.keySet().contains(column)) {
      String messageToLogAndUser = "Column [" + column.toString() + "] is "
          + "specified more than once in FORMAT.";
      log.error(messageToLogAndUser);
      throw new InvalidQueryException(messageToLogAndUser);
    }
    columnPatterns.put(column, pattern);
  }
View Full Code Here

   *
   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 1) {
      throw new InvalidQueryException("Number of parameters for "
          + timeComponent.getName() + "function is wrong: " + types.size());
    }
    switch (timeComponent) {
      case YEAR:
      case MONTH:
      case DAY:
      case QUARTER:
      case DAY_OF_WEEK:
        if ((types.get(0) != ValueType.DATE)
            && (types.get(0) != ValueType.DATETIME)) {
          throw new InvalidQueryException("Can't perform the function "
              + timeComponent.getName() + " on a column that is not a Date or"
              + " a DateTime column");
        }
        break;
      case HOUR:
      case MINUTE:
      case SECOND:
      case MILLISECOND:
        if ((types.get(0) != ValueType.TIMEOFDAY)
            && (types.get(0) != ValueType.DATETIME)) {
          throw new InvalidQueryException("Can't perform the function "
              + timeComponent.getName() + " on a column that is not a "
              + "TimeOfDay or a DateTime column");
        }
        break;
    }
View Full Code Here

  /**
    * {@inheritDoc}
    */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 1) {
      throw new InvalidQueryException(FUNCTION_NAME +
              " requires 1 parmaeter");
    }
    if (types.get(0) != ValueType.TEXT) {
      throw new InvalidQueryException(FUNCTION_NAME +
              " takes a text parameter");
    }
  }
View Full Code Here

   *
   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 2) {
      throw new InvalidQueryException("Number of parameters for the dateDiff "
          + "function is wrong: " + types.size());
    } else if ((!isDateOrDateTimeValue(types.get(0)))
        || (!isDateOrDateTimeValue(types.get(1)))) {
      throw new InvalidQueryException("Can't perform the function 'dateDiff' "
          + "on values that are not a Date or a DateTime values");
    }
  }
View Full Code Here

  /**
    * {@inheritDoc}
    */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 1) {
      throw new InvalidQueryException(FUNCTION_NAME +
              " requires 1 parmaeter");
    }
    if (types.get(0) != ValueType.TEXT) {
      throw new InvalidQueryException(FUNCTION_NAME +
              " takes a text parameter");
    }
  }
View Full Code Here

   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types)
      throws InvalidQueryException {
    if (types.size() != 0) {
      throw new InvalidQueryException("The " + FUNCTION_NAME + " function should not get "
          + "any parameters");
    }
  }
View Full Code Here

   *
   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 2) {
      throw new InvalidQueryException("The function " + FUNCTION_NAME
          + " requires 2 parmaeters ");
    }
    for (ValueType type : types) {
      if (type != ValueType.NUMBER) {
        throw new InvalidQueryException("Can't perform the function "
            + FUNCTION_NAME + " on values that are not numbers");
      }
    }
  }
View Full Code Here

   *
   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 1) {
      throw new InvalidQueryException("Number of parameters for the date "
          + "function is wrong: " + types.size());
    } else if ((types.get(0) != ValueType.DATETIME)
        && (types.get(0) != ValueType.DATE)
        && (types.get(0) != ValueType.NUMBER)) {
      throw new InvalidQueryException("Can't perform the function 'date' "
          + "on values that are not date, dateTime or number values");
    }
  }
View Full Code Here

   *
   * @throws InvalidQueryException Thrown if the parameters are invalid.
   */
  public void validateParameters(List<ValueType> types) throws InvalidQueryException {
    if (types.size() != 2) {
      throw new InvalidQueryException("The function " + FUNCTION_NAME
          + " requires 2 parmaeters ");
    }
    for (ValueType type : types) {
      if (type != ValueType.NUMBER) {
        throw new InvalidQueryException("Can't perform the function "
            + FUNCTION_NAME + " on values that are not numbers");
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.base.InvalidQueryException

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.