EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.template
Class SimpleTemplateTextSubstitution

java.lang.Object
  extended by echopoint.template.SimpleTemplateTextSubstitution
All Implemented Interfaces:
TemplateTextSubstitution, Serializable

public class SimpleTemplateTextSubstitution
extends Object
implements TemplateTextSubstitution, Serializable

The class SimpleTemplateTextSubstitution is a simple implementation of TemplateTextSubstitution that uses a HashMap to substitute named string values.

Note it uses the toString() method rather than casting associated value objects to Strings and hence you can technically use objects other than Strings.

See Also:
Serialized Form

Constructor Summary
SimpleTemplateTextSubstitution()
          SimpleTemplateTextSubstitution constructor that creates its own empty HashMap.
SimpleTemplateTextSubstitution(HashMap newStringMap)
          SimpleTemplateTextSubstitution constructor that takes a primed HashMap of string mappings.
 
Method Summary
 HashMap getStringMap()
          Returns the underlying HashMap containing named string.
 String getSubstitutionText(String substitutionName)
          This method is called to return a String that has been associated with the given substitution name.
 void put(String substitutionName, Object substitutionValue)
          This method associated the given substitution name with a string value.
 void setStringMap(HashMap newStringMap)
          Sets the underlying HashMap of named String values. 99% of the time there is no need to call this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTemplateTextSubstitution

public SimpleTemplateTextSubstitution()
SimpleTemplateTextSubstitution constructor that creates its own empty HashMap.


SimpleTemplateTextSubstitution

public SimpleTemplateTextSubstitution(HashMap newStringMap)
SimpleTemplateTextSubstitution constructor that takes a primed HashMap of string mappings.

Method Detail

getStringMap

public HashMap getStringMap()
Returns the underlying HashMap containing named string.

Returns:
java.util.HashMap

getSubstitutionText

public String getSubstitutionText(String substitutionName)
This method is called to return a String that has been associated with the given substitution name.

Specified by:
getSubstitutionText in interface TemplateTextSubstitution

put

public void put(String substitutionName,
                Object substitutionValue)
This method associated the given substitution name with a string value.


setStringMap

public void setStringMap(HashMap newStringMap)
Sets the underlying HashMap of named String values. 99% of the time there is no need to call this method.

Parameters:
newStringMap - java.util.HashMap

EchoPoint API - 3.0.0b5
App Webcontainer