Top Description Inners Fields Constructors Methods
org.antlr.stringtemplate

public Class StringTemplateGroupInterface

extends Object
Class Inheritance
Imports
org.antlr.stringtemplate.language.*, java.util.*, java.io.Reader

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);

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
StringTemplateGroupInterface.TemplateDefinition

All the info we need to track for a template defined in an interface

Field Summary

Modifier and TypeField and Description
public static StringTemplateErrorListener
protected StringTemplateErrorListener
listener

Where to report errors.

protected String
name

What is the group name

protected StringTemplateGroupInterface
superInterface

Are we derived from another group?

protected Map<K, V>
templates

Maps template name to TemplateDefinition object

Constructor Summary

AccessConstructor and Description
public
public
public
StringTemplateGroupInterface(Reader r, StringTemplateErrorListener errors, StringTemplateGroupInterface superInterface)

Create an interface from the input stream

Method Summary

Modifier and TypeMethod and Description
public void
defineTemplate(String name, LinkedHashMap<K, V> formalArgs, boolean optional)

public void
public void
public List<E>
getMismatchedTemplates(StringTemplateGroup group)

Return a list of all template sigs that are present in the group, but that have wrong formal argument lists.

public List<E>
getMissingTemplates(StringTemplateGroup group)

Return a list of all template names missing from group that are defined in this interface.

public String
public StringTemplateGroupInterface
protected String
protected void
public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_ERROR_LISTENERback to summary
public static StringTemplateErrorListener DEFAULT_ERROR_LISTENER
listenerback to summary
protected StringTemplateErrorListener listener

Where to report errors. All string templates in this group use this error handler by default.

nameback to summary
protected String name

What is the group name

superInterfaceback to summary
protected StringTemplateGroupInterface superInterface

Are we derived from another group? Templates not found in this group will be searched for in the superGroup recursively.

templatesback to summary
protected Map<K, V> templates

Maps template name to TemplateDefinition object

Constructor Detail

StringTemplateGroupInterfaceback to summary
public StringTemplateGroupInterface(Reader r)
StringTemplateGroupInterfaceback to summary
public StringTemplateGroupInterface(Reader r, StringTemplateErrorListener errors)
StringTemplateGroupInterfaceback to summary
public StringTemplateGroupInterface(Reader r, StringTemplateErrorListener errors, StringTemplateGroupInterface superInterface)

Create an interface from the input stream

Method Detail

defineTemplateback to summary
public void defineTemplate(String name, LinkedHashMap<K, V> formalArgs, boolean optional)
errorback to summary
public void error(String msg)
errorback to summary
public void error(String msg, Exception e)
getMismatchedTemplatesback to summary
public List<E> 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.

getMissingTemplatesback to summary
public List<E> 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.

getNameback to summary
public String getName()
getSuperInterfaceback to summary
public StringTemplateGroupInterface getSuperInterface()
getTemplateSignatureback to summary
protected String getTemplateSignature(StringTemplateGroupInterface.TemplateDefinition d)
parseInterfaceback to summary
protected void parseInterface(Reader r)
setNameback to summary
public void setName(String name)
setSuperInterfaceback to summary
public void setSuperInterface(StringTemplateGroupInterface superInterface)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

org.antlr.stringtemplate back to summary

pack-priv Class StringTemplateGroupInterface.TemplateDefinition

extends Object
Class Inheritance
  • java.lang.Object
  • org.antlr.stringtemplate.StringTemplateGroupInterface.TemplateDefinition

All the info we need to track for a template defined in an interface

Field Summary

Modifier and TypeField and Description
public LinkedHashMap<K, V>
public String
public boolean

Constructor Summary

AccessConstructor and Description
public
TemplateDefinition(String name, LinkedHashMap<K, V> formalArgs, boolean optional)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formalArgsback to summary
public LinkedHashMap<K, V> formalArgs
nameback to summary
public String name
optionalback to summary
public boolean optional

Constructor Detail

TemplateDefinitionback to summary
public TemplateDefinition(String name, LinkedHashMap<K, V> formalArgs, boolean optional)