类 ResourceOverridingShadowingClassLoader
- java.lang.Object
- java.lang.ClassLoader
- org.springframework.core.DecoratingClassLoader
- org.springframework.instrument.classloading.ShadowingClassLoader
- org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader
public class ResourceOverridingShadowingClassLoader extends ShadowingClassLoader
Subclass of ShadowingClassLoader that overrides attempts to locate certain files.- 从以下版本开始:
- 2.0
- 作者:
- Rod Johnson, Adrian Colyer
字段概要
从类继承的字段 org.springframework.instrument.classloading.ShadowingClassLoader
DEFAULT_EXCLUDED_PACKAGES
构造器概要
构造器 构造器 说明 ResourceOverridingShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
copyOverrides(ResourceOverridingShadowingClassLoader other)
Copy all overrides from the given ClassLoader.URL
getResource(String requestedPath)
InputStream
getResourceAsStream(String requestedPath)
Enumeration<URL>
getResources(String requestedPath)
void
override(String oldPath, String newPath)
Return the resource (if any) at the new path on an attempt to locate a resource at the old path.void
suppress(String oldPath)
Ensure that a resource with the given path is not found.从类继承的方法 org.springframework.instrument.classloading.ShadowingClassLoader
addTransformer, copyTransformers, isEligibleForShadowing, loadClass
从类继承的方法 org.springframework.core.DecoratingClassLoader
excludeClass, excludePackage, isExcluded
从类继承的方法 java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
构造器详细资料
ResourceOverridingShadowingClassLoader
public ResourceOverridingShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.- 参数:
enclosingClassLoader
- the ClassLoader to decorate
方法详细资料
override
public void override(String oldPath, String newPath)
Return the resource (if any) at the new path on an attempt to locate a resource at the old path.- 参数:
oldPath
- the path requestednewPath
- the actual path to be looked up
suppress
public void suppress(String oldPath)
Ensure that a resource with the given path is not found.- 参数:
oldPath
- the path of the resource to hide even if it exists in the parent ClassLoader
copyOverrides
public void copyOverrides(ResourceOverridingShadowingClassLoader other)
Copy all overrides from the given ClassLoader.- 参数:
other
- the other ClassLoader to copy from
getResource
public URL getResource(String requestedPath)
- 覆盖:
getResource
在类中ShadowingClassLoader
getResourceAsStream
@Nullable public InputStream getResourceAsStream(String requestedPath)
getResources
public Enumeration<URL> getResources(String requestedPath) throws IOException
- 覆盖:
getResources
在类中ShadowingClassLoader
- 抛出:
IOException