001/*
002 * Copyright 2002-2016 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.core.type.filter;
018
019import java.io.IOException;
020
021import org.springframework.core.type.classreading.MetadataReader;
022import org.springframework.core.type.classreading.MetadataReaderFactory;
023
024/**
025 * Base interface for type filters using a
026 * {@link org.springframework.core.type.classreading.MetadataReader}.
027 *
028 * @author Costin Leau
029 * @author Juergen Hoeller
030 * @author Mark Fisher
031 * @since 2.5
032 */
033@FunctionalInterface
034public interface TypeFilter {
035
036        /**
037         * Determine whether this filter matches for the class described by
038         * the given metadata.
039         * @param metadataReader the metadata reader for the target class
040         * @param metadataReaderFactory a factory for obtaining metadata readers
041         * for other classes (such as superclasses and interfaces)
042         * @return whether this filter matches
043         * @throws IOException in case of I/O failure when reading metadata
044         */
045        boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory)
046                        throws IOException;
047
048}