public class Scanner<I> extends Object implements ResourceProvider, ClassProvider<I>
| 构造器和说明 |
|---|
Scanner(Class<I> implementedInterface,
Collection<Location> locations,
ClassLoader classLoader,
Charset encoding,
ResourceNameCache resourceNameCache,
LocationScannerCache locationScannerCache) |
| 限定符和类型 | 方法和说明 |
|---|---|
Collection<Class<? extends I>> |
getClasses()
Scans the classpath for concrete classes under the specified package implementing the specified interface.
|
LoadableResource |
getResource(String name)
Retrieves the resource with this name.
|
Collection<LoadableResource> |
getResources(String prefix,
String... suffixes)
Returns all known resources starting with the specified prefix and ending with any of the specified suffixes.
|
static void |
main(String[] args) |
public Scanner(Class<I> implementedInterface, Collection<Location> locations, ClassLoader classLoader, Charset encoding, ResourceNameCache resourceNameCache, LocationScannerCache locationScannerCache)
public LoadableResource getResource(String name)
ResourceProvidergetResource 在接口中 ResourceProvidername - The name of the resource.null if not found.public Collection<LoadableResource> getResources(String prefix, String... suffixes)
getResources 在接口中 ResourceProviderprefix - The prefix of the resource names to match.suffixes - The suffixes of the resource names to match.public Collection<Class<? extends I>> getClasses()
getClasses 在接口中 ClassProvider<I>public static void main(String[] args)
Copyright © 2022. All rights reserved.