annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/ClassVisitorImpl.java
@Override
   public void visit(Class<?> clazz)
   {

      ClassContextImpl context = new ClassContextImpl(builder, clazz);
      context.put(clazz, payload);

      if (log.isTraceEnabled())
      {
         log.trace("Scanning class: {}", clazz.getName());
      }

      // first process the class
      visit(clazz, context);

      // only process fields and classes if a rule building has been started
      if (context.hasRuleBuildingStarted()) {

         // walk up the inheritance hierarchy
         Class<?> currentType = clazz;
         while (currentType != null) {

            // then process the fields
            for (Field field : currentType.getDeclaredFields())
            {
               visit(field, new FieldContextImpl(context, field));
            }

            // then the methods
            for (Method method : currentType.getDeclaredMethods())
            {
               MethodContextImpl methodContext = new MethodContextImpl(context, method);
               visit(method, methodContext);

               // then the method parameters
               for (int i = 0; i < method.getParameterTypes().length; i++)
               {
                  ParameterImpl parameter = new ParameterImpl(method, method.getParameterTypes()[i],
                           method.getParameterAnnotations()[i], i);
                  visit(parameter, new ParameterContextImpl(methodContext, parameter));
               }
            }

            currentType = currentType.getSuperclass();

         }
      }

   }
@Override
   public void visit(Class<?> clazz)
   {

      ClassContextImpl context = new ClassContextImpl(builder, clazz);
      context.put(clazz, payload);

      if (log.isTraceEnabled())
      {
         log.trace("Scanning class: {}", clazz.getName());
      }

      // first process the class
      visit(clazz, context);

      // only process fields and classes if a rule building has been started
      if (context.hasRuleBuildingStarted()) {

         // walk up the inheritance hierarchy
         Class<?> currentType = clazz;
         while (currentType != null) {

            // then process the fields
            for (Field field : currentType.getDeclaredFields())
            {
               visit(field, new FieldContextImpl(context, field));
            }

            // then the methods
            for (Method method : currentType.getDeclaredMethods())
            {
               MethodContextImpl methodContext = new MethodContextImpl(context, method);
               visit(method, methodContext);

               // then the method parameters
               for (int i = 0; i < method.getParameterTypes().length; i++)
               {
                  ParameterImpl parameter = new ParameterImpl(method, method.getParameterTypes()[i],
                           method.getParameterAnnotations()[i], i);
                  visit(parameter, new ParameterContextImpl(methodContext, parameter));
               }
            }

            currentType = currentType.getSuperclass();

         }
      }

   }
Processes the annotation on the supplied class.