Package com.aspectran.core.support
Class PropertiesFactoryBean
java.lang.Object
com.aspectran.utils.PropertiesLoaderSupport
com.aspectran.core.support.PropertiesFactoryBean
- All Implemented Interfaces:
FactoryBean<Properties>
,InitializableBean
,InitializableFactoryBean<Properties>
,ActivityContextAware
,Aware
@AvoidAdvice
public class PropertiesFactoryBean
extends PropertiesLoaderSupport
implements ActivityContextAware, InitializableFactoryBean<Properties>
Allows for making a properties file from a classpath location available
as Properties instance in a bean factory. Can be used to populate
any bean property of type Properties via a bean reference.
Supports loading from a properties file and/or setting local properties
on this FactoryBean. The created Properties instance will be merged from
loaded and local values.
Created: 2025. 2. 18.
-
Field Summary
Fields inherited from interface com.aspectran.core.component.bean.ablility.FactoryBean
FACTORY_METHOD_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn an instance (possibly shared or independent) of the object managed by this factory.protected InputStream
getResourceAsStream
(String location) void
Invoke on initialization after it has set all bean properties supplied.void
setActivityContext
(ActivityContext context) Methods inherited from class com.aspectran.utils.PropertiesLoaderSupport
loadProperties, mergeProperties, setIgnoreInvalidResource, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray
-
Constructor Details
-
PropertiesFactoryBean
public PropertiesFactoryBean()
-
-
Method Details
-
setActivityContext
- Specified by:
setActivityContext
in interfaceActivityContextAware
-
getResourceAsStream
- Specified by:
getResourceAsStream
in classPropertiesLoaderSupport
- Throws:
IOException
-
initialize
Description copied from interface:InitializableBean
Invoke on initialization after it has set all bean properties supplied.- Specified by:
initialize
in interfaceInitializableBean
- Throws:
Exception
- if initialization fails
-
getObject
Description copied from interface:FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory. As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.- Specified by:
getObject
in interfaceFactoryBean<Properties>
- Returns:
- an instance of the bean (can be null)
- Throws:
Exception
- in case of creation errors
-