Examples of ValidationException


Examples of org.kitesdk.data.ValidationException

  public static <T> T parse(String json, Class<T> returnType) {
    ObjectMapper mapper = new ObjectMapper();
    try {
      return mapper.readValue(json, returnType);
    } catch (JsonParseException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (JsonMappingException e) {
      throw new ValidationException("Invalid JSON", e);
    } catch (IOException e) {
      throw new DatasetIOException("Cannot initialize JSON parser", e);
    }
  }
View Full Code Here

Examples of org.libreplan.business.common.exceptions.ValidationException

    public ExpenseSheetLine getExpenseSheetLineByCode(String code)
            throws ValidationException {

        if (StringUtils.isBlank(code)) {
            throw new ValidationException(
                    "missing the code with which find the expense sheet line");
        }

        for (ExpenseSheetLine l : this.expenseSheetLines) {
            if (l.getCode().equalsIgnoreCase(StringUtils.trim(code))) {
View Full Code Here

Examples of org.mitre.openid.connect.exception.ValidationException

        // no secret yet, we need to generate a secret
        newClient = clientService.generateClientSecret(newClient);
      }
    } else if (newClient.getTokenEndpointAuthMethod() == AuthMethod.PRIVATE_KEY) {
      if (Strings.isNullOrEmpty(newClient.getJwksUri())) {
        throw new ValidationException("invalid_client_metadata", "JWK Set URI required when using private key authentication", HttpStatus.BAD_REQUEST);
      }
     
      newClient.setClientSecret(null);
    } else if (newClient.getTokenEndpointAuthMethod() == AuthMethod.NONE) {
      newClient.setClientSecret(null);
    } else {
      throw new ValidationException("invalid_client_metadata", "Unknown authentication method", HttpStatus.BAD_REQUEST);
    }
    return newClient;
  }
View Full Code Here

Examples of org.modelmapper.ValidationException

      throw new ConfigurationException(getMessages());
  }

  public void throwValidationExceptionIfErrorsExist() {
    if (hasErrors())
      throw new ValidationException(getMessages());
  }
View Full Code Here

Examples of org.mongodb.morphia.query.ValidationException

                    if (key == null) {
                        mappedValue = toMongoObject(value, false);
                    } else {
                        mappedValue = keyToRef(key);
                        if (mappedValue == value) {
                            throw new ValidationException("cannot map to @Reference/Key<T>/DBRef field: " + value);
                        }
                    }
                }
            } catch (Exception e) {
                LOG.error("Error converting value(" + value + ") to reference.", e);
View Full Code Here

Examples of org.mule.registry.ValidationException

  }

    public void validate() throws ValidationException {
        // Check version number
    if (this.configuration.getVersion().doubleValue() != 1.0) {
      throw new ValidationException("version attribute should be '1.0'");
    }
    }
View Full Code Here

Examples of org.newinstance.gucoach.exception.ValidationException

     * @throws ValidationException if the import data is not valid
     */
    private void validateImportData() throws ValidationException {
        // does the file contain player and player history records?
        if (importService.getPlayers().isEmpty() || importService.getHistory().isEmpty()) {
            throw new ValidationException(ResourceLoader.getMessage(MessageId.V003.getMessageKey()));
        }

        // was the data already imported?
        final List<Date> allImportDatesInDb = playerHistoryService.findAllImportDates();
        final Date importDateOfFile = importService.getImportDate();
        if (allImportDatesInDb.contains(importDateOfFile)) {
            final String message = ResourceLoader.getMessage(MessageId.V001.getMessageKey(), importFile.getName());
            throw new ValidationException(message);
        }

        // does every player have his own history data record?
        final List<Player> players = importService.getPlayers();
        for (final Player player : players) {
            if (!importService.getHistory().containsKey(player.getId())) {
                final String message = ResourceLoader.getMessage(MessageId.V002.getMessageKey(), player.getLastName());
                throw new ValidationException(message);
            }
        }
    }
View Full Code Here

Examples of org.nocturne.validation.ValidationException

    @Override
    public void run(String value) throws ValidationException {
        try {
            Pattern.compile(value);
        } catch (PatternSyntaxException e) {
            throw new ValidationException($("Illegal regex: {0}", e.getMessage()));
        }
    }
View Full Code Here

Examples of org.openbravo.base.validation.ValidationException

   *
   * @throws ValidationException
   */
  public void checkIsWritable() {
    if (isInactive()) {
      final ValidationException ve = new ValidationException();
      ve.addMessage(this, "Property " + this + " is inactive and can therefore not be changed.");
      throw ve;
    }
  }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.ValidationException

              "PatientIdentifier.error.notUniqueWithParameter", new Object[] { pi.getIdentifier() },
              Context.getLocale()));
        }
      }
      catch (Exception e) {
        throw new ValidationException(e.getMessage());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.