public class Template
extends java.lang.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 | Description |
|---|---|
Template(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> parameters) |
Constructs a new template using an identifier, its parameter names with
their values.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getName() |
Returns the identifier of this template.
|
java.util.Set<java.lang.String> |
getParameterNames() |
Returns the parameter names that this template has.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters() |
Returns a map containing all parameter names with the associated values
that this template has.
|
java.lang.String |
getValue(java.lang.String parameterName) |
Returns the value associated to the specified parameter name
|
java.lang.String |
toString() |
public Template(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> parameters)
name - template nameparameters - a map containing the template's parameter names with their
valuespublic java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getParameters()
public java.util.Set<java.lang.String> getParameterNames()
public java.lang.String getValue(java.lang.String parameterName)
parameterName - the parameter namepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage