Interface ConfigReplacer

All Known Implementing Classes:
AbstractPbeReplacer, EncryptionReplacer, PropertyReplacer

public interface ConfigReplacer
Interface to be implemented by pluggable variable replacers for the configuration files. The replacers can be configured in XML configuration files, and they are used to replace custom strings during loading the configuration.

A Variable to be replaced within the configuration file has the following form:

 "$" PREFIX "{" MASKED_VALUE "}"
 
where the PREFIX is the value returned by getPrefix() method and MASKED_VALUE is a value provided to the getReplacement(String) method. The result of getReplacement(String) method call replaces the whole Variable String.
  • Method Summary

    Modifier and Type
    Method
    Description
    Variable replacer prefix string.
    getReplacement(String maskedValue)
    Provides String which should be used as a variable replacement for given masked value.
    void
    init(Properties properties)
    Initialization method called before first usage of the config replacer.
  • Method Details

    • init

      void init(Properties properties)
      Initialization method called before first usage of the config replacer.
      Parameters:
      properties - properties configured (not null)
    • getPrefix

      String getPrefix()
      Variable replacer prefix string. The value returned should be a constant unique short alphanumeric string without whitespaces.
      Returns:
      constant prefix of this replacer
    • getReplacement

      String getReplacement(String maskedValue)
      Provides String which should be used as a variable replacement for given masked value.
      Parameters:
      maskedValue - the masked value
      Returns:
      either not null String to be used as a replacement for the variable; or null when this replacer is not able to handle the masked value.