-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced proxy class for the parser to bridge new/old parsing worlds
- Loading branch information
1 parent
2168295
commit 02892cc
Showing
2 changed files
with
29 additions
and
1 deletion.
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
27 changes: 27 additions & 0 deletions
27
ng-appserver/src/main/java/ng/appserver/templating/NGTemplateParserProxy.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,27 @@ | ||
package ng.appserver.templating; | ||
|
||
import java.util.Objects; | ||
|
||
import ng.appserver.NGElement; | ||
|
||
/** | ||
* Serves as a bridge between the "new and old world" for template parsing | ||
*/ | ||
|
||
public class NGTemplateParserProxy { | ||
|
||
private final String _htmlString; | ||
private final String _wodString; | ||
|
||
public NGTemplateParserProxy( String htmlString, String wodString ) { | ||
Objects.requireNonNull( htmlString ); | ||
Objects.requireNonNull( wodString ); | ||
|
||
_htmlString = htmlString; | ||
_wodString = wodString; | ||
} | ||
|
||
public NGElement parse() throws NGDeclarationFormatException, NGHTMLFormatException { | ||
return new NGTemplateParser( _htmlString, _wodString ).parse(); | ||
} | ||
} |