@Test public void process() throws Exception { assertAbout(javaSources()) .that(Arrays.asList(TEST_DEEP_LINK_FRAGMENT, TEST_DEEP_LINK_HANDLER)) .processedWith(new DeepLinkAnnotationCompiler()) .compilesWithoutError() .and() .generatesSources(TEST_DEEP_GENERATED_HANDLER); }
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { System.out.println("[FlowR]: generating deep Link Handler..."); MethodSpec.Builder constructorBuilder = generateConstructor(); for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) { String[] value = element.getAnnotation(DeepLink.class).value(); for (String url : value) { constructorBuilder.addStatement(deeplinkFormat, url, ClassName.get(element.asType())); } } for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class)) { String packageName = processingEnv.getElementUtils().getPackageOf(element) .getQualifiedName().toString(); String className = element.getAnnotation(DeepLinkHandler.class).value(); if (className.isEmpty()) { className = element.getSimpleName().toString() + HANDLER_FILE_NAME_POST_FIX; } generateDeepLinkHandler(packageName, className, constructorBuilder); } return true; }
DeepLinkAnnotationCompiler extends AbstractProcessor { @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { System.out.println("[FlowR]: generating deep Link Handler..."); MethodSpec.Builder constructorBuilder = generateConstructor(); for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) { String[] value = element.getAnnotation(DeepLink.class).value(); for (String url : value) { constructorBuilder.addStatement(deeplinkFormat, url, ClassName.get(element.asType())); } } for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class)) { String packageName = processingEnv.getElementUtils().getPackageOf(element) .getQualifiedName().toString(); String className = element.getAnnotation(DeepLinkHandler.class).value(); if (className.isEmpty()) { className = element.getSimpleName().toString() + HANDLER_FILE_NAME_POST_FIX; } generateDeepLinkHandler(packageName, className, constructorBuilder); } return true; } }
DeepLinkAnnotationCompiler extends AbstractProcessor { @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { System.out.println("[FlowR]: generating deep Link Handler..."); MethodSpec.Builder constructorBuilder = generateConstructor(); for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) { String[] value = element.getAnnotation(DeepLink.class).value(); for (String url : value) { constructorBuilder.addStatement(deeplinkFormat, url, ClassName.get(element.asType())); } } for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class)) { String packageName = processingEnv.getElementUtils().getPackageOf(element) .getQualifiedName().toString(); String className = element.getAnnotation(DeepLinkHandler.class).value(); if (className.isEmpty()) { className = element.getSimpleName().toString() + HANDLER_FILE_NAME_POST_FIX; } generateDeepLinkHandler(packageName, className, constructorBuilder); } return true; }  }
DeepLinkAnnotationCompiler extends AbstractProcessor { @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { System.out.println("[FlowR]: generating deep Link Handler..."); MethodSpec.Builder constructorBuilder = generateConstructor(); for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) { String[] value = element.getAnnotation(DeepLink.class).value(); for (String url : value) { constructorBuilder.addStatement(deeplinkFormat, url, ClassName.get(element.asType())); } } for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class)) { String packageName = processingEnv.getElementUtils().getPackageOf(element) .getQualifiedName().toString(); String className = element.getAnnotation(DeepLinkHandler.class).value(); if (className.isEmpty()) { className = element.getSimpleName().toString() + HANDLER_FILE_NAME_POST_FIX; } generateDeepLinkHandler(packageName, className, constructorBuilder); } return true; }  @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv); }
DeepLinkAnnotationCompiler extends AbstractProcessor { @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { System.out.println("[FlowR]: generating deep Link Handler..."); MethodSpec.Builder constructorBuilder = generateConstructor(); for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) { String[] value = element.getAnnotation(DeepLink.class).value(); for (String url : value) { constructorBuilder.addStatement(deeplinkFormat, url, ClassName.get(element.asType())); } } for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class)) { String packageName = processingEnv.getElementUtils().getPackageOf(element) .getQualifiedName().toString(); String className = element.getAnnotation(DeepLinkHandler.class).value(); if (className.isEmpty()) { className = element.getSimpleName().toString() + HANDLER_FILE_NAME_POST_FIX; } generateDeepLinkHandler(packageName, className, constructorBuilder); } return true; }  @Override boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv);  }