Author: epbernard
Date: 2008-11-03 21:37:22 -0500 (Mon, 03 Nov 2008)
New Revision: 15493
Added:
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorFactoryConfiguration.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/HibernateValidationProvider.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryBuilderImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryImpl.java
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidationProvider.java
Log:
BVAL-63 Rename ValidatorBuilderImplementor to ValidatorFactoryConfiguration
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/HibernateValidationProvider.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/HibernateValidationProvider.java 2008-11-04
02:26:44 UTC (rev 15492)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/HibernateValidationProvider.java 2008-11-04
02:37:22 UTC (rev 15493)
@@ -21,7 +21,7 @@
import javax.validation.ValidatorFactoryBuilder;
import javax.validation.ValidatorFactory;
import javax.validation.spi.ValidationProvider;
-import javax.validation.spi.ValidatorBuilderImplementor;
+import javax.validation.spi.ValidatorFactoryConfiguration;
import javax.validation.spi.BootstrapState;
import org.hibernate.validation.HibernateValidatorFactoryBuilder;
@@ -59,7 +59,7 @@
/**
* {@inheritDoc}
*/
- public ValidatorFactory buildValidatorFactory(ValidatorBuilderImplementor
validatorBuilder) {
- return new ValidatorFactoryImpl( validatorBuilder );
+ public ValidatorFactory buildValidatorFactory(ValidatorFactoryConfiguration
configuration) {
+ return new ValidatorFactoryImpl( configuration );
}
}
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryBuilderImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryBuilderImpl.java 2008-11-04
02:26:44 UTC (rev 15492)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryBuilderImpl.java 2008-11-04
02:37:22 UTC (rev 15493)
@@ -27,7 +27,7 @@
import javax.validation.ValidatorFactory;
import javax.validation.bootstrap.DefaultValidationProviderResolver;
import javax.validation.spi.ValidationProvider;
-import javax.validation.spi.ValidatorBuilderImplementor;
+import javax.validation.spi.ValidatorFactoryConfiguration;
import javax.validation.spi.BootstrapState;
import org.hibernate.validation.HibernateValidatorFactoryBuilder;
@@ -35,7 +35,7 @@
/**
* @author Emmanuel Bernard
*/
-public class ValidatorFactoryBuilderImpl implements HibernateValidatorFactoryBuilder,
ValidatorBuilderImplementor {
+public class ValidatorFactoryBuilderImpl implements HibernateValidatorFactoryBuilder,
ValidatorFactoryConfiguration {
private MessageResolver messageResolver = new ResourceBundleMessageResolver();
private ConstraintFactory constraintFactory = new ConstraintFactoryImpl();
private String configurationFile = "META-INF/validation.xml";
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryImpl.java 2008-11-04
02:26:44 UTC (rev 15492)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ValidatorFactoryImpl.java 2008-11-04
02:37:22 UTC (rev 15493)
@@ -21,7 +21,7 @@
import javax.validation.MessageResolver;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
-import javax.validation.spi.ValidatorBuilderImplementor;
+import javax.validation.spi.ValidatorFactoryConfiguration;
import org.hibernate.validation.engine.ValidatorImpl;
@@ -35,9 +35,9 @@
private final ConstraintFactory constraintFactory;
- public ValidatorFactoryImpl(ValidatorBuilderImplementor validatorBuilder) {
- this.messageResolver = validatorBuilder.getMessageResolver();
- this.constraintFactory = validatorBuilder.getConstraintFactory();
+ public ValidatorFactoryImpl(ValidatorFactoryConfiguration configuration) {
+ this.messageResolver = configuration.getMessageResolver();
+ this.constraintFactory = configuration.getConstraintFactory();
//do init metadata from XML form
}
Modified:
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidationProvider.java
===================================================================
---
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidationProvider.java 2008-11-04
02:26:44 UTC (rev 15492)
+++
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidationProvider.java 2008-11-04
02:37:22 UTC (rev 15493)
@@ -68,7 +68,7 @@
/**
* Build a ValidatorFactory using the current provider implementation. The
ValidationFactory
- * is assembled and follow the configuration passed using ValidatorBuilderImplementor.
+ * is assembled and follow the configuration passed using
ValidatorFactoryConfiguration.
* <p>
* The returned ValidatorFactory is properly initialized and ready for use.
* </p>
@@ -77,5 +77,5 @@
*
* @return the instanciated ValidatorFactory
*/
- ValidatorFactory buildValidatorFactory(ValidatorBuilderImplementor configuration);
+ ValidatorFactory buildValidatorFactory(ValidatorFactoryConfiguration configuration);
}
\ No newline at end of file
Copied:
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorFactoryConfiguration.java
(from rev 15487,
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorBuilderImplementor.java)
===================================================================
---
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorFactoryConfiguration.java
(rev 0)
+++
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorFactoryConfiguration.java 2008-11-04
02:37:22 UTC (rev 15493)
@@ -0,0 +1,56 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.validation.spi;
+
+import java.io.InputStream;
+import javax.validation.ConstraintFactory;
+import javax.validation.MessageResolver;
+
+/**
+ * Contract between a <code>ValidatorFactoryBuilder</code> and a
</code>ValidatorProvider</code> to create
+ * a <code>ValidatorFactory</code>.
+ * The configuration artifacts provided to the <code>ValidationBuilder</code>
are passed along.
+ *
+ * @author Emmanuel Bernard
+ * @author Hardy Ferentschik
+ */
+public interface ValidatorFactoryConfiguration {
+ /**
+ * Message resolver as defined by the client programmatically
+ * or null if undefined.
+ *
+ * @return message provider instance or null if not defined
+ */
+ MessageResolver getMessageResolver();
+
+ /**
+ * Returns the configuration stream defined by the client programmatically
+ * or null if undefined.
+ *
+ * @return the configuration input stream or null
+ */
+ InputStream getConfigurationStream();
+
+ /**
+ * Defines the constraint implementation factory as defined by the client
programmatically
+ * or null if undefined
+ *
+ * @return factory instance or null if not defined
+ */
+ ConstraintFactory getConstraintFactory();
+}
Property changes on:
validator/trunk/validation-api/src/main/java/javax/validation/spi/ValidatorFactoryConfiguration.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id