GWTMethod(final TypeOracle oracle, final JMethod method) { this.method = method; this.annotations = method.getAnnotations(); this.oracle = oracle; }
GWTMethod(final TypeOracle oracle, final JMethod method) { this.method = method; this.annotations = method.getAnnotations(); this.oracle = oracle; }
private static void extractMethods(TreeLogger logger, KeepMethod keepMethod, JClassType injectionType, ReflectionManifest manifest) { boolean keepMethods = keepMethod != null; boolean keepAnnos = manifest.anno != null; Set<String> seen = new HashSet<String>(); Set<? extends JClassType> allTypes = injectionType.getFlattenedSupertypeHierarchy(); for(JClassType nextClass : allTypes) { for (JMethod method : nextClass.getMethods()) { if (keepMethods || method.getAnnotation(KeepMethod.class) != null){ // do not include overridden methods if (seen.add(method.getJsniSignature())) { final Annotation[] annos; if (keepAnnos || method.getAnnotation(KeepAnnotation.class) != null) { annos = method.getAnnotations(); } else { // only keep annotations annotated with KeepAnnotation. final List<Annotation> keepers = new ArrayList<Annotation>(); for (Annotation anno : method.getAnnotations()) { if (anno.annotationType().getAnnotation(KeepAnnotation.class) != null) keepers.add(anno); } annos = keepers.toArray(new Annotation[keepers.size()]); } manifest.methods.put(method, annos); } } } nextClass = nextClass.getSuperclass(); } }
@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) + ");"); } }
String restMethod = null; Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);
@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) + ");"); } }
String restMethod = null; Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { HttpMethod httpMethod = annotation.annotationType().getAnnotation(HttpMethod.class);