1 16 package net.sf.cglib.proxy; 17 18 import java.lang.reflect.Method ; 19 import java.lang.reflect.Modifier ; 20 import java.util.*; 21 import net.sf.cglib.core.CollectionUtils; 22 import net.sf.cglib.core.ReflectUtils; 23 import net.sf.cglib.core.RejectModifierPredicate; 24 import org.objectweb.asm.ClassVisitor; 25 26 30 class MixinEverythingEmitter extends MixinEmitter { 31 32 public MixinEverythingEmitter(ClassVisitor v, String className, Class [] classes) { 33 super(v, className, classes, null); 34 } 35 36 protected Class [] getInterfaces(Class [] classes) { 37 List list = new ArrayList(); 38 for (int i = 0; i < classes.length; i++) { 39 ReflectUtils.addAllInterfaces(classes[i], list); 40 } 41 return (Class [])list.toArray(new Class [list.size()]); 42 } 43 44 protected Method [] getMethods(Class type) { 45 List methods = new ArrayList(Arrays.asList(type.getMethods())); 46 CollectionUtils.filter(methods, new RejectModifierPredicate(Modifier.FINAL | Modifier.STATIC)); 47 return (Method [])methods.toArray(new Method [methods.size()]); 48 } 49 } 50 | Popular Tags |