PathGroupLoader
org.antlr.stringtemplate
Class PathGroupLoader
java.lang.Object
org.antlr.stringtemplate.PathGroupLoader
- All Implemented Interfaces:
- StringTemplateGroupLoader
- Direct Known Subclasses:
- CommonGroupLoader
- public class PathGroupLoader
- extends java.lang.Object
- implements StringTemplateGroupLoader
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 |
protected java.util.List |
dirs
List of ':' separated dirs to pull groups from |
protected StringTemplateErrorListener |
errors
|
(package private) java.lang.String |
fileCharEncoding
How are the files encoded (ascii, UTF8, ...)? You might want to read
UTF8 for example on an ascii machine. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dirs
protected java.util.List dirs
- List of ':' separated dirs to pull groups from
errors
protected StringTemplateErrorListener errors
fileCharEncoding
java.lang.String fileCharEncoding
- How are the files encoded (ascii, UTF8, ...)? You might want to read
UTF8 for example on an ascii machine.
PathGroupLoader
public PathGroupLoader(StringTemplateErrorListener errors)
PathGroupLoader
public PathGroupLoader(java.lang.String dirStr,
StringTemplateErrorListener errors)
- Pass a single dir or multiple dirs separated by colons from which
to load groups/interfaces.
loadGroup
public StringTemplateGroup loadGroup(java.lang.String groupName,
java.lang.Class templateLexer,
StringTemplateGroup superGroup)
- Load a group with a specified superGroup. Groups with
region definitions must know their supergroup to find templates
during parsing.
- Specified by:
loadGroup in interface StringTemplateGroupLoader
loadGroup
public StringTemplateGroup loadGroup(java.lang.String groupName,
StringTemplateGroup superGroup)
- Description copied from interface:
StringTemplateGroupLoader
- Load a group with a specified superGroup. Groups with
region definitions must know their supergroup to find templates
during parsing.
- Specified by:
loadGroup in interface StringTemplateGroupLoader
loadGroup
public StringTemplateGroup loadGroup(java.lang.String groupName)
- Description copied from interface:
StringTemplateGroupLoader
- Load the group called groupName from somewhere. Return null
if no group is found.
- Specified by:
loadGroup in interface StringTemplateGroupLoader
loadInterface
public StringTemplateGroupInterface loadInterface(java.lang.String interfaceName)
- Description copied from interface:
StringTemplateGroupLoader
- Load the interface called interfaceName from somewhere. Return null
if no interface is found.
- Specified by:
loadInterface in interface StringTemplateGroupLoader
locate
protected java.io.BufferedReader locate(java.lang.String name)
throws java.io.IOException
- Look in each directory for the file called 'name'.
- Throws:
java.io.IOException
getInputStreamReader
protected java.io.InputStreamReader getInputStreamReader(java.io.InputStream in)
getFileCharEncoding
public java.lang.String getFileCharEncoding()
setFileCharEncoding
public void setFileCharEncoding(java.lang.String fileCharEncoding)
error
public void error(java.lang.String msg)
error
public void error(java.lang.String msg,
java.lang.Exception e)