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 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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getPrefix()
      Variable replacer prefix string.
      java.lang.String getReplacement​(java.lang.String maskedValue)
      Provides String which should be used as a variable replacement for given masked value.
      void init​(java.util.Properties properties)
      Initialization method called before first usage of the config replacer.
    • Method Detail

      • init

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

        java.lang.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

        java.lang.String getReplacement​(java.lang.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.