Package org.springframework.binding.message

Examples of org.springframework.binding.message.MessageContextErrors


        } else {
          validateMethod = ReflectionUtils.findMethod(validator.getClass(), validateMethodName, new Class[] {
              model.getClass(), Errors.class });
          if (validateMethod != null) {
            ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model,
                new MessageContextErrors(requestContext.getMessageContext(), validatorName, validator, expressionParser, messageCodeResolver, mappingResults) });
          }
        }
      }
    }
  }
View Full Code Here


      return true;
    }
    // mvc 2 compatibility only
    validateMethod = ReflectionUtils.findMethod(model.getClass(), methodName, new Class[] { Errors.class });
    if (validateMethod != null) {
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, mappingResults);
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking current state model validation method '" + methodName + "(Errors)'");
      }
      ReflectionUtils.invokeMethod(validateMethod, model, new Object[] { errors });
View Full Code Here

    validateMethod = ReflectionUtils.findMethod(model.getClass(), "validate", new Class[] { Errors.class });
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default model validation method 'validate(Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, model, new Object[] { errors });
      return true;
    }
    return false;
View Full Code Here

      if (logger.isDebugEnabled()) {
        logger.debug("Invoking current state validator method '"
            + ClassUtils.getShortName(validator.getClass()) + "." + methodName + "("
            + ClassUtils.getShortName(model.getClass()) + ", Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model, errors });
      return true;
    }
    // web flow 2.0.0 to 2.0.3 compatibility only [to remove in web flow 3]
View Full Code Here

    if (validator instanceof Validator) {
      // supports existing validators
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking Spring Validator '" + ClassUtils.getShortName(validator.getClass()) + "'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, mappingResults);
      ((Validator) validator).validate(model, errors);
      return true;
    }
    // preferred
    Method validateMethod = ReflectionUtils.findMethod(validator.getClass(), "validate", new Class[] {
        model.getClass(), ValidationContext.class });
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default validator method '" + ClassUtils.getShortName(validator.getClass())
            + ".validate(" + ClassUtils.getShortName(model.getClass()) + ", ValidationContext)'");
      }
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model,
          new DefaultValidationContext(requestContext, eventId, mappingResults) });
      return true;
    }
    // mvc 2 compatibility only
    validateMethod = ReflectionUtils.findMethod(validator.getClass(), "validate", new Class[] { model.getClass(),
        Errors.class });
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default validator method '" + ClassUtils.getShortName(validator.getClass())
            + ".validate(" + ClassUtils.getShortName(model.getClass()) + ", Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model, errors });
      return true;
    }
    return false;
View Full Code Here

      return true;
    }
    // mvc 2 compatibility only
    validateMethod = ReflectionUtils.findMethod(model.getClass(), methodName, new Class[] { Errors.class });
    if (validateMethod != null) {
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, messageCodesResolver, mappingResults);
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking current state model validation method '" + methodName + "(Errors)'");
      }
      ReflectionUtils.invokeMethod(validateMethod, model, new Object[] { errors });
View Full Code Here

    validateMethod = ReflectionUtils.findMethod(model.getClass(), "validate", new Class[] { Errors.class });
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default model validation method 'validate(Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, messageCodesResolver, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, model, new Object[] { errors });
      return true;
    }
    return false;
View Full Code Here

      if (logger.isDebugEnabled()) {
        logger.debug("Invoking current state validator method '"
            + ClassUtils.getShortName(validator.getClass()) + "." + methodName + "("
            + ClassUtils.getShortName(model.getClass()) + ", Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, messageCodesResolver, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model, errors });
      return true;
    }
    // web flow 2.0.0 to 2.0.3 compatibility only [to remove in web flow 3]
View Full Code Here

      Validator springValidator = (Validator) validator;
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking Spring Validator '" + ClassUtils.getShortName(validator.getClass()) + "'");
      }
      if (springValidator.supports(model.getClass())) {
        MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
            model, expressionParser, messageCodesResolver, mappingResults);

        if (this.validationHints != null) {
          if (springValidator instanceof SmartValidator) {
            ((SmartValidator) springValidator).validate(model, errors, this.validationHints);
          }
          else {
            logger.warn("Validation hints provided but validator not an instance of SmartValidator: ["
                + springValidator.getClass().getName() + "]");
          }
        }
        else {
          springValidator.validate(model, errors);
        }
      } else {
        if (logger.isDebugEnabled()) {
          logger.debug("Spring Validator '" + ClassUtils.getShortName(validator.getClass())
              + "' doesn't support model class " + model.getClass());
        }
      }
      return true;
    }
    // preferred
    Method validateMethod = findValidationMethod(model, validator, "validate", ValidationContext.class);
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default validator method '" + ClassUtils.getShortName(validator.getClass())
            + ".validate(" + ClassUtils.getShortName(model.getClass()) + ", ValidationContext)'");
      }
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model,
          new DefaultValidationContext(requestContext, eventId, mappingResults) });
      return true;
    }
    // mvc 2 compatibility only
    validateMethod = findValidationMethod(model, validator, "validate", Errors.class);
    if (validateMethod != null) {
      if (logger.isDebugEnabled()) {
        logger.debug("Invoking default validator method '" + ClassUtils.getShortName(validator.getClass())
            + ".validate(" + ClassUtils.getShortName(model.getClass()) + ", Errors)'");
      }
      MessageContextErrors errors = new MessageContextErrors(requestContext.getMessageContext(), modelName,
          model, expressionParser, messageCodesResolver, mappingResults);
      ReflectionUtils.invokeMethod(validateMethod, validator, new Object[] { model, errors });
      return true;
    }
    return false;
View Full Code Here

TOP

Related Classes of org.springframework.binding.message.MessageContextErrors

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.