Package org.jboss.interceptor.model.metadata

Examples of org.jboss.interceptor.model.metadata.ClassReference


   }

   private Map<InterceptionType, List<MethodReference>> buildMethodMap(ClassReference interceptorClass, boolean isTargetClass)
   {
      Map<InterceptionType, List<MethodReference>> methodMap = new HashMap<InterceptionType, List<MethodReference>>();
      ClassReference currentClass = interceptorClass;
      Set<MethodHolder> foundMethods = new HashSet<MethodHolder>();
      do
      {
         Set<InterceptionType> detectedInterceptorTypes = new HashSet<InterceptionType>();

         for (MethodReference method : currentClass.getDeclaredMethods())
         {
            for (InterceptionType interceptionType : InterceptionTypeRegistry.getSupportedInterceptionTypes())
            {
               if (InterceptionUtils.isInterceptorMethod(interceptionType, method, isTargetClass))
               {
                  if (methodMap.get(interceptionType) == null)
                  {
                     methodMap.put(interceptionType, new LinkedList<MethodReference>());
                  }
                  if (detectedInterceptorTypes.contains(interceptionType))
                  {
                     throw new InterceptorMetadataException("Same interception type cannot be specified twice on the same class");
                  }
                  else
                  {
                     detectedInterceptorTypes.add(interceptionType);
                  }
                  // add method in the list - if it is there already, it means that it has been added by a subclass
                  ReflectionUtils.ensureAccessible(method.getJavaMethod());
                  if (!foundMethods.contains(MethodHolder.of(method, false)))
                  {
                     methodMap.get(interceptionType).add(0, method);
                  }
               }
            }
            foundMethods.add(MethodHolder.of(method, false));
         }
         currentClass = currentClass.getSuperclass();
      }
      while (!Object.class.equals(currentClass.getJavaClass()));
      return methodMap;
   }
View Full Code Here

TOP

Related Classes of org.jboss.interceptor.model.metadata.ClassReference

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.