Class ExceptionMethod.ConstructionDelegate.ForStringConstructor

java.lang.Object
net.bytebuddy.implementation.ExceptionMethod.ConstructionDelegate.ForStringConstructor
All Implemented Interfaces:
ExceptionMethod.ConstructionDelegate
Enclosing interface:
ExceptionMethod.ConstructionDelegate

@Enhance public static class ExceptionMethod.ConstructionDelegate.ForStringConstructor extends Object implements ExceptionMethod.ConstructionDelegate
A construction delegate that calls a constructor that takes a single string as its argument.
  • Field Details

    • throwableType

      private final TypeDescription throwableType
      The type of the exception that is to be thrown.
    • targetConstructor

      private final MethodDescription targetConstructor
      The constructor that is used for creating the exception.
    • message

      private final String message
      The String that is to be passed to the exception's constructor.
  • Constructor Details

    • ForStringConstructor

      public ForStringConstructor(TypeDescription throwableType, String message)
      Creates a new construction delegate that calls a constructor by handing it the given string.
      Parameters:
      throwableType - The type of the Throwable.
      message - The string that is handed to the constructor.
  • Method Details