|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tudarmstadt.ukp.jwktl.api.util.TemplateParser.Template
public static class TemplateParser.Template
A template is a reusable pattern that can be added to any wiki page. The template is being substituted by its definition upon rendering the wiki page to HTML. A template has a unique name. It can be equipped with multiple parameters. The parameters are divided into numbered and named parameters. The former are indexed by integers (starting with 0); the latter are key-value parirs.
Field Summary | |
---|---|
protected String |
name
|
protected Map<String,String> |
namedParams
|
protected List<String> |
numberedParams
|
Constructor Summary | |
---|---|
TemplateParser.Template(String name)
Creates a new template with the given name. |
Method Summary | |
---|---|
void |
addParam(String value)
Add a numbered parameter with the given value. |
void |
addParam(String key,
String value)
Add a named parameter with the given key and value. |
String |
getName()
Returns the name of the template. |
String |
getNamedParam(String key)
Return the named parameter with the given key or null/ |
Iterable<Map.Entry<String,String>> |
getNamedParams()
Iterate over all named parameters. |
int |
getNamedParamsCount()
Returns number of all named parameters. |
String |
getNumberedParam(int idx)
Return the numbered parameter with the given index or null/ |
Iterable<String> |
getNumberedParams()
Iterate over all numbered parameters. |
int |
getNumberedParamsCount()
Returns number of all numbered parameters. |
int |
getParamsCount()
Returns the number of all parameters (including numbered and named paramters). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected Map<String,String> namedParams
protected List<String> numberedParams
Constructor Detail |
---|
public TemplateParser.Template(String name)
Method Detail |
---|
public String getName()
public void addParam(String value)
public void addParam(String key, String value)
public String getNumberedParam(int idx)
null/
if no such parameter exists.
public String getNamedParam(String key)
null/
if no such parameter exists.
public Iterable<String> getNumberedParams()
public Iterable<Map.Entry<String,String>> getNamedParams()
public int getParamsCount()
public int getNumberedParamsCount()
public int getNamedParamsCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |