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

Method lookupTemplate

output/java8/1.4.13/STGroup.java:247–264  ·  view source on GitHub ↗

Look up a fully-qualified name.

(String name)

Source from the content-addressed store, hash-verified

245 /** Look up a fully-qualified name. */
246
247 public CompiledST lookupTemplate(String name) {
248 if ( name.charAt(0)!='/' ) name = "/"+name;
249 if ( verbose ) System.out.println(getName()+".lookupTemplate("+name+")");
250 CompiledST code = rawGetTemplate(name);
251 if ( code==NOT_FOUND_ST ) {
252 if ( verbose ) System.out.println(name+" previously seen as not found");
253 return null;
254 }
255 // try to load from disk and look up again
256 if ( code==null ) code = load(name);
257 if ( code==null ) code = lookupImportedTemplate(name);
258 if ( code==null ) {
259 if ( verbose ) System.out.println(name+" recorded not found");
260 templates.put(name, NOT_FOUND_ST);
261 }
262 if ( verbose ) if ( code!=null ) System.out.println(getName()+".lookupTemplate("+name+") found");
263 return code;
264 }
265
266 /**
267 * Unload all templates, dictionaries and import relationships, but leave

Callers 5

getInstanceOfMethod · 0.95
isDefinedMethod · 0.95
defineRegionMethod · 0.95
passthruMethod · 0.45

Calls 5

getNameMethod · 0.95
rawGetTemplateMethod · 0.95
loadMethod · 0.95
putMethod · 0.65

Tested by

no test coverage detected