001    /*****************************************************************************
002     * Copyright (C) PicoContainer Organization. All rights reserved.            *
003     * ------------------------------------------------------------------------- *
004     * The software in this package is published under the terms of the BSD      *
005     * style license a copy of which has been included with this distribution in *
006     * the LICENSE.txt file.                                                     *
007     *****************************************************************************/
008    
009    package org.picocontainer.gems.constraints;
010    
011    import org.picocontainer.ComponentAdapter;
012    import org.picocontainer.Parameter;
013    
014    /**
015     * Extension to {@link org.picocontainer.Parameter} that allows for
016     * constraint-based configuration of component parameters.
017     *
018     * @author Nick Sieger
019     * @version 1.0
020     */
021    public interface Constraint extends Parameter {
022        /**
023         * Evaluate whether the given component adapter matches this constraint.
024         *
025         * @param adapter a <code>ComponentAdapter</code> value
026         * @return true if the adapter matches the constraint
027         */
028        boolean evaluate(ComponentAdapter adapter);
029    }