final class AbstractMethodExtractor
extends java.lang.Object
EclipseHack
that examines classes to extract just
the abstract methods. The parsing is very superficial. It assumes that the source text is
syntactically correct, which it must be in the context of an annotation processor because the
compiler doesn't invoke the processor if there are syntax errors.
We recognize the text ... class Foo ... { ... }
as a class called Foo, whose
definition extends to the matching right brace. Within a class definition, we recognize the text
abstract ... bar ( )
as an abstract method called bar. We also recognize ...
interface Foo ... { ... }
so that we can discover @AutoValue
classes that are nested
in an interface.
We construct a Map<String, List<String>>
that represents the abstract methods found in
each class, in the order they were found. If com.example.Foo contains a nested class Bar, then
there will be an entry for "com.example.Foo.Bar" in this Map.
Constructor and Description |
---|
AbstractMethodExtractor() |
Modifier and Type | Method and Description |
---|---|
(package private) com.google.common.collect.ImmutableListMultimap<java.lang.String,java.lang.String> |
abstractMethods(EclipseHackTokenizer tokenizer,
java.lang.String packageName) |
com.google.common.collect.ImmutableListMultimap<java.lang.String,java.lang.String> abstractMethods(EclipseHackTokenizer tokenizer, java.lang.String packageName)