org.springframework.instrument.classloading

## 类 ShadowingClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - org.springframework.core.DecoratingClassLoader
    - - org.springframework.instrument.classloading.ShadowingClassLoader

- 直接已知子类:
    ResourceOverridingShadowingClassLoader

      public class ShadowingClassLoader
      extends org.springframework.core.DecoratingClassLoader

  ClassLoader decorator that shadows an enclosing ClassLoader, applying registered transformers to all affected classes.
  从以下版本开始:
    2.0
  作者:
    Rob Harrop, Juergen Hoeller, Costin Leau
  另请参阅:
    `addTransformer(java.lang.instrument.ClassFileTransformer)`, `OverridingClassLoader`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String[]` | `DEFAULT_EXCLUDED_PACKAGES` Packages that are excluded by default

  - ### 构造器概要

    构造器
    构造器和说明
    `ShadowingClassLoader(ClassLoader enclosingClassLoader)` Create a new ShadowingClassLoader, decorating the given ClassLoader, applying `DEFAULT_EXCLUDED_PACKAGES`.
    `ShadowingClassLoader(ClassLoader enclosingClassLoader, boolean defaultExcludes)` Create a new ShadowingClassLoader, decorating the given ClassLoader.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addTransformer(ClassFileTransformer transformer)` Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
    `void` | `copyTransformers(ShadowingClassLoader other)` Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
    `URL` | `getResource(String name)`
    `InputStream` | `getResourceAsStream(String name)`
    `Enumeration<URL>` | `getResources(String name)`
    `protected boolean` | `isEligibleForShadowing(String className)` Determine whether the specified class is eligible for shadowing by this class loader.
    `Class<?>` | `loadClass(String name)`

    - ### 从类继承的方法 org.springframework.core.DecoratingClassLoader

      `excludeClass, excludePackage, isExcluded`

    - ### 从类继承的方法 java.lang.ClassLoader

      `clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### DEFAULT_EXCLUDED_PACKAGES

          public static final String[] DEFAULT_EXCLUDED_PACKAGES

      Packages that are excluded by default

  - ### 构造器详细资料

    - #### ShadowingClassLoader

          public ShadowingClassLoader(ClassLoader enclosingClassLoader)

      Create a new ShadowingClassLoader, decorating the given ClassLoader, applying `DEFAULT_EXCLUDED_PACKAGES`.
      参数:
        `enclosingClassLoader` - the ClassLoader to decorate
      另请参阅:
        `ShadowingClassLoader(ClassLoader, boolean)`

    - #### ShadowingClassLoader

          public ShadowingClassLoader(ClassLoader enclosingClassLoader,
                                      boolean defaultExcludes)

      Create a new ShadowingClassLoader, decorating the given ClassLoader.
      参数:
        `enclosingClassLoader` - the ClassLoader to decorate
        `defaultExcludes` - whether to apply `DEFAULT_EXCLUDED_PACKAGES`
      从以下版本开始:
        4.3.8

  - ### 方法详细资料

    - #### addTransformer

          public void addTransformer(ClassFileTransformer transformer)

      Add the given ClassFileTransformer to the list of transformers that this ClassLoader will apply.
      参数:
        `transformer` - the ClassFileTransformer

    - #### copyTransformers

          public void copyTransformers(ShadowingClassLoader other)

      Copy all ClassFileTransformers from the given ClassLoader to the list of transformers that this ClassLoader will apply.
      参数:
        `other` - the ClassLoader to copy from

    - #### loadClass

          public Class<?> loadClass(String name)
                             throws ClassNotFoundException

      覆盖:
        `loadClass` 在类中 `ClassLoader`
      抛出:
        `ClassNotFoundException`

    - #### isEligibleForShadowing

          protected boolean isEligibleForShadowing(String className)

      Determine whether the specified class is eligible for shadowing by this class loader.
      参数:
        `className` - the class name to check
      返回:
        whether the specified class is eligible
      另请参阅:
        `DecoratingClassLoader.isExcluded(java.lang.String)`

    - #### getResource

          public URL getResource(String name)

      覆盖:
        `getResource` 在类中 `ClassLoader`

    - #### getResourceAsStream

          @Nullable
          public InputStream getResourceAsStream(String name)

      覆盖:
        `getResourceAsStream` 在类中 `ClassLoader`

    - #### getResources

          public Enumeration<URL> getResources(String name)
                                        throws IOException

      覆盖:
        `getResources` 在类中 `ClassLoader`
      抛出:
        `IOException`