Class PropertyReplacer

  • All Implemented Interfaces:
    ConfigReplacer

    public class PropertyReplacer
    extends java.lang.Object
    implements ConfigReplacer
    ConfigReplacer for replacing property names with property values for properties provided in init(Properties) method. The implementation can be used for replacing System properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPrefix()
      Variable replacer prefix string.
      java.lang.String getReplacement​(java.lang.String variable)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyReplacer

        public PropertyReplacer()
    • Method Detail

      • init

        public void init​(java.util.Properties properties)
        Description copied from interface: ConfigReplacer
        Initialization method called before first usage of the config replacer.
        Specified by:
        init in interface ConfigReplacer
        Parameters:
        properties - properties configured (not null)
      • getPrefix

        public java.lang.String getPrefix()
        Description copied from interface: ConfigReplacer
        Variable replacer prefix string. The value returned should be a constant unique short alphanumeric string without whitespaces.
        Specified by:
        getPrefix in interface ConfigReplacer
        Returns:
        constant prefix of this replacer
      • getReplacement

        public java.lang.String getReplacement​(java.lang.String variable)
        Description copied from interface: ConfigReplacer
        Provides String which should be used as a variable replacement for given masked value.
        Specified by:
        getReplacement in interface ConfigReplacer
        Parameters:
        variable - 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.