Package org.hibernate.validator

Examples of org.hibernate.validator.InvalidStateException


      for ( InvalidValue invalidValue : invalidValues ) {
        consolidatedInvalidValues.add( invalidValue );
      }
    }
    if ( consolidatedInvalidValues.size() > 0 ) {
      throw new InvalidStateException(
          consolidatedInvalidValues.toArray( new InvalidValue[consolidatedInvalidValues.size()] ),
          entity.getClass().getName()
      );
    }
  }
View Full Code Here


      for ( InvalidValue invalidValue : invalidValues ) {
        consolidatedInvalidValues.add( invalidValue );
      }
    }
    if ( consolidatedInvalidValues.size() > 0 ) {
      throw new InvalidStateException(
          consolidatedInvalidValues.toArray( new InvalidValue[consolidatedInvalidValues.size()] ),
          entity.getClass().getName()
      );
    }
  }
View Full Code Here

        "third invalid value", myBean));
    invalidExceptions.add(new InvalidValue("fourth invalid message", MyBean.class, "fourthProperty",
        "fourth invalid value", myBean));
    invalidExceptions.add(new InvalidValue("fifth invalid message", MyBean.class, "fifthProperty",
        "fifth invalid value", myBean));
    throw new InvalidStateException(invalidExceptions.toArray(new InvalidValue[] {}));
  }
View Full Code Here

                    = "Could not handle exception: throwable is not an InvalidStateException:\n"
                    + throwable.getClass().getName();
            logger.error(ILLEGAL_THROWABLE_ARGUMENT);
            return ILLEGAL_THROWABLE_ARGUMENT;
        }
        InvalidStateException invalidStateException = (InvalidStateException) throwable;
        String explanation = messageSourceAccessor.getMessage(EXPLANATION_KEY, EXPLANATION_KEY);
        JPanel panel = new JPanel(new BorderLayout());
        JLabel explanationLabel = new JLabel(explanation);
        panel.add(explanationLabel, BorderLayout.NORTH);
        List<String> invalidValueMessageList = new ArrayList<String>();
        for (InvalidValue invalidValue : invalidStateException.getInvalidValues()) {
            StringBuffer messageBuffer = new StringBuffer();
            String propertyName = invalidValue.getPropertyName();
            messageBuffer.append(messageSourceAccessor.getMessage(propertyName + ".label", propertyName));
            messageBuffer.append(" ");
            messageBuffer.append(invalidValue.getMessage());
View Full Code Here

      for ( InvalidValue invalidValue : invalidValues ) {
        consolidatedInvalidValues.add( invalidValue );
      }
    }
    if ( consolidatedInvalidValues.size() > 0 ) {
      throw new InvalidStateException(
          consolidatedInvalidValues.toArray( new InvalidValue[consolidatedInvalidValues.size()] ),
          entity.getClass().getName()
      );
    }
  }
View Full Code Here

    calculateBalance();
  }
 
  public void setBalance(Money balance) {
    if (!balance.getCurrency().equals(getCurrency())) {
      throw new InvalidStateException(new InvalidValue[] {
          new InvalidValue("currency for new balance ("+balance.getCurrency()+") does not match account currency ("+getCurrency()+")", getClass(), "balance", balance, this)
      });
    }
   
    setBalance(balance.getValue());
View Full Code Here

      // nothing to do
      return;
    }
   
    if (getAccountType().hasUploads()) {
      throw new InvalidStateException(new InvalidValue[] {
          new InvalidValue("cannot disable balances on accounts with uploads", getClass(), "accountTypeId", AccountType.CASH, this)
      });
    }
   
    setAccountType(AccountType.CASH);
View Full Code Here

      for ( InvalidValue invalidValue : invalidValues ) {
        consolidatedInvalidValues.add( invalidValue );
      }
    }
    if ( consolidatedInvalidValues.size() > 0 ) {
      throw new InvalidStateException(
          consolidatedInvalidValues.toArray( new InvalidValue[consolidatedInvalidValues.size()] ),
          entity.getClass().getName()
      );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.InvalidStateException

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.