Package org.hibernate.validator

Examples of org.hibernate.validator.MethodValidator.validateParameters()


  public Object validateMethodInvocation(ProceedingJoinPoint pjp) throws Throwable {
    Object result;
    MethodSignature signature = (MethodSignature) pjp.getSignature();
    MethodValidator methodValidator = validator.unwrap( MethodValidator.class );

    Set<MethodConstraintViolation<Object>> parametersViolations = methodValidator.validateParameters(
        pjp.getTarget(), signature.getMethod(), pjp.getArgs()
    );
    if ( !parametersViolations.isEmpty() ) {
      throw new MethodConstraintViolationException( parametersViolations );
    }
View Full Code Here


  public Object invoke(MethodInvocation invocation) throws Throwable {

    MethodValidator validator = validatorFactory.getValidator().unwrap(
      MethodValidator.class);

    Set<MethodConstraintViolation<Object>> violations = validator
      .validateParameters(
        invocation.getThis(), invocation.getMethod(),
        invocation.getArguments());

    if (!violations.isEmpty()) {
View Full Code Here

  public Object validateMethodInvocation(InvocationContext ctx) throws Exception {

    MethodValidator validator = validatorFactory.getValidator().unwrap(
      MethodValidator.class);

    Set<MethodConstraintViolation<Object>> violations = validator
      .validateParameters(
        ctx.getTarget(), ctx.getMethod(), ctx.getParameters());

    if (!violations.isEmpty()) {
      throw new MethodConstraintViolationException(violations);
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.