Source:
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Class<DeepLink> deepLinkClass = DeepLink.class; for (Element element : roundEnv.getElementsAnnotatedWith(deepLinkClass)) { ElementKind kind = element.getKind(); if (kind != ElementKind.METHOD && kind != ElementKind.CLASS) { error(element, "Only classes and methods can be annotated with @%s", deepLinkClass.getSimpleName()); } if (kind == ElementKind.METHOD) { Set<Modifier> methodModifiers = element.getModifiers(); if (!methodModifiers.contains(Modifier.STATIC)) { error(element, "Only static methods can be annotated with @%s", deepLinkClass.getSimpleName()); } } String[] deepLinks = element.getAnnotation(deepLinkClass).value(); DeepLinkEntry.Type type = kind == ElementKind.CLASS ? DeepLinkEntry.Type.CLASS : DeepLinkEntry.Type.METHOD; for (String deepLink : deepLinks) { try { deepLinkElements.add(new DeepLinkAnnotatedElement(deepLink, element, type)); } catch (MalformedURLException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Malformed Deep Link URL " + deepLink); } } } boolean hasSpecifiedDeepLinkActivity = !roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class).isEmpty(); if (!deepLinkElements.isEmpty()) { String packageName = deepLinkElements.get(0).getPackageName(); try { generateDeepLinkResult(packageName); generateDeepLinkLoader(packageName, deepLinkElements); generateDeepLinkDelegate(packageName); if (!hasSpecifiedDeepLinkActivity) { generateDeepLinkActivity(packageName); } } catch (IOException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Error creating file"); } catch (RuntimeException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Internal error during annotation processing: " + e.getClass().getSimpleName()); } } return true; }

Target:
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Class<DeepLink> deepLinkClass = DeepLink.class; for (Element element : roundEnv.getElementsAnnotatedWith(deepLinkClass)) { ElementKind kind = element.getKind(); if (kind != ElementKind.METHOD && kind != ElementKind.CLASS) { error(element, "Only classes and methods can be annotated with @%s", deepLinkClass.getSimpleName()); } if (kind == ElementKind.METHOD) { Set<Modifier> methodModifiers = element.getModifiers(); if (!methodModifiers.contains(Modifier.STATIC)) { error(element, "Only static methods can be annotated with @%s", deepLinkClass.getSimpleName()); } } String[] deepLinks = element.getAnnotation(deepLinkClass).value(); DeepLinkEntry.Type type = kind == ElementKind.CLASS ? DeepLinkEntry.Type.CLASS : DeepLinkEntry.Type.METHOD; for (String deepLink : deepLinks) { try { deepLinkElements.add(new DeepLinkAnnotatedElement(deepLink, element, type)); } catch (MalformedURLException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Malformed Deep Link URL " + deepLink); } } } boolean hasSpecifiedDeepLinkActivity = !roundEnv.getElementsAnnotatedWith(DeepLinkHandler.class).isEmpty(); if (!deepLinkElements.isEmpty()) { String packageName = processingEnv.getElementUtils().getPackageOf( deepLinkElements.get(0).getAnnotatedElement()).getQualifiedName().toString(); try { generateDeepLinkResult(packageName); generateDeepLinkLoader(packageName, deepLinkElements); generateDeepLinkDelegate(packageName); if (!hasSpecifiedDeepLinkActivity) { generateDeepLinkActivity(packageName); } } catch (IOException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Error creating file"); } catch (RuntimeException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Internal error during annotation processing: " + e.getClass().getSimpleName()); } } return true; }