To use templates, you create one (usually via STGroup) and then inject
attributes using add. To render its attacks, use ST#render().
Todo
ST#locals is not actually a hash table like the documentation
says.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ST.
Just an alias for |
| public static class | ST.
Events during template hierarchy construction (not evaluation) |
| public static enum | ST.
|
| Modifier and Type | Field and Description |
|---|---|
| public ST. | debugState
If |
| public static final Object | |
| public STGroup | groupThatCreatedThisInstance
Created as instance of which group? |
| public CompiledST | impl
The implementation for this template among all instances of same template . |
| public static final String | IMPLICIT_ARG_NAME
When there are no formal args for template t and you map t across some values, t implicitly gets arg "it". |
| protected Object[] | |
| public static final String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | ST(String template, char delimiterStartChar, char delimiterStopChar)
Create ST using non-default delimiters; each one of these will live
in it's own group since you're overriding a default; don't want to
alter |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized ST | |
| public synchronized ST | |
| protected static ST. | |
| public static String | |
| public static String | |
| public Object | |
| public Map | |
| public List | |
| public List | |
| public List | |
| public List | |
| public String | |
| public STViz | |
| public STViz | |
| public STViz | |
| public STViz | |
| public boolean | |
| protected void | rawSetAttribute(String name, Object value)
Set |
| public void | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int |
| debugState | back to summary |
|---|---|
| public ST. If | |
| EMPTY_ATTR | back to summary |
|---|---|
| public static final Object EMPTY_ATTR | |
| groupThatCreatedThisInstance | back to summary |
|---|---|
| public STGroup groupThatCreatedThisInstance Created as instance of which group? We need this to initialize interpreter via render. So, we create st and then it needs to know which group created it for sake of polymorphism:
st = skin1.getInstanceOf("searchbox");
result = st.render(); // knows skin1 created it
Say we have a group g1 with template t that imports
templates t and u from another group g2.
g1.getInstanceOf("u") finds u in g2 but remembers
that g1 created it. If u includes t, it should
create g1.t not g2.t.
g1 = {t(), u()}
|
v
g2 = {t()}
| |
| impl | back to summary |
|---|---|
| public CompiledST impl The implementation for this template among all instances of same template . | |
| IMPLICIT_ARG_NAME | back to summary |
|---|---|
| public static final String IMPLICIT_ARG_NAME When there are no formal args for template t and you map t across some values, t implicitly gets arg "it". E.g., "$it$" | |
| locals | back to summary |
|---|---|
| protected Object[] locals Safe to simultaneously write via | |
| UNKNOWN_NAME | back to summary |
|---|---|
| public static final String UNKNOWN_NAME | |
| VERSION | back to summary |
|---|---|
| public static final String VERSION | |
| ST | back to summary |
|---|---|
| protected ST() Used by group creation routine, not by users | |
| ST | back to summary |
|---|---|
| public ST(String template) Used to make templates inline in code for simple things like SQL or log records. No formal arguments are set and there is no enclosing instance. | |
| ST | back to summary |
|---|---|
| public ST(String template, char delimiterStartChar, char delimiterStopChar) Create ST using non-default delimiters; each one of these will live
in it's own group since you're overriding a default; don't want to
alter | |
| ST | back to summary |
|---|---|
| public ST(STGroup group, String template) | |
| ST | back to summary |
|---|---|
| public ST(ST proto) Clone a prototype template.
Copy all fields minus | |
| add | back to summary |
|---|---|
| public synchronized ST add(String name, Object value) Inject an attribute (name/value pair). If there is already an attribute
with that name, this method turns the attribute into an
Return
| |
| addAggr | back to summary |
|---|---|
| public synchronized ST addAggr(String aggrSpec, Object... values) Split | |
| convertToAttributeList | back to summary |
|---|---|
| protected static ST. | |
| format | back to summary |
|---|---|
public static String format(String template, Object... attributes)
ST.format("<%1>:<%2>", n, p);
| |
| format | back to summary |
|---|---|
| public static String format(int lineWidth, String template, Object... attributes) | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Find an attribute in this template only. | |
| getAttributes | back to summary |
|---|---|
| public Map | |
| getEvents | back to summary |
|---|---|
| public List | |
| getEvents | back to summary |
|---|---|
| public List | |
| getEvents | back to summary |
|---|---|
| public List | |
| getEvents | back to summary |
|---|---|
| public List | |
| getName | back to summary |
|---|---|
| public String getName() | |
| inspect | back to summary |
|---|---|
| public STViz inspect() | |
| inspect | back to summary |
|---|---|
| public STViz inspect(int lineWidth) | |
| inspect | back to summary |
|---|---|
| public STViz inspect(Locale locale) | |
| inspect | back to summary |
|---|---|
| public STViz inspect(ErrorManager errMgr, Locale locale, int lineWidth) | |
| isAnonSubtemplate | back to summary |
|---|---|
| public boolean isAnonSubtemplate() | |
| rawSetAttribute | back to summary |
|---|---|
| protected void rawSetAttribute(String name, Object value) Set | |
| remove | back to summary |
|---|---|
| public void remove(String name) Remove an attribute value entirely (can't remove attribute definitions). | |
| render | back to summary |
|---|---|
| public String render() | |
| render | back to summary |
|---|---|
| public String render(int lineWidth) | |
| render | back to summary |
|---|---|
| public String render(Locale locale) | |
| render | back to summary |
|---|---|
| public String render(Locale locale, int lineWidth) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| public int write(STWriter out) throws IOException | |
| write | back to summary |
|---|---|
| public int write(STWriter out, Locale locale) | |
| write | back to summary |
|---|---|
| public int write(STWriter out, STErrorListener listener) | |
| write | back to summary |
|---|---|
| public int write(STWriter out, Locale locale, STErrorListener listener) | |
| write | back to summary |
|---|---|
| public int write(File outputFile, STErrorListener listener) throws IOException | |
| write | back to summary |
|---|---|
| public int write(File outputFile, STErrorListener listener, String encoding) throws IOException | |
| write | back to summary |
|---|---|
| public int write(File outputFile, STErrorListener listener, String encoding, int lineWidth) throws IOException | |
| write | back to summary |
|---|---|
| public int write(File outputFile, STErrorListener listener, String encoding, Locale locale, int lineWidth) throws IOException | |
ArrayList, but this way I can track whether a
list is something ST created or it's an incoming list.
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| AttributeList | back to summary |
|---|---|
| public AttributeList(int size) | |
| AttributeList | back to summary |
|---|---|
| public AttributeList() | |
| Modifier and Type | Field and Description |
|---|---|
| public MultiMap | addAttrEvents
Track construction-time add attribute "events"; used for ST user-level debugging |
| public ConstructionEvent | newSTEvent
Record who made us? |
| Access | Constructor and Description |
|---|---|
| public |
| addAttrEvents | back to summary |
|---|---|
| public MultiMap<String, AddAttributeEvent> addAttrEvents Track construction-time add attribute "events"; used for ST user-level debugging | |
| newSTEvent | back to summary |
|---|---|
| public ConstructionEvent newSTEvent Record who made us? | |
| DebugState | back to summary |
|---|---|
| public DebugState() | |
<@r()>, <@r>...<@end>, and @t.r() ::= "..." defined manually by coder
| Modifier and Type | Field and Description |
|---|---|
| public static final ST. | EMBEDDED
|
| public static final ST. | EXPLICIT
|
| public static final ST. | IMPLICIT
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ST. | |
| public static ST. |
| EMBEDDED | back to summary |
|---|---|
| public static final ST.
| |
| EXPLICIT | back to summary |
|---|---|
| public static final ST.
| |
| IMPLICIT | back to summary |
|---|---|
| public static final ST.
| |
| RegionType | back to summary |
|---|---|
| private RegionType() | |
| valueOf | back to summary |
|---|---|
| public static ST. | |
| values | back to summary |
|---|---|
| public static ST. | |