Create singleton template for use with dictionary values.
(Token templateToken)
| 217 | /** Create singleton template for use with dictionary values. */ |
| 218 | |
| 219 | public ST createSingleton(Token templateToken) { |
| 220 | String template; |
| 221 | if ( templateToken.getType()==GroupParser.BIGSTRING || templateToken.getType()==GroupParser.BIGSTRING_NO_NL ) { |
| 222 | template = Misc.strip(templateToken.getText(), 2); |
| 223 | } |
| 224 | else { |
| 225 | template = Misc.strip(templateToken.getText(), 1); |
| 226 | } |
| 227 | |
| 228 | CompiledST impl = compile(getFileName(), null, null, template, templateToken); |
| 229 | ST st = createStringTemplateInternally(impl); |
| 230 | st.groupThatCreatedThisInstance = this; |
| 231 | st.impl.hasFormalArgs = false; |
| 232 | st.impl.name = ST.UNKNOWN_NAME; |
| 233 | st.impl.defineImplicitlyDefinedTemplates(this); |
| 234 | return st; |
| 235 | } |
| 236 | |
| 237 | /** Is this template defined in this group or from this group below? |
| 238 | * Names must be absolute, fully-qualified names like {@code /a/b}. |
nothing calls this directly
no test coverage detected