Package javax.validation

Examples of javax.validation.Validator.unwrap()


                    },
                    new Class<?>[]{
                            Class.class, Method.class, Object[].class, Class[].class
                    });
        } else if (HIBERNATE_METHOD_CLASS != null && validator != null) {
            validatorObject = validator.unwrap(HIBERNATE_METHOD_CLASS);
            violations = call(Set.class, validatorObject, "validateAllParameters",
                    new Object[]{
                            ejbContext.getTarget(), ejbContext.getMethod(), ejbContext.getParameters(), new Class[0]
                    },
                    new Class<?>[]{
View Full Code Here


            }
         }
      }
      Validator validator = validatorFactory.getValidator();
      MethodValidator methodValidator = validator.unwrap(MethodValidator.class);
      return  new GeneralValidatorImpl(validator, methodValidator);
   }

   public GeneralValidatorCDI getContext(Class<?> type) {
      try
View Full Code Here

            method = bvalClazzToValidate.getMethod(method.getName(), method.getParameterTypes());
        }

        Set<?> violations = Collections.emptySet();
        if (APACHE_BVAL_METHOD_CLASS != null && validator != null) {
            validatorObject = validator.unwrap(APACHE_BVAL_METHOD_CLASS);
            violations = call(Set.class, validatorObject, "validateParameters",
                new Object[]{
                    bvalClazzToValidate, method, ejbContext.getParameters(), new Class[0]
                },
                new Class<?>[]{
View Full Code Here

                },
                new Class<?>[]{
                    Class.class, Method.class, Object[].class, Class[].class
                });
        } else if (HIBERNATE_METHOD_CLASS != null && validator != null) {
            validatorObject = validator.unwrap(HIBERNATE_METHOD_CLASS);
            violations = call(Set.class, validatorObject, "validateAllParameters",
                new Object[]{
                    ejbContext.getTarget(), ejbContext.getMethod(), ejbContext.getParameters(), new Class[0]
                },
                new Class<?>[]{
View Full Code Here

  }

  @Test(expectedExceptions = ValidationException.class)
  public void testUnwrapToImplementationCausesValidationException() {
    Validator validator = getValidator();
    validator.unwrap( ValidatorImpl.class );
  }

  @Test(expectedExceptions = ValidationException.class)
  public void testUnwrapToExecutableValidatorCausesValidationException() {
    Validator validator = getValidator();
View Full Code Here

  }

  @Test(expectedExceptions = ValidationException.class)
  public void testUnwrapToExecutableValidatorCausesValidationException() {
    Validator validator = getValidator();
    validator.unwrap( ExecutableValidator.class );
  }

  @Test
  public void testUnwrapToPublicTypesSucceeds() {
    Validator validator = getValidator();
View Full Code Here

        return new TestSuite(MethodValidatorImplTest.class);
    }

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
View Full Code Here

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
View Full Code Here

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
        assertTrue(mv == mv.unwrap(ClassValidator.class));
View Full Code Here

        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
        assertTrue(mv == mv.unwrap(ClassValidator.class));
    }
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.