Interface ITypeManifold
- All Superinterfaces:
IFileConnected, ISelfCompiled
- All Known Implementing Classes:
JavaTypeManifold, ResourceFileTypeManifold, UrlTypeManifold
A
Define a domain of types via
Resolve types in that domain via
Contribute source toward a given type projection via
Separate instances of a given implementation of this interface exist per
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property to aid in debugging generated source. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanA module calls this method to determine whether to include this type manifold in its collection of type manifolds.voidclear()Clear all cached datacontribute(JavaFileManager.Location location, String fqn, boolean genStubs, String existing, DiagnosticListener<JavaFileObject> errorHandler) Contribute source corresponding with the fqn.default voidSignals that normal javac compilation is complete with respect to the supplied Java source file list passed to javac.findFilesForType(String fqn) getClassType(String fqn) What kind of type corresponds with fqn?How does this producer contribute toward the source file producedThe module to which this producer is scopedgetPackage(String fqn) What is the package name for the specified fqn?What kind of source is produced?getTypeNames(String namespace) voidInitialize this type manifold.booleanVerifies whether or not the specified package may be provided by this source producerbooleanisTopLevelType(String fqn) booleanDoes this producer supply source for the specified fqn?Methods inherited from interface IFileConnected
getTypesForFile, handlesFile, handlesFileExtension, isFileBacked, refreshedFileMethods inherited from interface ISelfCompiled
compile, isSelfCompile, parse
-
Field Details
-
ARG_DUMP_SOURCE
-
-
Method Details
-
accept
A module calls this method to determine whether to include this type manifold in its collection of type manifolds. Gives this type manifold an opportunity to opt out of inclusion based on the module. For instance, if a module should only operate in a runtime environment, it should return false if the module's host is not an instance ofIRuntimeManifoldHost. Called after instantiation and, if returns true, beforeinit(IModule).- Parameters:
module- The module asking for acceptance- Returns:
trueIf this type manifold should be initialized and included in the module, otherwisefalseto be discarded.
-
init
Initialize this type manifold. Avoid defining types in the scope of this method.- Parameters:
module- The module to which this type manifold exclusively belongs
-
getModule
IModule getModule()The module to which this producer is scoped -
getSourceKind
ISourceKind getSourceKind()What kind of source is produced? Java? -
getContributorKind
ContributorKind getContributorKind()How does this producer contribute toward the source file produced -
isType
Does this producer supply source for the specified fqn? -
isTopLevelType
-
isPackage
Verifies whether or not the specified package may be provided by this source producer -
getClassType
-
getPackage
-
contribute
String contribute(JavaFileManager.Location location, String fqn, boolean genStubs, String existing, DiagnosticListener<JavaFileObject> errorHandler) Contribute source corresponding with the fqn. -
getAllTypeNames
Collection<String> getAllTypeNames() -
getTypeNames
-
findFilesForType
-
clear
void clear()Clear all cached data -
enterPostJavaCompilation
default void enterPostJavaCompilation()Signals that normal javac compilation is complete with respect to the supplied Java source file list passed to javac. Any "other" source files passed in (via other.source.files property using -Akey=value arg) are about to be compiled. This method was added to facilitate a self-compiled type manifold such as Gosu where it can reliably depend on Java ClassSymbols to be complete from the JavacPlugin's javacTask. This in turn enables the sharing of these symbols so the type manifold doesn't have to load a second javacTask and potentially duplicate expensive work.
-