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)
| 666 | */ |
| 667 | |
| 668 | public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { |
| 669 | GroupLexer lexer = new GroupLexer(templateStream); |
| 670 | CommonTokenStream tokens = new CommonTokenStream(lexer); |
| 671 | GroupParser parser = new GroupParser(tokens); |
| 672 | parser.group = this; |
| 673 | lexer.group = this; |
| 674 | try { |
| 675 | parser.templateDef(prefix); |
| 676 | } |
| 677 | catch (RecognitionException re) { |
| 678 | errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, unqualifiedFileName, re, re.getMessage()); |
| 679 | } |
| 680 | |
| 681 | String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); |
| 682 | if ( prefix!=null && prefix.length()>0 ) templateName = prefix+templateName; |
| 683 | CompiledST impl = rawGetTemplate(templateName); |
| 684 | impl.prefix = prefix; |
| 685 | return impl; |
| 686 | } |
| 687 | |
| 688 | /** |
| 689 | * Add an adaptor for a kind of object so ST knows how to pull properties |
no test coverage detected