I have a method in a class like this:
public static void postEvents(List<RuleEvent> eventList) { for(RuleEvent event:eventList) if(canProcess(event)) findListenerAndPost(event); }
and I want to access it using this reflection:
Class partypes[] = new Class[1]; partypes[0] = List.class; //does not find the method as it is of List<RuleEvent> postMethod = cls.getMethod("postEvents", partypes);
so how do I get an object of class List<RuleEvent> ????
I already know the way ((List<RuleEvent>) new ArrayList<RuleEvent>()).getClass() , but there should be a more direct way ...
source share