Class SystemPropertyInitializer

java.lang.Object
org.springframework.batch.support.SystemPropertyInitializer
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public class SystemPropertyInitializer extends Object implements org.springframework.beans.factory.InitializingBean
Helper class that sets up a System property with a default value. A System property is created with the specified key name, and default value (i.e. if the property already exists it is not changed).
Author:
Dave Syer
  • Field Details

  • Constructor Details

    • SystemPropertyInitializer

      public SystemPropertyInitializer()
  • Method Details

    • setKeyName

      public void setKeyName(String keyName)
      Set the key name for the System property that is created. Defaults to ENVIRONMENT.
      Parameters:
      keyName - the key name to set
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
      Mandatory property specifying the default value of the System property.
      Parameters:
      defaultValue - the default value to set
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Sets the System property with the provided name and default value.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
      See Also:
      • InitializingBean.afterPropertiesSet()