Home | News | Wiki | About StringTemplate | Feedback | Support | Bugs


Latest version is 3.2.
Download now! »

Download
» Home
» Download
» News
»Using StringTemplate
» Documentation
» Wiki
» Articles
» File Sharing
» Code API
» Tech Support
»About StringTemplate
» What is it?
» Showcase
» Testimonials
» Software License
» Changes
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



CommonGroupLoader


org.antlr.stringtemplate
Class CommonGroupLoader

java.lang.Object
  extended byorg.antlr.stringtemplate.PathGroupLoader
      extended byorg.antlr.stringtemplate.CommonGroupLoader
All Implemented Interfaces:
StringTemplateGroupLoader

public class CommonGroupLoader
extends PathGroupLoader

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.


Field Summary
 
Fields inherited from class org.antlr.stringtemplate.PathGroupLoader
dirs, errors, fileCharEncoding
 
Constructor Summary
CommonGroupLoader(java.lang.String dirStr, StringTemplateErrorListener errors)
          Pass a single dir or multiple dirs separated by colons from which to load groups/interfaces.
CommonGroupLoader(StringTemplateErrorListener errors)
           
 
Method Summary
protected  java.io.BufferedReader locate(java.lang.String name)
          Look in each relative directory for the file called 'name'.
 
Methods inherited from class org.antlr.stringtemplate.PathGroupLoader
error, error, getFileCharEncoding, getInputStreamReader, loadGroup, loadGroup, loadGroup, loadInterface, setFileCharEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonGroupLoader

public CommonGroupLoader(StringTemplateErrorListener errors)

CommonGroupLoader

public CommonGroupLoader(java.lang.String dirStr,
                         StringTemplateErrorListener errors)
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".

Method Detail

locate

protected java.io.BufferedReader locate(java.lang.String name)
                                 throws java.io.IOException
Look in each relative directory for the file called 'name'. Load via classpath.

Overrides:
locate in class PathGroupLoader
Throws:
java.io.IOException