Rework Java import tracking
In order to get nested class imports working, we need a proper
layer which understands how references inside Java code are
looked up.
Introduce AbstractJavaGeneratedType, which creates a tree structure
of how the class is layed out, thus it knows which types are declared
in a particular type's scope. There are two implementions:
- TopLevelJavaGeneratedType, which is responsible for managing what
is imported into the compilation unit
- NestedJavaGeneratedType, which does not know about imports per se
and delegates decisions to its containing type
Templates are updated to properly hook into the type hierarchy, so
their requests for type resolution are properly scoped.
One remaining wrinkle is BuilderTemplate, which abuses the template
system by using its built type as its type. This is worked around
in this patch and will need to be cleaned up later.
JIRA: MDSAL-327
Change-Id: Ie66a93ba85be26b056f118ba9fe14195e8d5a8ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jie Han <han.jie@zte.com.cn>
17 files changed: