Top Description Fields Constructors Methods
org.antlr.stringtemplate

public Class PathGroupLoader

extends Object
implements StringTemplateGroupLoader
Class Inheritance
All Implemented Interfaces
org.antlr.stringtemplate.StringTemplateGroupLoader
Known Direct Subclasses
org.antlr.stringtemplate.CommonGroupLoader
Imports
org.antlr.stringtemplate.language.AngleBracketTemplateLexer, java.io.*, java.util.ArrayList, .List, .StringTokenizer

A brain dead loader that looks only in the directory(ies) you specify in the ctor. You may specify the char encoding.

Note

this does not work when you jar things up! Use CommonGroupLoader instead in that case

Field Summary

Modifier and TypeField and Description
protected List<E>
dirs

List of ':' separated dirs to pull groups from

protected StringTemplateErrorListener
pack-priv String
fileCharEncoding

How are the files encoded (ascii, UTF8, ...)?

Constructor Summary

AccessConstructor and Description
public
public
PathGroupLoader(String dirStr, StringTemplateErrorListener errors)

Pass a single dir or multiple dirs separated by colons from which to load groups/interfaces.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public String
protected InputStreamReader
public StringTemplateGroup
loadGroup(String groupName, Class<T> templateLexer, StringTemplateGroup superGroup)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load a group with a specified superGroup.
public StringTemplateGroup
loadGroup(String groupName, StringTemplateGroup superGroup)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load a group with a specified superGroup.
public StringTemplateGroup
loadGroup(String groupName)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load the group called groupName from somewhere.
public StringTemplateGroupInterface
loadInterface(String interfaceName)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadInterface.

Load the interface called interfaceName from somewhere.
protected BufferedReader
locate(String name)

Look in each directory for the file called 'name'.

public void
setFileCharEncoding(String fileCharEncoding)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dirsback to summary
protected List<E> dirs

List of ':' separated dirs to pull groups from

errorsback to summary
protected StringTemplateErrorListener errors
fileCharEncodingback to summary
pack-priv String fileCharEncoding

How are the files encoded (ascii, UTF8, ...)? You might want to read UTF8 for example on an ascii machine.

Constructor Detail

PathGroupLoaderback to summary
public PathGroupLoader(StringTemplateErrorListener errors)
PathGroupLoaderback to summary
public PathGroupLoader(String dirStr, StringTemplateErrorListener errors)

Pass a single dir or multiple dirs separated by colons from which to load groups/interfaces.

Method Detail

errorback to summary
public void error(String msg)
errorback to summary
public void error(String msg, Exception e)
getFileCharEncodingback to summary
public String getFileCharEncoding()
getInputStreamReaderback to summary
protected InputStreamReader getInputStreamReader(InputStream in)
loadGroupback to summary
public StringTemplateGroup loadGroup(String groupName, Class<T> templateLexer, StringTemplateGroup superGroup)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load a group with a specified superGroup. Groups with region definitions must know their supergroup to find templates during parsing.

loadGroupback to summary
public StringTemplateGroup loadGroup(String groupName, StringTemplateGroup superGroup)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Doc from org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load a group with a specified superGroup. Groups with region definitions must know their supergroup to find templates during parsing.

loadGroupback to summary
public StringTemplateGroup loadGroup(String groupName)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Doc from org.antlr.stringtemplate.StringTemplateGroupLoader.loadGroup.

Load the group called groupName from somewhere. Return null if no group is found.

loadInterfaceback to summary
public StringTemplateGroupInterface loadInterface(String interfaceName)

Implements org.antlr.stringtemplate.StringTemplateGroupLoader.loadInterface.

Doc from org.antlr.stringtemplate.StringTemplateGroupLoader.loadInterface.

Load the interface called interfaceName from somewhere. Return null if no interface is found.

locateback to summary
protected BufferedReader locate(String name) throws IOException

Look in each directory for the file called 'name'.

setFileCharEncodingback to summary
public void setFileCharEncoding(String fileCharEncoding)