MCPcopy Create free account
hub / github.com/antlr/codebuff / createSingleton

Method createSingleton

output/java/1.4.12/STGroup.java:220–236  ·  view source on GitHub ↗

Create singleton template for use with dictionary values.

(Token templateToken)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

stripMethod · 0.95
compileMethod · 0.95
getFileNameMethod · 0.95
getTextMethod · 0.65
getTypeMethod · 0.45

Tested by

no test coverage detected