public class DefaultResourceLoader extends java.lang.Object implements ResourceLoader
| 构造器和说明 |
|---|
DefaultResourceLoader()
Create a new DefaultResourceLoader.
|
DefaultResourceLoader(java.lang.ClassLoader classLoader)
Create a new DefaultResourceLoader.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.ClassLoader |
getClassLoader()
Return the ClassLoader to load class path resources with, or
null if using the thread context class loader on actual
access (applying to the thread that constructs the ClassPathResource
object). |
Resource |
getResource(java.lang.String location)
Return a Resource handle for the specified resource.
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
Specify the ClassLoader to load class path resources with, or
null for using the thread context class loader at the time
of actual resource access. |
public DefaultResourceLoader()
ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
public DefaultResourceLoader(java.lang.ClassLoader classLoader)
classLoader - the ClassLoader to load class path resources with, or
null for using the thread context class loader
at the time of actual resource accesspublic void setClassLoader(java.lang.ClassLoader classLoader)
null for using the thread context class loader at the time
of actual resource access.
The default is that ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
public java.lang.ClassLoader getClassLoader()
null if using the thread context class loader on actual
access (applying to the thread that constructs the ClassPathResource
object).
Will get passed to ClassPathResource's constructor for all ClassPathResource objects created by this resource loader.
getClassLoader 在接口中 ResourceLoaderpublic Resource getResource(java.lang.String location)
ResourceLoadergetResource 在接口中 ResourceLoaderlocation - the resource locationCopyright © 2024. All Rights Reserved.