Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## echopointng.template
Class SimpleTemplateTextSubstitution

    java.lang.Object
      echopointng.template.SimpleTemplateTextSubstitution

All Implemented Interfaces:
  TemplateTextSubstitution, java.io.Serializable

    public class SimpleTemplateTextSubstitution

extends java.lang.Object
implements TemplateTextSubstitution, java.io.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(java.util.HashMap newStringMap)` SimpleTemplateTextSubstitution constructor that takes a primed HashMap of string mappings.

Method Summary
`java.util.HashMap` | `getStringMap()` Returns the underlying HashMap containing named string.
`java.lang.String` | `getSubstitutionText(java.lang.String substitutionName)` This method is called to return a String that has been associated with the given substitution name.
`void` | `put(java.lang.String substitutionName, java.lang.Object substitutionValue)` This method associated the given substitution name with a string value.
`void` | `setStringMap(java.util.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(java.util.HashMap newStringMap)

  SimpleTemplateTextSubstitution constructor that takes a primed HashMap of string mappings.

Method Detail

### getStringMap

    public java.util.HashMap getStringMap()

  Returns the underlying HashMap containing named string.

  Returns:
    java.util.HashMap

### getSubstitutionText

    public java.lang.String getSubstitutionText(java.lang.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(java.lang.String substitutionName,
                    java.lang.Object substitutionValue)

  This method associated the given substitution name with a string value.

### setStringMap

    public void setStringMap(java.util.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

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD