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