public class UndeclaredThrowableStrategy extends DefaultGeneratorStrategy
GeneratorStrategy
suitable for use with net.sf.cglib.Enhancer
which
causes all undeclared exceptions thrown from within a proxied method to be wrapped
in an alternative exception of your choice.Modifier and Type | Field and Description |
---|---|
private static MethodFilter |
TRANSFORM_FILTER |
private java.lang.Class |
wrapper |
INSTANCE
Constructor and Description |
---|
UndeclaredThrowableStrategy(java.lang.Class wrapper)
Create a new instance of this strategy.
|
Modifier and Type | Method and Description |
---|---|
protected ClassGenerator |
transform(ClassGenerator cg) |
generate, getClassVisitor, getClassWriter, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
private java.lang.Class wrapper
private static final MethodFilter TRANSFORM_FILTER
public UndeclaredThrowableStrategy(java.lang.Class wrapper)
wrapper
- a class which extends either directly or
indirectly from Throwable
and which has at least one
constructor that takes a single argument of type
Throwable
, for example
java.lang.reflect.UndeclaredThrowableException.class
protected ClassGenerator transform(ClassGenerator cg) throws java.lang.Exception
transform
in class DefaultGeneratorStrategy
java.lang.Exception