View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.configuration;
14  
15  import net.sf.oval.configuration.pojo.elements.ClassConfiguration;
16  import net.sf.oval.configuration.pojo.elements.ConstraintSetConfiguration;
17  import net.sf.oval.exception.InvalidConfigurationException;
18  
19  /**
20   * @author Sebastian Thomschke
21   */
22  public interface Configurer
23  {
24  	/**
25  	 * Returns the constraint configurations for the given class. This method
26  	 * is invoked only once by the Validator, the very first time an object
27  	 * of the given class needs to be validated. The constraint configuration
28  	 * is then translated into an Validator internal format and cached.
29  	 * 
30  	 * @param clazz the class to get the configuration for
31  	 * @return The constraint configurations for the given class.
32  	 * @throws InvalidConfigurationException in case of illegal configuration settings
33  	 */
34  	ClassConfiguration getClassConfiguration(Class< ? > clazz) throws InvalidConfigurationException;
35  
36  	/**
37  	 * Returns the constraint configuration for the constraint set with the 
38  	 * given Id.
39  	 * @param constraintSetId the ID of the constraint set 
40  	 * @return The constraint configuration for the constraint set with the given Id.
41  	 * @throws InvalidConfigurationException in case of illegal configuration settings
42  	 */
43  	ConstraintSetConfiguration getConstraintSetConfiguration(String constraintSetId)
44  			throws InvalidConfigurationException;
45  }