Package net.bytebuddy.implementation
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 java.lang.Object implements ExceptionMethod.ConstructionDelegate
A construction delegate that calls a constructor that takes a single string as its argument.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.ExceptionMethod.ConstructionDelegate
ExceptionMethod.ConstructionDelegate.ForDefaultConstructor, ExceptionMethod.ConstructionDelegate.ForStringConstructor
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
message
TheString
that is to be passed to the exception's constructor.private MethodDescription
targetConstructor
The constructor that is used for creating the exception.private TypeDescription
throwableType
The type of the exception that is to be thrown.
-
Constructor Summary
Constructors Constructor Description ForStringConstructor(TypeDescription throwableType, java.lang.String message)
Creates a new construction delegate that calls a constructor by handing it the given string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation
make()
Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack and subsequently calls the constructor.
-
-
-
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
TheString
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 theThrowable
.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 interfaceExceptionMethod.ConstructionDelegate
- Returns:
- A stack manipulation for constructing a
Throwable
.
-
-