Class ClassLoaderDecorator.NoOp

java.lang.Object
net.bytebuddy.dynamic.loading.ClassLoaderDecorator.NoOp
All Implemented Interfaces:
ClassLoaderDecorator
Enclosing interface:
ClassLoaderDecorator

@Enhance public static class ClassLoaderDecorator.NoOp extends Object implements ClassLoaderDecorator
A no-operation implementation of a class loader decorator that always returns the same class loader without applying any decoration.
  • Field Details

  • Constructor Details

    • NoOp

      public NoOp(@MaybeNull ClassLoader classLoader)
      Creates a new no-operation class loader decorator.
      Parameters:
      classLoader - The class loader to return for all type descriptions or null for the bootstrap class loader.
  • Method Details

    • isSkipped

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

      @MaybeNull public ClassLoader apply(TypeDescription typeDescription)
      Applies this decorator to resolve a class loader for the given type.
      Specified by:
      apply in interface ClassLoaderDecorator
      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.