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
A 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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UndeclaredThrowableStrategy
public UndeclaredThrowableStrategy(Class wrapper)
- Create a new instance of this strategy.
- Parameters:
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
transform
protected ClassGenerator transform(ClassGenerator cg)
throws Exception
- Overrides:
transform in class DefaultGeneratorStrategy
- Throws:
Exception
Copyright © 2012 Oracle Corporation. All Rights Reserved.