Load template stream into this group. unqualifiedFileName is "a.st". The prefix is path from group root to unqualifiedFileName like "/subdir" if file is in /subdir/a.st.
(String prefix, String unqualifiedFileName, CharStream templateStream)
| 644 | */ |
| 645 | |
| 646 | public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { |
| 647 | GroupLexer lexer = new GroupLexer(templateStream); |
| 648 | CommonTokenStream tokens = new CommonTokenStream(lexer); |
| 649 | GroupParser parser = new GroupParser(tokens); |
| 650 | parser.group = this; |
| 651 | lexer.group = this; |
| 652 | try { |
| 653 | parser.templateDef(prefix); |
| 654 | } |
| 655 | catch (RecognitionException re) { |
| 656 | errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, unqualifiedFileName, re, re.getMessage()); |
| 657 | } |
| 658 | |
| 659 | String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); |
| 660 | if ( prefix!=null && prefix.length()>0 ) templateName = prefix+templateName; |
| 661 | CompiledST impl = rawGetTemplate(templateName); |
| 662 | impl.prefix = prefix; |
| 663 | return impl; |
| 664 | } |
| 665 | |
| 666 | /** |
| 667 | * Add an adaptor for a kind of object so ST knows how to pull properties |
no test coverage detected