JClassType baseInterface = typeOracle.findType(getBaseclassInterfaceName()); for (JMethod m : superInterface.getInheritableMethods()) { ignoredMethods.add(m.getName());
private void createServiceMethods() { for (JMethod method : source.getInheritableMethods()) { generateMethod(method); } }
private void createServiceMethods() { for (JMethod method : source.getInheritableMethods()) { generateMethod(method); } }
/** * Searches for methods named onBrowserEvent in a {@code type}. */ private static JMethod[] findEventMethods(JClassType type) { List<JMethod> methods = new ArrayList<JMethod>(Arrays.asList(type.getInheritableMethods())); for (Iterator<JMethod> iterator = methods.iterator(); iterator.hasNext();) { JMethod jMethod = iterator.next(); if (!jMethod.getName().equals("onBrowserEvent")) { iterator.remove(); } } return methods.toArray(new JMethod[methods.size()]); }
/** * Finds methods annotated with {@code @UiHandler} in a {@code type}. */ private static JMethod[] findUiHandlerMethods(JClassType type) { ArrayList<JMethod> result = new ArrayList<JMethod>(); JMethod[] allMethods = type.getInheritableMethods(); for (JMethod jMethod : allMethods) { if (jMethod.getAnnotation(UiHandler.class) != null) { result.add(jMethod); } } return result.toArray(new JMethod[result.size()]); }
/** * Finds methods annotated with {@code @UiHandler} in a {@code type}. */ private static JMethod[] findUiHandlerMethods(JClassType type) { ArrayList<JMethod> result = new ArrayList<JMethod>(); JMethod[] allMethods = type.getInheritableMethods(); for (JMethod jMethod : allMethods) { if (jMethod.getAnnotation(UiHandler.class) != null) { result.add(jMethod); } } return result.toArray(new JMethod[result.size()]); }
/** * Searches for methods named onBrowserEvent in a {@code type}. */ private static JMethod[] findEventMethods(JClassType type) { List<JMethod> methods = new ArrayList<JMethod>(Arrays.asList(type.getInheritableMethods())); for (Iterator<JMethod> iterator = methods.iterator(); iterator.hasNext();) { JMethod jMethod = iterator.next(); if (!jMethod.getName().equals("onBrowserEvent")) { iterator.remove(); } } return methods.toArray(new JMethod[methods.size()]); }
/** * Finds methods annotated with {@code @UiHandler} in a {@code type}. */ private static JMethod[] findUiHandlerMethods(JClassType type) { ArrayList<JMethod> result = new ArrayList<JMethod>(); JMethod[] allMethods = type.getInheritableMethods(); for (JMethod jMethod : allMethods) { if (jMethod.getAnnotation(UiHandler.class) != null) { result.add(jMethod); } } return result.toArray(new JMethod[result.size()]); }
/** * Searches for methods named onBrowserEvent in a {@code type}. */ private static JMethod[] findEventMethods(JClassType type) { List<JMethod> methods = new ArrayList<JMethod>(Arrays.asList(type.getInheritableMethods())); for (Iterator<JMethod> iterator = methods.iterator(); iterator.hasNext();) { JMethod jMethod = iterator.next(); if (!jMethod.getName().equals("onBrowserEvent")) { iterator.remove(); } } return methods.toArray(new JMethod[methods.size()]); }
/** * Scan the base class for the getter methods. Assumes getters begin with * "get". See {@link #validateRendererGetters(JClassType)} for a method that * guarantees this method will succeed. */ private static List<JMethod> findGetterNames(JClassType owner) { List<JMethod> ret = new ArrayList<JMethod>(); for (JMethod jMethod : owner.getInheritableMethods()) { String getterName = jMethod.getName(); if (getterName.startsWith("get")) { ret.add(jMethod); } } return ret; }
/** * Finds methods annotated with {@code @UiHandler} in a {@code type}. */ private static JMethod[] findUiHandlerMethods(JClassType type) { ArrayList<JMethod> result = new ArrayList<JMethod>(); JMethod[] allMethods = type.getInheritableMethods(); for (JMethod jMethod : allMethods) { if (jMethod.getAnnotation(UiHandler.class) != null) { result.add(jMethod); } } return result.toArray(new JMethod[result.size()]); }
/** * Searches for methods named onBrowserEvent in a {@code type}. */ private static JMethod[] findEventMethods(JClassType type) { List<JMethod> methods = new ArrayList<JMethod>(Arrays.asList(type.getInheritableMethods())); for (Iterator<JMethod> iterator = methods.iterator(); iterator.hasNext();) { JMethod jMethod = iterator.next(); if (!jMethod.getName().equals("onBrowserEvent")) { iterator.remove(); } } return methods.toArray(new JMethod[methods.size()]); }
/** * Scan the base class for the getter methods. Assumes getters begin with * "get". See {@link #validateRendererGetters(JClassType)} for a method that * guarantees this method will succeed. */ private static List<JMethod> findGetterNames(JClassType owner) { List<JMethod> ret = new ArrayList<JMethod>(); for (JMethod jMethod : owner.getInheritableMethods()) { String getterName = jMethod.getName(); if (getterName.startsWith("get")) { ret.add(jMethod); } } return ret; }
/** * Scan the base class for the getter methods. Assumes getters begin with * "get". See {@link #validateRendererGetters(JClassType)} for a method that * guarantees this method will succeed. */ private static List<JMethod> findGetterNames(JClassType owner) { List<JMethod> ret = new ArrayList<JMethod>(); for (JMethod jMethod : owner.getInheritableMethods()) { String getterName = jMethod.getName(); if (getterName.startsWith("get")) { ret.add(jMethod); } } return ret; }
/** * Scan the base class for the getter methods. Assumes getters begin with * "get". See {@link #validateRendererGetters(JClassType)} for a method that * guarantees this method will succeed. */ private static List<JMethod> findGetterNames(JClassType owner) { List<JMethod> ret = new ArrayList<JMethod>(); for (JMethod jMethod : owner.getInheritableMethods()) { String getterName = jMethod.getName(); if (getterName.startsWith("get")) { ret.add(jMethod); } } return ret; }
/** * Scans a class for a method named "render". Returns its parameters except * for the first one. See {@link #validateRenderParameters(JClassType)} for a * method that guarantees this method will succeed. */ private static JParameter[] findRenderParameters(JClassType owner) { JMethod[] methods = owner.getInheritableMethods(); JMethod renderMethod = null; for (JMethod jMethod : methods) { if (jMethod.getName().equals("render")) { renderMethod = jMethod; } } JParameter[] parameters = renderMethod.getParameters(); return Arrays.copyOfRange(parameters, 1, parameters.length); }
/** * Scans a class for a method named "render". Returns its parameters except * for the first one. See {@link #validateRenderParameters(JClassType)} for a * method that guarantees this method will succeed. */ private static JParameter[] findRenderParameters(JClassType owner) { JMethod[] methods = owner.getInheritableMethods(); JMethod renderMethod = null; for (JMethod jMethod : methods) { if (jMethod.getName().equals("render")) { renderMethod = jMethod; } } JParameter[] parameters = renderMethod.getParameters(); return Arrays.copyOfRange(parameters, 1, parameters.length); }
void writeDoBindEventHandlers(JClassType target, SourceWriter writer, TypeOracle typeOracle) throws UnableToCompleteException { writeBindMethodHeader(writer, target.getQualifiedSourceName()); for (JMethod method : target.getInheritableMethods()) { EventHandler annotation = method.getAnnotation(EventHandler.class); if (annotation != null) { writeHandlerForBindMethod(annotation, writer, method, typeOracle); } } writeBindMethodFooter(writer); }
@Override protected void generate() throws UnableToCompleteException { super.generate(); for (JMethod method : source.getInheritableMethods()) { Annotation[] supportedAnnotations = AnnotationUtils.findSupportedAnnotations(method.getAnnotations()); p(getAnnotationsAsString(supportedAnnotations)); p("void " + method.getName() + "(" + getMethodParameters(method) + getMethodCallback(method) + ");"); } }
@Override protected void generate() throws UnableToCompleteException { super.generate(); for (JMethod method : source.getInheritableMethods()) { Annotation[] supportedAnnotations = AnnotationUtils.findSupportedAnnotations(method.getAnnotations()); p(getAnnotationsAsString(supportedAnnotations)); p("void " + method.getName() + "(" + getMethodParameters(method) + getMethodCallback(method) + ");"); } }