Package com.google.common.collect

Examples of com.google.common.collect.HashMultimap


class AnnotatedHandlerFinder
  implements HandlerFindingStrategy
{
  public Multimap findAllHandlers(Object paramObject)
  {
    HashMultimap localHashMultimap = HashMultimap.create();
    for (Class localClass1 = paramObject.getClass(); localClass1 != null; localClass1 = localClass1.getSuperclass())
      for (Method localMethod : localClass1.getMethods())
      {
        Subscribe localSubscribe = (Subscribe)localMethod.getAnnotation(Subscribe.class);
        if (localSubscribe != null)
        {
          Class[] arrayOfClass = localMethod.getParameterTypes();
          if (arrayOfClass.length != 1)
            throw new IllegalArgumentException("Method " + localMethod + " has @Subscribe annotation, but requires " + arrayOfClass.length + " arguments.  Event handler methods " + "must require a single argument.");
          Class localClass2 = arrayOfClass[0];
          EventHandler localEventHandler = makeHandler(paramObject, localMethod);
          localHashMultimap.put(localClass2, localEventHandler);
        }
      }
    return localHashMultimap;
  }
View Full Code Here

TOP

Related Classes of com.google.common.collect.HashMultimap

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.