public class SimpleMetadataReaderFactory extends Object implements MetadataReaderFactory
MetadataReaderFactory
interface,
creating a new ASM ClassReader
for every request.Constructor and Description |
---|
SimpleMetadataReaderFactory()
Create a new SimpleMetadataReaderFactory for the default class loader.
|
SimpleMetadataReaderFactory(ClassLoader classLoader)
Create a new SimpleMetadataReaderFactory for the given class loader.
|
SimpleMetadataReaderFactory(ResourceLoader resourceLoader)
Create a new SimpleMetadataReaderFactory for the given resource loader.
|
Modifier and Type | Method and Description |
---|---|
MetadataReader |
getMetadataReader(Resource resource)
Obtain a MetadataReader for the given resource.
|
MetadataReader |
getMetadataReader(String className)
Obtain a MetadataReader for the given class name.
|
ResourceLoader |
getResourceLoader()
Return the ResourceLoader that this MetadataReaderFactory has been
constructed with.
|
public SimpleMetadataReaderFactory()
public SimpleMetadataReaderFactory(@Nullable ResourceLoader resourceLoader)
resourceLoader
- the Spring ResourceLoader to use
(also determines the ClassLoader to use)public SimpleMetadataReaderFactory(@Nullable ClassLoader classLoader)
classLoader
- the ClassLoader to usepublic final ResourceLoader getResourceLoader()
public MetadataReader getMetadataReader(String className) throws IOException
MetadataReaderFactory
getMetadataReader
in interface MetadataReaderFactory
className
- the class name (to be resolved to a ".class" file)null
)IOException
- in case of I/O failurepublic MetadataReader getMetadataReader(Resource resource) throws IOException
MetadataReaderFactory
getMetadataReader
in interface MetadataReaderFactory
resource
- the resource (pointing to a ".class" file)null
)IOException
- in case of I/O failure