<groupId>com.googlecode.jtype</groupId> <artifactId>jtype</artifactId> <version>0.1.1</version>
4748495051525354
} public void testParse() { ValidationParser vp = new ValidationParser("sample-validation.xml"); ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider()); vp.processValidationConfig(config); }
35363738394041
private final ValidatorFactory validatorFactory; @Inject public ValidatorFactoryProvider(ConfigurationState configurationState) { this.validatorFactory = new ApacheValidationProvider().buildValidatorFactory(configurationState); }
46474849505152
/** * {@inheritDoc} */ public ValidatorFactory get() { return new ApacheValidationProvider().buildValidatorFactory( configurationState ); }
4849505152535455
System.setProperty(ValidatorBuilder.VALIDATION_PROVIDER_KEY, CustomValidatorProvider.class.getName()); } @AfterClass public static void resetProvider() { CustomValidatorProvider.provider = new ApacheValidationProvider(); System.clearProperty(ValidatorBuilder.VALIDATION_PROVIDER_KEY); }
62636465666768697071
Validator validator = factory.getValidator(); assertNotNull(validator); } private ValidatorFactory getFactory() { ApacheValidatorConfiguration config = Validation.byProvider(ApacheValidationProvider.class).configure(); config.addProperty(VALIDATION_XML_PATH, "sample-validation.xml"); return config.buildValidatorFactory(); }
3536373839404142
private final ApacheValidatorFactory validatorFactory; @Inject public ValidatorFactoryProvider(ConfigurationState configurationState) { this.validatorFactory = new ApacheValidatorFactory(); this.validatorFactory.configure(configurationState); }
4849505152535455565758
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);
4445464748495051525354
464748495051525354
super(name); } public void testParse() { ValidationParser vp = new ValidationParser("sample-validation.xml"); ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider()); vp.processValidationConfig(config); }
38394041424344
private final ConfigurationImpl configurationState; @Inject public ConfigurationStateProvider(ValidationProvider<?> aProvider) { this.configurationState = new ConfigurationImpl(null, aProvider); }