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