Class Variable
java.lang.Object
org.openstreetmap.josm.tools.template_engine.Variable
- All Implemented Interfaces:
TemplateEntry
TemplateEntry that inserts the value of a variable.
Variables starting with "special:" form a separate namespace and provide actions other than simple key-value lookup.
A variable with no mapping for a given data provider will be considered not "valid"
(see TemplateEntry.isValid(TemplateEngineDataProvider)).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendText(StringBuilder result, TemplateEngineDataProvider dataProvider) Execute this template by generating text for a given data provider.booleaninthashCode()booleanCheck if this variable is special.booleanisValid(TemplateEngineDataProvider dataProvider) Check if this template is applicable to the given data provider.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.tools.template_engine.TemplateEntry
getText
-
Field Details
-
SPECIAL_VARIABLE_PREFIX
- See Also:
-
SPECIAL_VALUE_EVERYTHING
- See Also:
-
variableName
-
special
-
-
Constructor Details
-
Variable
Constructs a newVariable.- Parameters:
variableName- the variable name (i.e. the key in the data provider key-value mapping); will be considered "special" if the variable name starts withSPECIAL_VARIABLE_PREFIX
-
-
Method Details
-
appendText
Description copied from interface:TemplateEntryExecute this template by generating text for a given data provider.- Specified by:
appendTextin interfaceTemplateEntry- Parameters:
result- theStringBuilderto append the text todataProvider- the data provider from which information should be compiled to a string
-
isValid
Description copied from interface:TemplateEntryCheck if this template is applicable to the given data provider.- Specified by:
isValidin interfaceTemplateEntry- Parameters:
dataProvider- the data provider to check- Returns:
- true if all conditions are fulfilled to apply the template (for instance all required key=value mappings are present), false otherwise
-
toString
-
isSpecial
Check if this variable is special.- Returns:
- true if this variable is special
-
hashCode
-
equals
-