-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add factory for the jinjavaInterpret
Now every time we create another instance of jinjavaInterpreter we could use factory If you need to use extended interpreter you could create your own factory
- Loading branch information
Igor Ruban
committed
Jul 11, 2019
1 parent
f03e327
commit 8cb3c7f
Showing
7 changed files
with
54 additions
and
12 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); | ||
} |
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
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