| Modifier and Type | Class and Description |
|---|---|
| public static class | StringTemplate.
An automatically created aggregate of properties. |
| public static class | StringTemplate.
Just an alias for ArrayList, but this way I can track whether a list is something ST created or it's an incoming list. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| protected Map | argumentContext
If this template is an embedded template such as when you apply a template to an attribute, then the arguments passed to this template represent the argument context--a set of values computed by walking the argument assignment list. |
| protected StringTemplateAST | argumentsAST
If this template is embedded in another template, the arguments must be evaluated just before each application when applying template to a list of values. |
| protected Map | attributeRenderers
A Map<class,object> that allows people to register a renderer for a particular kind of object to be displayed in this template. |
| protected Map | attributes
Map an attribute name to its value(s). |
| protected List | chunks
A list of alternating string and ASTExpr references. |
| public static StringTemplateGroup | |
| protected StringTemplate | enclosingInstance
Enclosing instance if I'm embedded within another template. |
| protected LinkedHashMap | formalArguments
When templates are defined in a group file format, the attribute list is provided including information about attribute cardinality such as present, optional, ... |
| protected StringTemplateGroup | group
This template was created as part of what group? |
| protected int | groupFileLine
If this template is defined within a group file, what line number? |
| protected boolean | isRegion
Does this template come from a <@region>... |
| pack-priv static boolean | lintMode
track probable issues like setting attribute that is not referenced. |
| pack-priv StringTemplateErrorListener | listener
Where to report errors |
| protected String | name
What's the name of this template? |
| protected StringTemplateGroup | nativeGroup
What group originally defined the prototype for this template? |
| protected int | numberOfDefaultArgumentValues
How many formal arguments to this template have default values specified? |
| protected boolean | passThroughAttributes
Normally, formal parameters hide any attributes inherited from the enclosing template with the same name. |
| protected String | pattern
The original, immutable pattern/language (not really used again after initial "compilation", setup/parsing). |
| protected List | |
| public static final int | REGION_EMBEDDED
<@r>... |
| public static final int | REGION_EXPLICIT
@t.r() ::= "..." defined manually by coder |
| public static final int | REGION_IMPLICIT
<@r()> |
| protected int | regionDefType
If someone refs <@r()> in template t, an implicit @t.r() ::= "" is defined, but you can overwrite this def by defining your own. |
| protected Set | regions
Set of implicit and embedded regions for this template |
| private static int | |
| protected int | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | StringTemplate(StringTemplateGroup group, String template)
Create an anonymous template with no name, but with a group |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected void | breakTemplateIntoChunks()
Walk a template, breaking it into a list of chunks: Strings and actions/expressions. |
| protected void | |
| protected void | checkNullAttributeAgainstFormalArguments(StringTemplate self, String attribute)
A reference to an attribute with no value, must be compared against the formal parameter to see if it exists; if it exists all is well, but if not, throw an exception. |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | dup(StringTemplate from, StringTemplate to)
Make the 'to' template look exactly like the 'from' template except for the attributes. |
| public void | |
| public void | |
| public Object | |
| public Map | |
| public StringTemplateAST | |
| public Object | |
| public AttributeRenderer | getAttributeRenderer(Class<T> attributeClassType)
What renderer is registered for this attributeClassType for this template. |
| public Map | |
| public List | |
| public void | getDependencyGraph(Map<K, V> edges, boolean showAttributes)
Get a list of n->m edges where template n contains template m. |
| public StringTemplate | getDOTForDependencyGraph(boolean showAttributes)
Generate a DOT file for displaying the template enclosure graph; e.g., digraph prof { "t1" -> "t2" "t1" -> "t3" "t4" -> "t5" } |
| public StringTemplate | |
| public String | getEnclosingInstanceStackString()
If an instance of x is enclosed in a y which is in a z, return a String of these instance names in order from topmost to lowest; here that would be "[z y x]". |
| public String | |
| public StringTemplateErrorListener | |
| public FormalArgument | |
| public Map | |
| public StringTemplateGroup | |
| public int | |
| public StringTemplate | getInstanceOf()
Make an instance of this template; it contains an exact copy of everything (except the attributes and enclosing instance pointer). |
| public String | |
| public StringTemplateGroup | |
| private static synchronized int | |
| public StringTemplate | |
| public String | |
| public int | |
| public String | |
| public String | |
| protected String | |
| public int | |
| public static boolean | |
| public static boolean | isRecursiveEnclosingInstance(StringTemplate st)
Look up the enclosing instance chain (and include this) to see if st is a template already in the enclosing instance chain. |
| public boolean | |
| public FormalArgument | lookupFormalArgument(String name)
From this template upward in the enclosing template tree, recursively look for the formal parameter. |
| public ASTExpr | |
| protected String | parseAggregateAttributeSpec(String aggrSpec, List<E> properties)
Split "aggrName.{propName1,propName2}" into list [propName1,propName2] and the aggrName. |
| public void | |
| protected void | putToMultiValuedMap(Map<K, V> map, Object key, Object value)
Manage a hash table like it has multiple unique values. |
| public void | rawSetArgumentAttribute(StringTemplate embedded, Map<K, V> attributes, String name, Object value)
Argument evaluation such as foo(x=y), x must be checked against foo's argument list not this's (which is the enclosing context). |
| protected void | |
| public void | registerRenderer(Class<T> attributeClassType, AttributeRenderer renderer)
Register a renderer for all objects of a particular type. |
| public void | |
| public void | |
| public static void | resetTemplateCounter()
reset the template ID counter to 0; public so that testing routine can access but not really of interest to the user. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | setAttribute(String aggrSpec, Object[] values)
Create an aggregate from the list of properties in aggrSpec and fill with values from values array. |
| public void | setAttributeRenderers(Map<K, V> renderers)
Specify a complete map of what object classes should map to which renderer objects. |
| public void | |
| public void | setDefaultArgumentValues()
Set any default argument values that were not set by the invoking template or by setAttribute directly. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public static void | |
| public void | |
| public void | |
| public void | setPassThroughAttributes(boolean passThroughAttributes)
Normally if you call template y from x, y cannot see any attributes of x that are defined as formal parameters of y. |
| public void | |
| public void | |
| public void | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | |
| protected void | |
| public void | |
| public int | write(StringTemplateWriter out)
Walk the chunks, asking them to write themselves out according to attribute values of 'this.attributes'. |