public interface IGenerator2
IGenerator
that adds support for parallel code generation.
Clients of IGenerator
that want to perform the code generation in the background will check for this
extension interface and use beforeGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
to prepare the resource set. That
is, implementors may alter the state of the resource set in the before hook. This may happen implicitly by resolving
proxies or explicitly by loading new resources into the resource set. No changes are allowed while
doGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
is executed since this may be parallelized by the caller. The
afterGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
is used to cleanup state. Also access to the file system is
guaranteed to be synchronous in the before and after hook.Modifier and Type | Method and Description |
---|---|
void |
afterGenerate(org.eclipse.emf.ecore.resource.Resource input,
IFileSystemAccess2 fsa,
IGeneratorContext context)
Release any data that is no longer necessary after the generator ran.
|
void |
beforeGenerate(org.eclipse.emf.ecore.resource.Resource input,
IFileSystemAccess2 fsa,
IGeneratorContext context)
Before the generation is triggered, the resource or the entire resource set
may be prepared such that no modification will happen while
doGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
is executed. |
void |
doGenerate(org.eclipse.emf.ecore.resource.Resource input,
IFileSystemAccess2 fsa,
IGeneratorContext context)
Perform the code generation for the given input resource.
|
void doGenerate(org.eclipse.emf.ecore.resource.Resource input, IFileSystemAccess2 fsa, IGeneratorContext context)
void beforeGenerate(org.eclipse.emf.ecore.resource.Resource input, IFileSystemAccess2 fsa, IGeneratorContext context)
doGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
is executed.void afterGenerate(org.eclipse.emf.ecore.resource.Resource input, IFileSystemAccess2 fsa, IGeneratorContext context)
beforeGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
was called.
It may be called several times. It may be called even if beforeGenerate(Resource, IFileSystemAccess2, IGeneratorContext)
was not called.