1 16 package net.sf.cglib.transform.impl; 17 18 import net.sf.cglib.core.*; 19 import net.sf.cglib.transform.*; 20 import org.objectweb.asm.Attribute; 21 22 27 public class UndeclaredThrowableStrategy extends DefaultGeneratorStrategy { 28 private ClassTransformer t; 29 30 38 public UndeclaredThrowableStrategy(Class wrapper) { 39 t = new UndeclaredThrowableTransformer(wrapper); 40 t = new MethodFilterTransformer(TRANSFORM_FILTER, t); 41 } 42 43 private static final MethodFilter TRANSFORM_FILTER = new MethodFilter() { 44 public boolean accept(int access, String name, String desc, String signature, String [] exceptions) { 45 return !TypeUtils.isPrivate(access) && name.indexOf('$') < 0; 46 } 47 }; 48 49 protected ClassGenerator transform(ClassGenerator cg) throws Exception { 50 return new TransformingClassGenerator(cg, t); 51 } 52 } 53 54 | Popular Tags |