Package org.jboss.aop.introduction

Examples of org.jboss.aop.introduction.AnnotationIntroduction


      List<AnnotationIntroduction> annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here


      List<AnnotationIntroduction> annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here

      List annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = (AnnotationIntroduction) annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here

   {
      boolean changed = false;
      Iterator it = advisor.getManager().getAnnotationIntroductions().iterator();
      while (it.hasNext())
      {
         AnnotationIntroduction introduction = (AnnotationIntroduction) it.next();
         if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug("**** " + introduction.getOriginalAnnotationExpr() + " invisible: " + introduction.isInvisible() + " expr: " + introduction.getOriginalExpression());
         if (introduction.matches(advisor, clazz))
         {
            if (AspectManager.verbose && logger.isDebugEnabled()) logger.debug(introduction.getAnnotation() + " binds to " + clazz.getName());
            javassist.bytecode.annotation.Annotation info = AnnotationInfoCreator.createAnnotationInfo(classPool, clazz.getClassFile2().getConstPool(), introduction.getAnnotation());
            if (introduction.isInvisible())
            {
               AnnotationsAttribute invisible = (AnnotationsAttribute) clazz.getClassFile2().getAttribute(AnnotationsAttribute.invisibleTag);
               if (invisible == null)
               {
                  invisible = new AnnotationsAttribute(clazz.getClassFile2().getConstPool(), AnnotationsAttribute.invisibleTag);
                  clazz.getClassFile2().addAttribute(invisible);
               }
               changed = true;
               invisible.addAnnotation(info);
            }
            else
            {
               AnnotationsAttribute visible = (AnnotationsAttribute) clazz.getClassFile2().getAttribute(AnnotationsAttribute.visibleTag);
               if (visible == null)
               {
                  visible = new AnnotationsAttribute(clazz.getClassFile2().getConstPool(), AnnotationsAttribute.visibleTag);
                  clazz.getClassFile2().addAttribute(visible);
               }
               changed = true;
               visible.addAnnotation(info);
            }
         }

         CtMethod[] methods = clazz.getDeclaredMethods();
         for (int i = 0; i < methods.length; i++)
         {
            if (introduction.matches(advisor, methods[i]))
            {
               javassist.bytecode.annotation.Annotation info = AnnotationInfoCreator.createAnnotationInfo(classPool, methods[i].getMethodInfo2().getConstPool(), introduction.getAnnotation());
               MethodInfo mi = methods[i].getMethodInfo2();
               if (introduction.isInvisible())
               {
                  AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
                  if (invisible == null)
                  {
                     invisible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.invisibleTag);
                     mi.addAttribute(invisible);
                  }
                  changed = true;
                  invisible.addAnnotation(info);
               }
               else
               {
                  AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
                  if (visible == null)
                  {
                     visible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.visibleTag);
                     mi.addAttribute(visible);
                  }
                  changed = true;
                  visible.addAnnotation(info);
               }
            }

         }

         CtConstructor[] cons = clazz.getDeclaredConstructors();
         for (int i = 0; i < cons.length; i++)
         {
            if (introduction.matches(advisor, cons[i]))
            {
               javassist.bytecode.annotation.Annotation info = AnnotationInfoCreator.createAnnotationInfo(classPool, cons[i].getMethodInfo2().getConstPool(), introduction.getAnnotation());
               MethodInfo mi = cons[i].getMethodInfo2();
               if (introduction.isInvisible())
               {
                  AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
                  if (invisible == null)
                  {
                     invisible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.invisibleTag);
                     mi.addAttribute(invisible);
                  }
                  changed = true;
                  invisible.addAnnotation(info);
               }
               else
               {
                  AnnotationsAttribute visible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag);
                  if (visible == null)
                  {
                     visible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.visibleTag);
                     mi.addAttribute(visible);
                  }
                  changed = true;
                  visible.addAnnotation(info);
               }
            }
         }

         CtField[] fields = clazz.getDeclaredFields();
         for (int i = 0; i < fields.length; i++)
         {
            if (introduction.matches(advisor, fields[i]))
            {
               javassist.bytecode.annotation.Annotation info = AnnotationInfoCreator.createAnnotationInfo(classPool, fields[i].getFieldInfo2().getConstPool(), introduction.getAnnotation());
               FieldInfo mi = fields[i].getFieldInfo2();
               if (introduction.isInvisible())
               {
                  AnnotationsAttribute invisible = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag);
                  if (invisible == null)
                  {
                     invisible = new AnnotationsAttribute(mi.getConstPool(), AnnotationsAttribute.invisibleTag);
View Full Code Here

   {
      boolean changed = false;
      Iterator it = advisor.getManager().getAnnotationOverrides().iterator();
      while (it.hasNext())
      {
         AnnotationIntroduction introduction = (AnnotationIntroduction) it.next();
         if (introduction.matches(advisor, clazz))
         {
            advisor.getAnnotations().addClassAnnotation(introduction.getAnnotation().getIdentifier(), introduction.getOriginalAnnotationExpr());
         }

         CtMethod[] methods = clazz.getDeclaredMethods();
         for (int i = 0; i < methods.length; i++)
         {
            if (introduction.matches(advisor, methods[i]))
            {
               advisor.getAnnotations().addAnnotation(methods[i], introduction.getAnnotation().getIdentifier());
            }
         }

         CtConstructor[] cons = clazz.getDeclaredConstructors();
         for (int i = 0; i < cons.length; i++)
         {
            if (introduction.matches(advisor, cons[i]))
            {
               advisor.getAnnotations().addAnnotation(cons[i], introduction.getAnnotation().getIdentifier());
            }
         }

         CtField[] fields = clazz.getDeclaredFields();
         for (int i = 0; i < fields.length; i++)
         {
            if (introduction.matches(advisor, fields[i]))
            {
               advisor.getAnnotations().addAnnotation(fields[i], introduction.getAnnotation().getIdentifier());
            }
         }
      }
      return changed;
   }
View Full Code Here

      List<AnnotationIntroduction> annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here

      List<AnnotationIntroduction> annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here

         boolean invisible = intro.invisible();
         String annotation = intro.annotation();

         annotation = annotation.replace('\'', '"');

         AnnotationIntroduction annIntro = AnnotationIntroduction.createComplexAnnotationIntroduction(expr, annotation, invisible);
         manager.addAnnotationIntroduction(annIntro);
      }
   }
View Full Code Here

         boolean invisible = intro.invisible();
         String annotation = intro.annotation();

         annotation = annotation.replace('\'', '"');

         AnnotationIntroduction annIntro = AnnotationIntroduction.createComplexAnnotationIntroduction(expr, annotation, invisible);
         manager.removeAnnotationIntroduction(annIntro);
      }
   }
View Full Code Here

      List<AnnotationIntroduction> annotationOverrides = getManager().getAnnotationOverrides();
      if (annotationOverrides != null)
      {
         for (int i = 0; i < annotationOverrides.size(); ++i)
         {
            AnnotationIntroduction introduction = annotationOverrides.get(i);
            deployAnnotationOverride(introduction);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.introduction.AnnotationIntroduction

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.