Class ExceptionMethod.ConstructionDelegate.ForStringConstructor

    • Field Detail

      • 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 java.lang.String message
        The String that is to be passed to the exception's constructor.
    • Constructor Detail

      • ForStringConstructor

        public ForStringConstructor​(TypeDescription throwableType,
                                    java.lang.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 Detail

      • make

        public StackManipulation make()
        Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack and subsequently calls the constructor.
        Specified by:
        make in interface ExceptionMethod.ConstructionDelegate
        Returns:
        A stack manipulation for constructing a Throwable.