org.antlr.stringtemplate.language
Class FormalArgument

java.lang.Object
  extended byorg.antlr.stringtemplate.language.FormalArgument

public class FormalArgument
extends java.lang.Object

Represents the name of a formal argument defined in a template: group test; test(a,b) : "$a$ $b$" t() : "blort" Each template has a set of these formal arguments or uses a placeholder object: UNKNOWN (indicating that no arguments were specified such as when a template is loaded from a file.st). Note: originally, I tracked cardinality as well as the name of an attribute. I'm leaving the code here as I suspect something may come of it later. Currently, though, cardinality is not used.


Field Summary
static int ONE_OR_MORE
           
static int OPTIONAL
           
static int REQUIRED
           
static java.lang.String[] suffixes
           
static java.util.Map UNKNOWN
          When template arguments are not available such as when the user uses "new StringTemplate(...)", then the list of formal arguments must be distinguished from the case where a template can specify args and there just aren't any such as the t() template above.
static int ZERO_OR_MORE
           
 
Constructor Summary
FormalArgument(java.lang.String name)
           
 
Method Summary
static java.lang.String getCardinalityName(int cardinality)
           
 java.lang.String getName()
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPTIONAL

public static final int OPTIONAL
See Also:
Constant Field Values

REQUIRED

public static final int REQUIRED
See Also:
Constant Field Values

ZERO_OR_MORE

public static final int ZERO_OR_MORE
See Also:
Constant Field Values

ONE_OR_MORE

public static final int ONE_OR_MORE
See Also:
Constant Field Values

suffixes

public static final java.lang.String[] suffixes

UNKNOWN

public static java.util.Map UNKNOWN
When template arguments are not available such as when the user uses "new StringTemplate(...)", then the list of formal arguments must be distinguished from the case where a template can specify args and there just aren't any such as the t() template above.

Constructor Detail

FormalArgument

public FormalArgument(java.lang.String name)
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getCardinalityName

public static java.lang.String getCardinalityName(int cardinality)

toString

public java.lang.String toString()