-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interpreter factory to be able to use extended interpreters
- Loading branch information
Igor Ruban
committed
Jul 11, 2019
1 parent
766c29d
commit 1f68b2c
Showing
6 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/hubspot/jinjava/interpret/InterpreterFactory.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,9 @@ | ||
package com.hubspot.jinjava.interpret; | ||
|
||
import com.hubspot.jinjava.Jinjava; | ||
import com.hubspot.jinjava.JinjavaConfig; | ||
|
||
public interface InterpreterFactory { | ||
JinjavaInterpreter newInstance(JinjavaInterpreter orig); | ||
JinjavaInterpreter newInstance(Jinjava application, Context context, JinjavaConfig renderConfig); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreterFactory.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,17 @@ | ||
package com.hubspot.jinjava.interpret; | ||
|
||
import com.hubspot.jinjava.Jinjava; | ||
import com.hubspot.jinjava.JinjavaConfig; | ||
|
||
public class JinjavaInterpreterFactory implements InterpreterFactory { | ||
@Override | ||
public JinjavaInterpreter newInstance(JinjavaInterpreter orig) { | ||
return new JinjavaInterpreter(orig); | ||
} | ||
|
||
@Override | ||
public JinjavaInterpreter newInstance(Jinjava application, Context context, JinjavaConfig renderConfig) { | ||
return new JinjavaInterpreter(application, context, renderConfig); | ||
} | ||
} | ||
|
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