1 package org.hibernate.tool.instrument; 3 4 import java.util.Arrays ; 5 6 import net.sf.cglib.transform.AbstractTransformTask; 7 import net.sf.cglib.transform.ClassTransformer; 8 import net.sf.cglib.transform.impl.InterceptFieldEnabled; 9 import net.sf.cglib.transform.impl.InterceptFieldFilter; 10 import net.sf.cglib.transform.impl.InterceptFieldTransformer; 11 12 import org.objectweb.asm.Type; 13 14 20 public class InstrumentTask extends AbstractTransformTask { 21 22 protected ClassTransformer getClassTransformer(String [] classInfo) { 23 24 if( Arrays.asList(classInfo).contains( InterceptFieldEnabled.class.getName() ) ){ 25 return null; 26 } 27 else { 28 return new InterceptFieldTransformer( 29 new InterceptFieldFilter() { 30 public boolean acceptRead(Type owner, String name) { 31 return true; 32 } 33 public boolean acceptWrite(Type owner, String name) { 34 return true; 35 } 36 } 37 ); 38 } 39 40 } 41 42 } 43 | Popular Tags |