001/* 002 * Copyright 2002-2007 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 */ 033public interface TypeFilter { 034 035 /** 036 * Determine whether this filter matches for the class described by 037 * the given metadata. 038 * @param metadataReader the metadata reader for the target class 039 * @param metadataReaderFactory a factory for obtaining metadata readers 040 * for other classes (such as superclasses and interfaces) 041 * @return whether this filter matches 042 * @throws IOException in case of I/O failure when reading metadata 043 */ 044 boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) 045 throws IOException; 046 047}