org.antlr.stringtemplate
Class StringTemplateGroupInterface

java.lang.Object
  extended by 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);


Field Summary
static StringTemplateErrorListener DEFAULT_ERROR_LISTENER
           
protected  StringTemplateErrorListener listener
          Where to report errors.
protected  java.lang.String name
          What is the group name
protected  StringTemplateGroupInterface superInterface
          Are we derived from another group? Templates not found in this group will be searched for in the superGroup recursively.
protected  java.util.Map templates
          Maps template name to TemplateDefinition object
 
Constructor Summary
StringTemplateGroupInterface(java.io.Reader r)
           
StringTemplateGroupInterface(java.io.Reader r, StringTemplateErrorListener errors)
           
StringTemplateGroupInterface(java.io.Reader r, StringTemplateErrorListener errors, StringTemplateGroupInterface superInterface)
          Create an interface from the input stream
 
Method Summary
 void defineTemplate(java.lang.String name, java.util.LinkedHashMap formalArgs, boolean optional)
           
 void error(java.lang.String msg)
           
 void error(java.lang.String msg, java.lang.Exception e)
           
 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.
 java.util.List getMissingTemplates(StringTemplateGroup group)
          Return a list of all template names missing from group that are defined in this interface.
 java.lang.String getName()
           
 StringTemplateGroupInterface getSuperInterface()
           
protected  java.lang.String getTemplateSignature(org.antlr.stringtemplate.StringTemplateGroupInterface.TemplateDefinition d)
           
protected  void parseInterface(java.io.Reader r)
           
 void setName(java.lang.String name)
           
 void setSuperInterface(StringTemplateGroupInterface superInterface)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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

Method Detail

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()
Overrides:
toString in class java.lang.Object

getTemplateSignature

protected java.lang.String getTemplateSignature(org.antlr.stringtemplate.StringTemplateGroupInterface.TemplateDefinition d)