001 /******************************************************************************* 002 * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian 003 * Thomschke. 004 * 005 * All Rights Reserved. This program and the accompanying materials 006 * are made available under the terms of the Eclipse Public License v1.0 007 * which accompanies this distribution, and is available at 008 * http://www.eclipse.org/legal/epl-v10.html 009 * 010 * Contributors: 011 * Sebastian Thomschke - initial implementation. 012 *******************************************************************************/ 013 package net.sf.oval.configuration; 014 015 import net.sf.oval.configuration.pojo.elements.ClassConfiguration; 016 import net.sf.oval.configuration.pojo.elements.ConstraintSetConfiguration; 017 import net.sf.oval.exception.InvalidConfigurationException; 018 019 /** 020 * @author Sebastian Thomschke 021 */ 022 public interface Configurer 023 { 024 /** 025 * Returns the constraint configurations for the given class. This method 026 * is invoked only once by the Validator, the very first time an object 027 * of the given class needs to be validated. The constraint configuration 028 * is then translated into an Validator internal format and cached. 029 * 030 * @param clazz the class to get the configuration for 031 * @return The constraint configurations for the given class. 032 * @throws InvalidConfigurationException in case of illegal configuration settings 033 */ 034 ClassConfiguration getClassConfiguration(Class< ? > clazz) throws InvalidConfigurationException; 035 036 /** 037 * Returns the constraint configuration for the constraint set with the 038 * given Id. 039 * @param constraintSetId the ID of the constraint set 040 * @return The constraint configuration for the constraint set with the given Id. 041 * @throws InvalidConfigurationException in case of illegal configuration settings 042 */ 043 ConstraintSetConfiguration getConstraintSetConfiguration(String constraintSetId) 044 throws InvalidConfigurationException; 045 }