Package javassist.bytecode

Examples of javassist.bytecode.FieldInfo


   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(PointcutDef.class.getName());
         if (binfo == null) continue;
         PointcutDef pdef = (PointcutDef) AnnotationProxy.createProxy(binfo, PointcutDef.class);
View Full Code Here


   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(PointcutDef.class.getName());
         if (binfo == null) continue;
         manager.removePointcut(getPointcutName(cf, finfo));
      }
View Full Code Here

   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

         InterfaceIntroduction interfaceIntro = createIntroduction(name, target, typeExpression, interfaces, null, null);
         manager.addInterfaceIntroduction(interfaceIntro);
      }
   }
View Full Code Here

   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;

         String name = cf.getName() + "." + finfo.getName(); //Name of the field defined on

         manager.removeInterfaceIntroduction(name);
      }
   }
View Full Code Here

   private void deployTypedefs(ClassFile cf) 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(TypeDef.class.getName());
         if (binfo == null) continue;
         TypeDef typeDefinition = (TypeDef) AnnotationProxy.createProxy(binfo, TypeDef.class);
View Full Code Here

   private void undeployTypedefs(ClassFile cf) 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(TypeDef.class.getName());
         if (binfo == null) continue;

         AnnotationProxy.createProxy(binfo, TypeDef.class);
View Full Code Here

   private void deployCFlowStackDefs(ClassFile cf) 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(CFlowStackDef.class.getName());
         if (binfo == null) continue;
         CFlowStackDef stackDef = (CFlowStackDef) AnnotationProxy.createProxy(binfo, CFlowStackDef.class);
View Full Code Here

   private void undeployCFlowStackDefs(ClassFile cf) 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(CFlowStackDef.class.getName());
         if (binfo == null) continue;
         AnnotationProxy.createProxy(binfo, CFlowStackDef.class);
View Full Code Here

   private void deployPrepares(ClassFile cf) 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(Prepare.class.getName());
         if (binfo == null) continue;
         Prepare prepare = (Prepare) AnnotationProxy.createProxy(binfo, Prepare.class);
View Full Code Here

   private void undeployPrepares(ClassFile cf) 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(Prepare.class.getName());
         if (binfo == null) continue;
         AnnotationProxy.createProxy(binfo, Prepare.class);
View Full Code Here

TOP

Related Classes of javassist.bytecode.FieldInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.