public class Template extends Object
A template is a page created to be included in other pages in the Wikibase system. The transclusion is a method of inclusion where the wikitext of a page contains a reference to the template.
The syntax in the transclusion is of the form:
{{ template_name | parameter1 | parameter2 | … | parametern }}
Each parameteri can be of the form: namei=valuei, or just valuei. The former type of parameter is called named parameter, and the latter is called unnamed parameter. All unnamed parameters are actually implicitly named as sequential positive integers. Thus, the first one is "1", the second one is "2", and so on and so forth.
Constructor and Description |
---|
Template(String name,
Map<String,String> parameters)
Constructs a new template using an identifier, its parameter names with
their values.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the identifier of this template.
|
Set<String> |
getParameterNames()
Returns the parameter names that this template has.
|
Map<String,String> |
getParameters()
Returns a map containing all parameter names with the associated values
that this template has.
|
String |
getValue(String parameterName)
Returns the value associated to the specified parameter name
|
String |
toString() |
public Template(String name, Map<String,String> parameters)
name
- template nameparameters
- a map containing the template's parameter names with their
valuespublic String getName()
public Map<String,String> getParameters()
public Set<String> getParameterNames()
public String getValue(String parameterName)
parameterName
- the parameter nameCopyright © 2014 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage