001    package org.junit.runner;
002    
003    import org.junit.runner.manipulation.Filter;
004    
005    /**
006     * Extend this class to create a factory that creates {@link Filter}.
007     */
008    public interface FilterFactory {
009        /**
010         * Creates a {@link Filter} given a {@link FilterFactoryParams} argument.
011         *
012         * @param params Parameters needed to create the {@link Filter}
013         */
014        Filter createFilter(FilterFactoryParams params) throws FilterNotCreatedException;
015    
016        /**
017         * Exception thrown if the {@link Filter} cannot be created.
018         */
019        @SuppressWarnings("serial")
020        class FilterNotCreatedException extends Exception {
021            public FilterNotCreatedException(Exception exception) {
022                super(exception.getMessage(), exception);
023            }
024        }
025    }