Package net.sf.cglib.transform.impl
Class UndeclaredThrowableStrategy
- java.lang.Object
-
- net.sf.cglib.core.DefaultGeneratorStrategy
-
- net.sf.cglib.transform.impl.UndeclaredThrowableStrategy
-
- All Implemented Interfaces:
GeneratorStrategy
public class UndeclaredThrowableStrategy extends DefaultGeneratorStrategy
AGeneratorStrategy
suitable for use withnet.sf.cglib.Enhancer
which causes all undeclared exceptions thrown from within a proxied method to be wrapped in an alternative exception of your choice.
-
-
Field Summary
Fields Modifier and Type Field Description private static MethodFilter
TRANSFORM_FILTER
private java.lang.Class
wrapper
-
Fields inherited from class net.sf.cglib.core.DefaultGeneratorStrategy
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description UndeclaredThrowableStrategy(java.lang.Class wrapper)
Create a new instance of this strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClassGenerator
transform(ClassGenerator cg)
-
Methods inherited from class net.sf.cglib.core.DefaultGeneratorStrategy
generate, getClassVisitor, getClassWriter, transform
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.cglib.core.GeneratorStrategy
equals
-
-
-
-
Field Detail
-
wrapper
private java.lang.Class wrapper
-
TRANSFORM_FILTER
private static final MethodFilter TRANSFORM_FILTER
-
-
Constructor Detail
-
UndeclaredThrowableStrategy
public UndeclaredThrowableStrategy(java.lang.Class wrapper)
Create a new instance of this strategy.- Parameters:
wrapper
- a class which extends either directly or indirectly fromThrowable
and which has at least one constructor that takes a single argument of typeThrowable
, for examplejava.lang.reflect.UndeclaredThrowableException.class
-
-
Method Detail
-
transform
protected ClassGenerator transform(ClassGenerator cg) throws java.lang.Exception
- Overrides:
transform
in classDefaultGeneratorStrategy
- Throws:
java.lang.Exception
-
-