Class SystemPropertyInitializer
- java.lang.Object
- org.springframework.batch.support.SystemPropertyInitializer
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class SystemPropertyInitializer extends java.lang.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 Summary
Fields Modifier and Type Field Description static java.lang.String
ENVIRONMENT
Name of system property used by default.
Constructor Summary
Constructors Constructor Description SystemPropertyInitializer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Sets the System property with the provided name and default value.void
setDefaultValue(java.lang.String defaultValue)
Mandatory property specifying the default value of the System property.void
setKeyName(java.lang.String keyName)
Set the key name for the System property that is created.
Field Detail
ENVIRONMENT
public static final java.lang.String ENVIRONMENT
Name of system property used by default.- See Also:
- Constant Field Values
Method Detail
setKeyName
public void setKeyName(java.lang.String keyName)
Set the key name for the System property that is created. Defaults toENVIRONMENT
.- Parameters:
keyName
- the key name to set
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
Mandatory property specifying the default value of the System property.- Parameters:
defaultValue
- the default value to set
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
Sets the System property with the provided name and default value.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
- See Also:
InitializingBean.afterPropertiesSet()