/** * Create a new guesser. */ public SimpleMethodParameterGuesser(Collection<?> vals)//Class<?>[] ptypes, Collection<?> vals) { this(new SimpleParameterGuesser(vals)); }
/** * The feature can add objects for field or method injections * by providing an optional parameter guesser. The selection order is the reverse * init order, i.e., later features can override values from earlier features. */ public IParameterGuesser getParameterGuesser() { if(guesser==null) { guesser = new SimpleParameterGuesser(Collections.singleton(this)); } return guesser; } }
/** * The feature can add objects for field or method injections * by providing an optional parameter guesser. The selection order is the reverse * init order, i.e., later features can override values from earlier features. */ public IParameterGuesser getParameterGuesser() { if(guesser==null) { guesser = new SimpleParameterGuesser(super.getParameterGuesser(), Collections.singleton(pojoagent)); } return guesser; } }
/** * Do the method invocation. */ protected Object invokeMethod(IEvent event) throws Exception { method.setAccessible(true); Object[] params = null; List<Object> vals = new ArrayList<Object>(); vals.add(event); if(event.getContent()!=null) { vals.add(event.getContent()); } if(guesser==null) { params = new SimpleMethodParameterGuesser(vals).guessParameters(method.getParameterTypes(), null); } else { // Hack!!! what if already has a parent? // guesser.getGuesser().setParent(new SimpleParameterGuesser(vals)); params = guesser.guessParameters(method.getParameterTypes(), new SimpleParameterGuesser(vals)); } return method.invoke(object, params); }
IParameterGuesser guesser = args!=null ? new SimpleParameterGuesser(component.getParameterGuesser(), Arrays.asList(args)) : component.getParameterGuesser(); Object[] iargs = new Object[method.getParameterTypes().length]; for(int i=0; i<method.getParameterTypes().length; i++)
SimpleParameterGuesser g = new SimpleParameterGuesser(vals); for(int i=0; i<ptypes.length; i++)
SimpleParameterGuesser g = new SimpleParameterGuesser(vals); for(int i=0; i<ptypes.length; i++)
SimpleParameterGuesser g = new SimpleParameterGuesser(vals); for(int i=0; i<ptypes.length; i++)
vals.add(ocapa); vals.add(new CapabilityPojoWrapper(getComponent(), ocapa, capa)); hackguesser = new SimpleParameterGuesser(super.getParameterGuesser(), vals);