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

Method lookupTemplate

output/java/1.4.19/STGroup.java:248–265  ·  view source on GitHub ↗

Look up a fully-qualified name.

(String name)

Source from the content-addressed store, hash-verified

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