throws Exception
{
Iterator<FieldInfo> fields = cf.getFields().iterator();
while (fields.hasNext())
{
FieldInfo finfo = fields.next();
AnnotationsAttribute mgroup = (AnnotationsAttribute) finfo.getAttribute(AnnotationsAttribute.visibleTag);
if (mgroup == null) continue;
javassist.bytecode.annotation.Annotation binfo = mgroup.getAnnotation(Introduction.class.getName());
if (binfo == null) continue;
//Since some of the values are of type Class, and method gets called by the system classloader (via Agent)
// for loadtime aop in jdk 1.5 the classes we try to look at might not yet have been loaded. We're
//only after the names anyway, so we bypass the AnnotationProxy/ProxyMapCreator which tries to validate
//class names by loading the (so far) non-existent class.
//Introduction introduction = (Introduction) AnnotationProxy.createProxy(binfo, Introduction.class);
//String target = introduction.target();
//String typeExpression = introduction.typeExpression();
//String[] interfaces = introduction.interfaces();
MemberValue mv = binfo.getMemberValue("target");
String target = (mv != null) ? ((ClassMemberValue) mv).getValue() : "java.lang.Class";//Note! this should be the same as the default in @Interceptor
mv = binfo.getMemberValue("typeExpression");
String typeExpression = (mv != null) ? ((StringMemberValue) mv).getValue() : "";//Note! this should be the same as the default in @Interceptor
mv = binfo.getMemberValue("interfaces");
MemberValue[] values = ((ArrayMemberValue) mv).getValue();
String[] interfaces = new String[values.length];
for (int i = 0; i < values.length; i++) interfaces[i] = ((ClassMemberValue) values[i]).getValue();
String name = cf.getName() + "." + finfo.getName(); //Name of the field defined on
InterfaceIntroductionInfo interfaceIntro = createIntroduction(name, target, typeExpression, interfaces, null, null);
loaderStrategy.deployInterfaceIntroduction(this, interfaceIntro);
}
}