/** * Returns the component id to match against, or the empty * string if the component id is not specified. The component id * is provided by the OnEvent annotation or (if that is not present) * by the part of the method name following "From" ("onActionFromFoo"). */ private String extractComponentId(String methodName, OnEvent annotation) { if (annotation != null) return annotation.component(); // Method name started with "on". Extract the component id, if present. int fromx = methodName.indexOf("From"); if (fromx < 0) return ""; return methodName.substring(fromx + 4); }