MCPcopy Index your code
hub / github.com/antlr/codebuff / createSingleton

Method createSingleton

output/java8/1.4.14/STGroup.java:219–235  ·  view source on GitHub ↗

Create singleton template for use with dictionary values.

(Token templateToken)

Source from the content-addressed store, hash-verified

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}.

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