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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the System property with the provided name and default value.void
setDefaultValue
(String defaultValue) Mandatory property specifying the default value of the System property.void
setKeyName
(String keyName) Set the key name for the System property that is created.
-
Field Details
-
ENVIRONMENT
Name of system property used by default.- See Also:
-
-
Constructor Details
-
SystemPropertyInitializer
public SystemPropertyInitializer()
-
-
Method Details
-
setKeyName
Set the key name for the System property that is created. Defaults toENVIRONMENT
.- Parameters:
keyName
- the key name to set
-
setDefaultValue
Mandatory property specifying the default value of the System property.- Parameters:
defaultValue
- the default value to set
-
afterPropertiesSet
Sets the System property with the provided name and default value.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
-
InitializingBean.afterPropertiesSet()
-