Package org.hibernate.validator

Examples of org.hibernate.validator.MethodConstraintViolationException


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

    result =  pjp.proceed(); //Execute the method

    Set<MethodConstraintViolation<Object>> returnValueViolations = methodValidator.validateReturnValue(
        pjp.getTarget(), signature.getMethod(), result
    );
    if ( !returnValueViolations.isEmpty() ) {
      throw new MethodConstraintViolationException( returnValueViolations );
    }

    return result;
  }
View Full Code Here


    Set<MethodConstraintViolation<Object>> constraintViolations = validator
      .validateParameters(wrapped, method, args);

    if (!constraintViolations.isEmpty()) {
      throw new MethodConstraintViolationException(constraintViolations);
    }

    Object result = method.invoke(wrapped, args);

    constraintViolations = validator.validateReturnValue(wrapped, method,
      result);

    if (!constraintViolations.isEmpty()) {
      throw new MethodConstraintViolationException(constraintViolations);
    }

    return result;
  }
View Full Code Here

      .validateParameters(
        invocation.getThis(), invocation.getMethod(),
        invocation.getArguments());

    if (!violations.isEmpty()) {
      throw new MethodConstraintViolationException(violations);
    }

    Object result = invocation.proceed();

    violations = validator.validateReturnValue(
            invocation.getThis(),
            invocation.getMethod(),
            result);

    if (!violations.isEmpty()) {
      throw new MethodConstraintViolationException(violations);
    }

    return result;
  }
View Full Code Here

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

    if (!violations.isEmpty()) {
      throw new MethodConstraintViolationException(violations);
    }

    Object result = ctx.proceed();

    violations = validator.validateReturnValue(ctx.getTarget(), ctx.getMethod(), result);

    if (!violations.isEmpty()) {
      throw new MethodConstraintViolationException(violations);
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.MethodConstraintViolationException

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.