Examples of validateParameters()


Examples of javax.validation.executable.ExecutableValidator.validateParameters()

        .usingContext()
        .parameterNameProvider( new DummyParameterNameProvider() )
        .getValidator();
    ExecutableValidator executableValidator = validator.forExecutables();
    Method addOrderMethod = Customer.class.getMethod( "addOrder", Order.class );
    Set<ConstraintViolation<Customer>> constraintViolations = executableValidator.validateParameters(
        new Customer(),
        addOrderMethod,
        new Object[] { null }
    );
    assertNumberOfViolations( constraintViolations, 1 );
View Full Code Here

Examples of javax.validation.executable.ExecutableValidator.validateParameters()

  @Test
  public void testOptionalUnwrappedExecutableParameter() throws Exception {
    ExecutableValidator executableValidator = validator.forExecutables();
    Method method = Baz.class.getMethod( "setOptionalLong", Optional.class );
    Object[] values = { Optional.of( 2L ) };
    Set<ConstraintViolation<Baz>> constraintViolations = executableValidator.validateParameters(
        new Baz(),
        method,
        values
    );
    assertNumberOfViolations( constraintViolations, 1 );
View Full Code Here

Examples of javax.validation.executable.ExecutableValidator.validateParameters()

  @Test
  public void testOptionalUnwrappedCascadableExecutableParameter() throws Exception {
    ExecutableValidator executableValidator = validator.forExecutables();
    Method method = Fubar.class.getMethod( "setBar", Optional.class );
    Object[] values = { Optional.of( new Bar() ) };
    Set<ConstraintViolation<Fubar>> constraintViolations = executableValidator.validateParameters(
        new Fubar(),
        method,
        values
    );
    assertNumberOfViolations( constraintViolations, 1 );
View Full Code Here

Examples of javax.validation.executable.ExecutableValidator.validateParameters()

        .parameterNameProvider( new MyParameterNameProvider() )
        .buildValidatorFactory()
        .getValidator()
        .forExecutables();

    Set<ConstraintViolation<User>> constraintViolations = executableValidator.validateParameters(
        new User(),
        User.class.getMethod( "setAddresses", Map.class ),
        new java.lang.Object[] { new HashMap() }
    );
View Full Code Here

Examples of javax.validation.executable.ExecutableValidator.validateParameters()

    Object object = new ComputerGame( "Giovanni Brothers" );
    Method method = ComputerGame.class.getMethod( "pauseGame", int.class );
    Object[] parameterValues = new Object[] { -2 };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
        method,
        parameterValues
    );
View Full Code Here

Examples of org.apache.bval.jsr303.extensions.MethodValidator.validateParameters()

        Class<?> clazz = invocation.getMethod().getDeclaringClass();
        Method method = invocation.getMethod();
        Object[] arguments = invocation.getArguments();
        Class<?>[] groups = validate.groups();

        constraintViolations.addAll(methodValidator.validateParameters(clazz,
                method,
                arguments,
                groups));

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

Examples of org.apache.bval.jsr303.extensions.MethodValidator.validateParameters()

        Class<?> clazz = invocation.getMethod().getDeclaringClass();
        Method method = invocation.getMethod();
        Object[] arguments = invocation.getArguments();
        Class<?>[] groups = validate.groups();

        constraintViolations.addAll( methodValidator.validateParameters( clazz, method, arguments, groups ) );

        if ( !constraintViolations.isEmpty() )
        {
            throw getException( new ConstraintViolationException( format( "Validation error when calling method '%s' with arguments %s",
                                                                          method,
View Full Code Here

Examples of org.apache.bval.jsr303.extensions.MethodValidator.validateParameters()

        Class<?> clazz = invocation.getMethod().getDeclaringClass();
        Method method = invocation.getMethod();
        Object[] arguments = invocation.getArguments();
        Class<?>[] groups = validate.groups();

        constraintViolations.addAll(methodValidator.validateParameters(clazz,
                method,
                arguments,
                groups));

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

Examples of org.apache.bval.jsr303.extensions.MethodValidator.validateParameters()

        Class<?> clazz = invocation.getMethod().getDeclaringClass();
        Method method = invocation.getMethod();
        Object[] arguments = invocation.getArguments();
        Class<?>[] groups = validate.groups();

        constraintViolations.addAll(methodValidator.validateParameters(clazz,
                method,
                arguments,
                groups));

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

Examples of org.apache.cxf.validation.BeanValidationProvider.validateParameters()

       
        if (isValidateServiceObject()) {
            theProvider.validateBean(serviceObject);
        }
       
        theProvider.validateParameters(serviceObject, m, params.toArray());
       
        Object response = super.invoke(exchange, serviceObject, m, params);
       
        if (response instanceof MessageContentsList) {
            MessageContentsList list = (MessageContentsList)response;
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.