Interface ClassLoaderDecorator

All Known Implementing Classes:
ClassLoaderDecorator.NoOp, ModuleLayerFromSingleClassLoaderDecorator

public interface ClassLoaderDecorator
A class loader decorator allows for the decoration of class loaders that are created by a ClassLoadingStrategy. This way, it is possible to define custom class loaders that wrap Byte Buddy's built-in class loaders.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A factory for creating class loader decorators.
    static class 
    A no-operation implementation of a class loader decorator that always returns the same class loader without applying any decoration.
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(TypeDescription typeDescription)
    Applies this decorator to resolve a class loader for the given type.
    boolean
    isSkipped(TypeDescription typeDescription)
    Determines if a type should be skipped from class loader decoration.
  • Method Details

    • isSkipped

      boolean isSkipped(TypeDescription typeDescription)
      Determines if a type should be skipped from class loader decoration.
      Parameters:
      typeDescription - The type description to check.
      Returns:
      true if the type should be skipped from decoration.
    • apply

      @MaybeNull ClassLoader apply(TypeDescription typeDescription)
      Applies this decorator to resolve a class loader for the given type.
      Parameters:
      typeDescription - The type description for which to resolve a class loader.
      Returns:
      The class loader to use for the given type or null for the bootstrap class loader.