Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from LorenzoBettini/task_150-Interpreter_Prov…
…ider Task 150 interpreter provider
- Loading branch information
Showing
3 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
edelta.parent/edelta/src/edelta/interpreter/EdeltaInterpreterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* | ||
*/ | ||
package edelta.interpreter; | ||
|
||
import org.eclipse.emf.ecore.resource.Resource; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Provider; | ||
|
||
import edelta.interpreter.internal.EdeltaInterpreterConfigurator; | ||
|
||
/** | ||
* Creates an {@link IEdeltaInterpreter} and configures it with | ||
* {@link EdeltaInterpreterConfigurator}. | ||
* | ||
* @author Lorenzo Bettini | ||
* | ||
*/ | ||
public class EdeltaInterpreterFactory { | ||
|
||
@Inject | ||
private Provider<IEdeltaInterpreter> provider; | ||
|
||
@Inject | ||
private EdeltaInterpreterConfigurator configurator; | ||
|
||
public IEdeltaInterpreter create(Resource resource) { | ||
IEdeltaInterpreter interpreter = provider.get(); | ||
configurator.configureInterpreter(interpreter, resource); | ||
return interpreter; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters