Examples of ERXValidationFactory


Examples of er.extensions.validation.ERXValidationFactory

 
  public String validateWorkflowState(Object aValue) throws NSValidation.ValidationException {
    String strValue = ObjectUtils.toString(aValue, null);
   
    if(StringUtils.isEmpty(strValue)) {
      throw new ERXValidationFactory().createCustomException(this, KEY_WORKFLOW_STATE, strValue, ERXValidationException.NullPropertyException);
    }
   
    // Must be one of acceptable values
    if (!WORKFLOW_STATES.contains(strValue)) {
      throw new ERXValidationFactory().createCustomException(this, KEY_WORKFLOW_STATE, strValue, ERXValidationException.InvalidValueException);
    }
   
    return strValue;
  }
View Full Code Here

Examples of er.extensions.validation.ERXValidationFactory

                String message = sqlEx.getMessage();
                MessageFormat format = new MessageFormat(UNIQUE_CONSTRAINT_MESSAGE_FORMAT);
                try {
                  Object[] objs = format.parse(message);
                  String idx = (String) objs[0];
                  ERXValidationFactory factory = ERXValidationFactory.defaultFactory();
                  String method = "UniqueConstraintException." + idx;
                  ERXValidationException ex = factory.createCustomException(null, method);
                  databaseContext.rollbackChanges();
                  throw ex;
                } catch (ParseException e) {
                  log.warn("Error parsing unique constraint exception message: " + message);
                }
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.