public interface ITypeManifold extends IFileConnected, ISelfCompiled
ITypeManifold
is a fundamental component of the Manifold API. Implementors of this interface
work together to dynamically provide the Java compiler with type information as it requests it.
Its primary duties include:
getTypeNames(String)
isType(String)
, isTopLevelType(String)
, and isPackage(String)
contribute(JavaFileManager.Location, String, boolean, String, DiagnosticListener)
IModule
.Modifier and Type | Field and Description |
---|---|
static String |
ARG_DUMP_SOURCE
System property to aid in debugging generated source.
|
Modifier and Type | Method and Description |
---|---|
default boolean |
accept(IModule module)
A module calls this method to determine whether to include this type manifold in its collection of type
manifolds.
|
void |
clear()
Clear all cached data
|
String |
contribute(JavaFileManager.Location location,
String fqn,
boolean genStubs,
String existing,
DiagnosticListener<JavaFileObject> errorHandler)
Contribute source corresponding with the fqn.
|
default void |
enterPostJavaCompilation()
Signals that normal javac compilation is complete with respect to the supplied Java source file list passed
to javac.
|
List<IFile> |
findFilesForType(String fqn) |
Collection<String> |
getAllTypeNames() |
ClassType |
getClassType(String fqn)
What kind of type corresponds with fqn?
|
ContributorKind |
getContributorKind()
How does this producer contribute toward the source file produced
|
IModule |
getModule()
The module to which this producer is scoped
|
String |
getPackage(String fqn)
What is the package name for the specified fqn?
|
ISourceKind |
getSourceKind()
What kind of source is produced? Java?
|
Collection<TypeName> |
getTypeNames(String namespace) |
void |
init(IModule module)
Initialize this type manifold.
|
boolean |
isPackage(String pkg)
Verifies whether or not the specified package may be provided by this source producer
|
boolean |
isTopLevelType(String fqn) |
boolean |
isType(String fqn)
Does this producer supply source for the specified fqn?
|
getTypesForFile, handlesFile, handlesFileExtension, isFileBacked, refreshedFile
compile, isSelfCompile, parse
static final String ARG_DUMP_SOURCE
default boolean accept(IModule module)
IRuntimeManifoldHost
.
Called after instantiation and, if returns true, before init(IModule)
.module
- The module asking for acceptancetrue
If this type manifold should be initialized and included in the module,
otherwise false
to be discarded.void init(IModule module)
module
- The module to which this type manifold exclusively belongsIModule getModule()
ISourceKind getSourceKind()
ContributorKind getContributorKind()
boolean isType(String fqn)
boolean isTopLevelType(String fqn)
boolean isPackage(String pkg)
String contribute(JavaFileManager.Location location, String fqn, boolean genStubs, String existing, DiagnosticListener<JavaFileObject> errorHandler)
Collection<String> getAllTypeNames()
Collection<TypeName> getTypeNames(String namespace)
void clear()
default void enterPostJavaCompilation()
Copyright © 2024. All rights reserved.