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        public static class FilterNotCreatedException extends Exception {
020            public FilterNotCreatedException(Exception exception) {
021                super(exception.getMessage(), exception);
022            }
023        }
024    }