java.lang.Throwable to be thrown when the instrumented method is invoked.
Be aware that the Java Virtual machine does not care about exception declarations and will throw any
java.lang.Throwable from any method even if the method does not declared a checked exception.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | ExceptionMethod.ConstructionDelegate
A construction delegate is responsible for calling a |
| Modifier and Type | Field and Description |
|---|---|
| private final ExceptionMethod. | constructionDelegate
The construction delegation which is responsible for creating the exception to be thrown. |
| Access | Constructor and Description |
|---|---|
| public | ExceptionMethod(ExceptionMethod.
A delegate that is responsible for calling the constructionDelegateThrowable's constructor.Creates a new instance of an implementation for throwing throwables. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteCodeAppender | appender(Implementation.
The target of the current implementation. implementationTargetImplements net. |
| public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
| public InstrumentedType | prepare(InstrumentedType
The instrumented type in its current form. instrumentedType)Implements net. |
| public static Implementation | Returns: An implementation that will throw an instance of theThrowable on each method invocation of the
instrumented methods.The type of the throwableType)Throwable.Creates an implementation that creates a new instance of the given |
| public static Implementation | Returns: An implementation that will throw an instance of theThrowable on each method invocation of the
instrumented methods.The type of the throwableType)Throwable.Creates an implementation that creates a new instance of the given |
| public static Implementation | Returns: An implementation that will throw an instance of theThrowable on each method invocation
of the instrumented methods.The type of the throwableType, String Throwable.The string that is handed to the constructor. Usually an exception message. message)Creates an implementation that creates a new instance of the given |
| public static Implementation | Returns: An implementation that will throw an instance of theThrowable on each method invocation
of the instrumented methods.The type of the throwableType, String Throwable.The string that is handed to the constructor. Usually an exception message. message)Creates an implementation that creates a new instance of the given |
| constructionDelegate | back to summary |
|---|---|
| private final ExceptionMethod. The construction delegation which is responsible for creating the exception to be thrown. | |
| ExceptionMethod | back to summary |
|---|---|
| public ExceptionMethod(ExceptionMethod. Creates a new instance of an implementation for throwing throwables.
| |
| appender | back to summary |
|---|---|
| public ByteCodeAppender appender(Implementation. Implements net. Doc from net. Creates a byte code appender that determines the implementation of the instrumented type's methods.
| |
| apply | back to summary |
|---|---|
| public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
| |
| prepare | back to summary |
|---|---|
| public InstrumentedType prepare(InstrumentedType instrumentedType) Implements net. Doc from net. Prepares a given instrumented type.
| |
| throwing | back to summary |
|---|---|
| public static Implementation throwing(Class<? extends Throwable> throwableType) Creates an implementation that creates a new instance of the given
| |
| throwing | back to summary |
|---|---|
| public static Implementation throwing(TypeDescription throwableType) Creates an implementation that creates a new instance of the given
| |
| throwing | back to summary |
|---|---|
| public static Implementation throwing(Class<? extends Throwable> throwableType, String message) Creates an implementation that creates a new instance of the given
| |
| throwing | back to summary |
|---|---|
| public static Implementation throwing(TypeDescription throwableType, String message) Creates an implementation that creates a new instance of the given
| |
Throwable's constructor.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ExceptionMethod.ConstructionDelegate.ForDefaultConstructor
A construction delegate that calls the default constructor. |
| public static class | ExceptionMethod.ConstructionDelegate.ForStringConstructor
A construction delegate that calls a constructor that takes a single string as its argument. |
| Modifier and Type | Method and Description |
|---|---|
| public StackManipulation |
| make | back to summary |
|---|---|
| public StackManipulation make() Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack and subsequently calls the constructor.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final MethodDescription | targetConstructor
The constructor that is used for creating the exception. |
| private final TypeDescription | throwableType
The type of the exception that is to be thrown. |
| Access | Constructor and Description |
|---|---|
| public | ForDefaultConstructor(TypeDescription
The type of the throwableType)Throwable.Creates a new construction delegate that calls a default constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public StackManipulation | make()
Implements net. |
| targetConstructor | back to summary |
|---|---|
| private final MethodDescription targetConstructor The constructor that is used for creating the exception. | |
| throwableType | back to summary |
|---|---|
| private final TypeDescription throwableType The type of the exception that is to be thrown. | |
| ForDefaultConstructor | back to summary |
|---|---|
| public ForDefaultConstructor(TypeDescription throwableType) Creates a new construction delegate that calls a default constructor.
| |
| make | back to summary |
|---|---|
| public StackManipulation make() Implements net. Doc from net. Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack and subsequently calls the constructor.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | message
The |
| private final MethodDescription | targetConstructor
The constructor that is used for creating the exception. |
| private final TypeDescription | throwableType
The type of the exception that is to be thrown. |
| Access | Constructor and Description |
|---|---|
| public | ForStringConstructor(TypeDescription
The type of the throwableType, String Throwable.The string that is handed to the constructor. message)Creates a new construction delegate that calls a constructor by handing it the given string. |
| Modifier and Type | Method and Description |
|---|---|
| public StackManipulation | make()
Implements net. |
| message | back to summary |
|---|---|
| private final String message The | |
| targetConstructor | back to summary |
|---|---|
| private final MethodDescription targetConstructor The constructor that is used for creating the exception. | |
| throwableType | back to summary |
|---|---|
| private final TypeDescription throwableType The type of the exception that is to be thrown. | |
| ForStringConstructor | back to summary |
|---|---|
| public ForStringConstructor(TypeDescription throwableType, String message) Creates a new construction delegate that calls a constructor by handing it the given string.
| |
| make | back to summary |
|---|---|
| public StackManipulation make() Implements net. Doc from net. Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack and subsequently calls the constructor.
| |