StringTemplateGroupInterface
org.antlr.stringtemplate
Class StringTemplateGroupInterface
java.lang.Object
org.antlr.stringtemplate.StringTemplateGroupInterface
- public class StringTemplateGroupInterface
- extends java.lang.Object
A group interface is like a group without the template implementations;
there are just template names/argument-lists like this:
interface foo;
class(name,fields);
method(name,args,body);
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
protected java.lang.String name
- What is the group name
templates
protected java.util.Map templates
- Maps template name to TemplateDefinition object
superInterface
protected StringTemplateGroupInterface superInterface
- Are we derived from another group? Templates not found in this group
will be searched for in the superGroup recursively.
listener
protected StringTemplateErrorListener listener
- Where to report errors. All string templates in this group
use this error handler by default.
DEFAULT_ERROR_LISTENER
public static StringTemplateErrorListener DEFAULT_ERROR_LISTENER
StringTemplateGroupInterface
public StringTemplateGroupInterface(java.io.Reader r)
StringTemplateGroupInterface
public StringTemplateGroupInterface(java.io.Reader r,
StringTemplateErrorListener errors)
StringTemplateGroupInterface
public StringTemplateGroupInterface(java.io.Reader r,
StringTemplateErrorListener errors,
StringTemplateGroupInterface superInterface)
- Create an interface from the input stream
getSuperInterface
public StringTemplateGroupInterface getSuperInterface()
setSuperInterface
public void setSuperInterface(StringTemplateGroupInterface superInterface)
parseInterface
protected void parseInterface(java.io.Reader r)
defineTemplate
public void defineTemplate(java.lang.String name,
java.util.LinkedHashMap formalArgs,
boolean optional)
getMissingTemplates
public java.util.List getMissingTemplates(StringTemplateGroup group)
- Return a list of all template names missing from group that are defined
in this interface. Return null if all is well.
getMismatchedTemplates
public java.util.List getMismatchedTemplates(StringTemplateGroup group)
- Return a list of all template sigs that are present in the group, but
that have wrong formal argument lists. Return null if all is well.
getName
public java.lang.String getName()
setName
public void setName(java.lang.String name)
error
public void error(java.lang.String msg)
error
public void error(java.lang.String msg,
java.lang.Exception e)
toString
public java.lang.String toString()
getTemplateSignature
protected java.lang.String getTemplateSignature(StringTemplateGroupInterface.TemplateDefinition d)