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