Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.antlr.stringtemplate;

A simple loader that looks only in the directory(ies) you specify in the ctor, but it uses the classpath rather than absolute dirs so it can be used when the ST application is jar'd up. You may specify the char encoding.
public class CommonGroupLoader extends PathGroupLoader {

Pass a single dir or multiple dirs separated by colons from which to load groups/interfaces. These are interpreted as relative paths to be used with CLASSPATH to locate groups. E.g., If you pass in "org/antlr/codegen/templates" and ask to load group "foo" it will try to load via classpath as "org/antlr/codegen/templates/foo".

Look in each relative directory for the file called 'name'. Load via classpath.
	protected BufferedReader locate(String namethrows IOException {
		for (int i = 0; i < .size(); i++) {
			String dir = (String.get(i);
			String fileName = dir+"/"+name;
			//System.out.println("trying "+fileName);
			InputStream is = cl.getResourceAsStream(fileName);
			if ( is==null ) {
				cl = this.getClass().getClassLoader();
				is = cl.getResourceAsStream(fileName);
			if ( is!=null ) {
		return null;
New to GrepCode? Check out our FAQ X