Examples of ValidationException


Examples of org.opensaml.xml.validation.ValidationException

     * @param assertion
     * @throws ValidationException
     */
    protected void validateIssuer(Assertion assertion) throws ValidationException {
        if (DatatypeHelper.isEmpty(assertion.getIssuer())) {
             throw new ValidationException("Issuer not present");
         }
    }
View Full Code Here

Examples of org.pdfsam.console.exceptions.console.ValidationException

   *        number of total pages
   * @throws ValidationException
   */
  public static void assertValidBounds(Bounds bounds, int pdfNumberOfPages) throws ValidationException {
    if (bounds.getStart() <= 0) {
      throw new ValidationException(ValidationException.ERR_NOT_POSITIVE, new String[] { Integer.toString(bounds.getStart()), bounds.toString() });
    } else if (bounds.getEnd() > pdfNumberOfPages) {
      throw new ValidationException(ValidationException.ERR_CANNOT_MERGE, new String[] { Integer.toString(bounds.getEnd()) });
    } else if (bounds.getStart() > bounds.getEnd()) {
      throw new ValidationException(ValidationException.ERR_START_BIGGER_THAN_END, new String[] { Integer.toString(bounds.getStart()),
          Integer.toString(bounds.getEnd()), bounds.toString() });
    }
  }
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.ValidationException

    for (int i = 0; i < m_move.length; ++i) {
      MoveListEntry move = m_move[i];
      if (move != null) {
        ++moveCount;
        String name = move.getName();
        if (set.contains(name)) { throw new ValidationException(
        "This pokemon learns two of the same move."); }
        set.add(name);
        if (!canLearn(speciesData, name)) { throw new ValidationException(
            "This pokemon cannot learn " + name + "."); }
        if ((m_ppUp[i] > 3) || (m_ppUp[i] < 0)) { throw new ValidationException(
            "Each move must have between zero and "
            + "three PP ups applied to it."); }
      }
    }
    if (moveCount == 0) {
      // Pokemon must have at least one move.
      throw new ValidationException("This pokemon learns no moves.");
    } else if (moveCount > 4) { throw new ValidationException(
    "This pokemon learns move than four moves."); }

    int genders = getPossibleGenders();
    if (((genders & m_gender) == 0) && ((genders != 0) || (m_gender != 0))) { throw new ValidationException(
    "This pokemon has an invalid gender."); }

    if (!canUseAbility(speciesData, m_abilityName)) {
      String[] possibilities = getPossibleAbilities(speciesData);
      if ((possibilities != null)) {
        m_abilityName = possibilities[0];
      }
    }

    if ((m_itemName != null)
        && !data.getHoldItemData().canUseItem(getSpeciesName(), m_itemName)) { throw new ValidationException(
        "This pokemon's item is invalid."); }
  }
View Full Code Here

Examples of org.rest.common.exceptions.ValidationException

     * @param message
     *            the message to show if failed to created
     */
    public static void propagateStatusCodeOnException(final HttpStatusCodeException ex, final String message) {
        if (ex.getStatusCode().value() == 409) {
            throw new ValidationException(ex.getStatusText());
        }

        throw new IllegalStateException(message);
    }
View Full Code Here

Examples of org.rhq.enterprise.server.sync.ValidationException

    @Override
    public void validateExportedEntity(SystemSettings entity) throws ValidationException {
        try {
            systemManager.validateSystemConfiguration(subject, ((SystemSettings)entity).toProperties());
        } catch (Exception e) {
            throw new ValidationException("The system settings failed to validate: " + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.slim3.gen.processor.ValidationException

        if (attributeMetaDesc.isPersistent()) {
            DataType dataType = attributeMetaDesc.getDataType();
            if (dataType instanceof InverseModelRefType) {
                if (classDeclaration
                    .equals(fieldDeclaration.getDeclaringType())) {
                    throw new ValidationException(
                        MessageCode.SLIM3GEN1035,
                        env,
                        fieldDeclaration.getPosition());
                }
                throw new ValidationException(
                    MessageCode.SLIM3GEN1036,
                    env,
                    classDeclaration.getPosition(),
                    fieldDeclaration.getSimpleName(),
                    fieldDeclaration.getDeclaringType().getQualifiedName());
View Full Code Here

Examples of org.springframework.batch.item.validator.ValidationException

  public void validate(Entry value) throws ValidationException {
   
    Set<ConstraintViolation<Entry>> violations = new HashSet<ConstraintViolation<Entry>>();
    violations = validator.validate(value);
    if(!violations.isEmpty()) {
      throw new ValidationException("Validation failed for " + value + ": " +
          violationsToString(violations));
    }
  }
View Full Code Here

Examples of org.universa.tcc.gemda.service.ValidationException

    validarDatas(sprint);
  }
 
  private void validarDatas(Sprint sprint) throws ValidationException {
    if (sprint.getDataInicio().after(sprint.getDataFim())) {
      throw new ValidationException("{validation.sprint.datasInvalidas}");
    }
  }
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.validation.ValidationException

  public OddLengthValidator() { }
 
  public void validate(ValidationContext context, String name,
      ParamValue value) throws ValidationException {
    if (value.getScalarValue().length() % 2 == 0) {
      throw new ValidationException("The string length is not odd", name, value);
    }
  }
View Full Code Here

Examples of org.xrace.util.validation.ValidationException

    CartItemInscription cartItemInscription2 = new CartItemInscription(
        composantInscription2);

    cart.add(cartItemInscription2, getRabaisEvenementService());

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(0, vex.countErrors());
  }
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.