Package org.hibernate.validation

Source Code of org.hibernate.validation.HibernateValidationProvider

// $Id: HibernateValidationProvider.java 16837 2009-06-18 17:17:16Z hardy.ferentschik $
/*
* 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 org.hibernate.validation;

import javax.validation.Configuration;
import javax.validation.ValidatorFactory;
import javax.validation.spi.BootstrapState;
import javax.validation.spi.ConfigurationState;
import javax.validation.spi.ValidationProvider;

import org.hibernate.validation.engine.ConfigurationImpl;
import org.hibernate.validation.engine.HibernateValidatorConfiguration;
import org.hibernate.validation.engine.ValidatorFactoryImpl;

/**
* Default implementation of <code>ValidationProvider</code> within Hibernate validator.
*
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
public class HibernateValidationProvider implements ValidationProvider<HibernateValidatorConfiguration> {

  public HibernateValidatorConfiguration createSpecializedConfiguration(BootstrapState state) {
    return HibernateValidatorConfiguration.class.cast( new ConfigurationImpl( this ) );
  }

  public Configuration<?> createGenericConfiguration(BootstrapState state) {
    return new ConfigurationImpl( state );
  }

  public ValidatorFactory buildValidatorFactory(ConfigurationState configurationState) {
    return new ValidatorFactoryImpl( configurationState );
  }
}
TOP

Related Classes of org.hibernate.validation.HibernateValidationProvider

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.