Class AbstractTypeHierarchyTraversingFilter
java.lang.Object
org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter
- All Implemented Interfaces:
TypeFilter
- Direct Known Subclasses:
AnnotationTypeFilter
,AssignableTypeFilter
Type filter that is aware of traversing over hierarchy.
This filter is useful when matching needs to be made based on potentially the whole class/interface hierarchy. The algorithm employed uses a succeed-fast strategy: if at any time a match is declared, no further processing is carried out.
- Since:
- 2.5
- Author:
- Ramnivas Laddad, Mark Fisher
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTypeHierarchyTraversingFilter
(boolean considerInherited, boolean considerInterfaces) -
Method Summary
Modifier and TypeMethodDescriptionboolean
match
(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) Determine whether this filter matches for the class described by the given metadata.protected boolean
matchClassName
(String className) Override this to match on type name.protected Boolean
matchInterface
(String interfaceName) Override this to match on interface type name.protected boolean
matchSelf
(MetadataReader metadataReader) Override this to match self characteristics alone.protected Boolean
matchSuperClass
(String superClassName) Override this to match on supertype name.
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractTypeHierarchyTraversingFilter
protected AbstractTypeHierarchyTraversingFilter(boolean considerInherited, boolean considerInterfaces)
-
-
Method Details
-
match
public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException Description copied from interface:TypeFilter
Determine whether this filter matches for the class described by the given metadata.- Specified by:
match
in interfaceTypeFilter
- Parameters:
metadataReader
- the metadata reader for the target classmetadataReaderFactory
- a factory for obtaining metadata readers for other classes (such as superclasses and interfaces)- Returns:
- whether this filter matches
- Throws:
IOException
- in case of I/O failure when reading metadata
-
matchSelf
Override this to match self characteristics alone. Typically, the implementation will use a visitor to extract information to perform matching. -
matchClassName
Override this to match on type name. -
matchSuperClass
Override this to match on supertype name. -
matchInterface
Override this to match on interface type name.
-