/** * Call passed end event if possible. * * @param filter the filter * @param descriptor the descriptor of the filter * @param id the id of the event * @param parameters the parameters of the event * @return true if the event has been sent, false otherwise * @throws FilterException when the passed filter exposes the event but failed anyway */ public static boolean sendEndEvent(Object filter, FilterDescriptor descriptor, String id, FilterEventParameters parameters) throws FilterException { FilterElementDescriptor elementDescriptor = descriptor.getElement(id); if (elementDescriptor != null && elementDescriptor.getEndMethod() != null) { sendEvent(elementDescriptor.getEndMethod(), elementDescriptor, filter, parameters); } else if (filter instanceof UnknownFilter) { ((UnknownFilter) filter).endUnknwon(id, parameters); } else { return false; } return true; }
/** * Call passed begin event if possible. * * @param filter the filter * @param descriptor the descriptor of the filter * @param id the id of the event * @param parameters the parameters of the event * @return true if the event has been sent, false otherwise * @throws FilterException when the passed filter exposes the event but failed anyway */ public static boolean sendBeginEvent(Object filter, FilterDescriptor descriptor, String id, FilterEventParameters parameters) throws FilterException { FilterElementDescriptor elementDescriptor = descriptor.getElement(id); if (elementDescriptor != null && elementDescriptor.getBeginMethod() != null) { sendEvent(elementDescriptor.getBeginMethod(), elementDescriptor, filter, parameters); } else if (filter instanceof UnknownFilter) { ((UnknownFilter) filter).beginUnknwon(id, parameters); } else { return false; } return true; }
/** * Call passed on event if possible. * * @param filter the filter * @param descriptor the descriptor of the filter * @param id the id of the event * @param parameters the parameters of the event * @return true if the event has been sent, false otherwise * @throws FilterException when the passed filter exposes the event but failed anyway */ public static boolean sendOnEvent(Object filter, FilterDescriptor descriptor, String id, FilterEventParameters parameters) throws FilterException { FilterElementDescriptor elementDescriptor = descriptor.getElement(id); if (elementDescriptor != null && elementDescriptor.getOnMethod() != null) { sendEvent(elementDescriptor.getOnMethod(), elementDescriptor, filter, parameters); } else if (filter instanceof UnknownFilter) { ((UnknownFilter) filter).onUnknwon(id, parameters); } else { return false; } return true; } }