| Home >> All >> org >> springframework >> beans >> factory >> [ config Javadoc ] |
org.springframework.beans.factory.config: Javadoc index of package org.springframework.beans.factory.config.
Package Samples:
org.springframework.beans.factory.config
Classes:
MethodInvokingFactoryBean: FactoryBean which returns a value which is the result of a static or instance method invocation. For most use cases it is better to just use the container's built-in factory-method support for the same purpose, since that is smarter at converting arguments. This factory bean is still useful though when you need to call a method which doesn't return any value (for example, a static class method to force some sort of initialization to happen). This use case is not supported by factory-methods, since a return value is needed to become the bean. Note that as it is expected to be used mostly for accessing ...
PropertyPlaceholderConfigurer: A property resource configurer that resolves placeholders in bean property values of context definitions. It pulls values from a properties file into bean definitions. The default placeholder syntax follows the Ant / Log4J / JSP EL style: ${...} Example XML context definition: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"><value>${driver}</value></property> <property name="url"><value>jdbc:${dbname}</value></property> </bean> Example properties file: driver=com.mysql.jdbc.Driver ...
ServiceLocatorFactoryBean: FactoryBean that takes an interface which must have one or more methods with the signatures MyType xxx() or MyType xxx(MyIdType id) (typically, MyService getService() or MyService getService(String id) ) and creates a dynamic proxy which implements that interface, delegating to the Spring BeanFactory underneath. Such service locator allow to decouple the caller from Spring BeanFactory API, using an appropriate custom locator interface. They will typically be used for prototype beans , i.e. for factory methods that are supposed to return a new instance for each call. The client receives a reference ...
PropertyPathFactoryBean: FactoryBean that evaluates a property path on a given target object. The target object can be specified directly or via a bean name. Usage examples: // target bean to be referenced by name <bean id="tb" class="org.springframework.beans.TestBean" singleton="false"> <property name="age"><value>10</value></property> <property name="spouse"> <bean class="org.springframework.beans.TestBean"> <property name="age"><value>11</value></property> </bean> </property> </bean> // will result in 12, which is the value of property ...
PropertyOverrideConfigurer: A property resource configurer that overrides bean property values in an application context definition. It pushes values from a properties file into bean definitions. Configuration lines are expected to be of the following form: beanName.property=value Example properties file: dataSource.driverClassName=com.mysql.jdbc.Driver dataSource.url=jdbc:mysql:mydb In contrast to PropertyPlaceholderConfigurer, the original definition can have default values or no values at all for such bean properties. If an overriding properties file does not have an entry for a certain bean property, the default context ...
AutowireCapableBeanFactory: Extension of the BeanFactory interface to be implemented by bean factories that are capable of autowiring, provided that they want to expose this functionality for existing bean instances. This subinterface of BeanFactory is not meant to be used in normal application code: stick to BeanFactory or ListableBeanFactory for typical use cases. Integration code for other frameworks can leverage this interface to wire and populate existing bean instances that Spring does not control the lifecycle of. This is particularly useful for WebWork Actions or Tapestry Page objects, for example. Note that this ...
ObjectFactoryCreatingFactoryBean: FactoryBean which returns a value which is an ObjectFactory that returns a bean from the BeanFactory. As such, this may be used to avoid having a client bean directly calling getBean() the BeanFactory to get a prototype bean out of the BeanFactory, a violation of inversion of control. Instead, with the use of this class, the client bean can be fed an ObjectFactory as a property which directly returns only the one target (usually prototype) bean. A Sample config in an XML BeanFactory might look as follows: <beans> <!-- Prototype bean since we have state --> <bean id="myService" class="a.b.c.MyService" ...
CustomEditorConfigurer: BeanFactoryPostProcessor implementation that allows for convenient registration of custom property editors. Configuration example, assuming XML bean definitions and inner beans for PropertyEditor instances: <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer"> <property name="customEditors"> <map> <entry key="java.util.Date"> <bean class="mypackage.MyCustomDateEditor"/> </entry> <entry key="mypackage.MyObject"> <bean id="myEditor" class="mypackage.MyObjectEditor"> <property name="myParam"><value>myValue</value></property> ...
PropertyResourceConfigurer: Allows for configuration of individual bean property values from a property resource, i.e. a properties file. Useful for custom config files targetted at system administrators that override bean properties configured in the application context. 2 concrete implementations are provided in the distribution: PropertyOverrideConfigurer for "beanName.property=value" style overriding ( pushing values from a properties file into bean definitions) PropertyPlaceholderConfigurer for replacing "${...}" placeholders ( pulling values from a properties file into bean definitions) Property values can be converted ...
FieldRetrievingFactoryBean: FactoryBean which retrieves a static or non-static field value. Typically used for retrieving public static final constants. Usage example: // standard definition for exposing a static field, specifying the "staticField" property <bean id="myField" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"> <property name="staticField"><value>java.sql.Connection.TRANSACTION_SERIALIZABLE</value></property> </bean> // convenience version that specifies a static field pattern as bean name <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE" ...
BeanPostProcessor: Allows for custom modification of new bean instances, e.g. checking for marker interfaces or wrapping them with proxies. Application contexts can auto-detect BeanPostProcessor beans in their bean definitions and apply them before any other beans get created. Plain bean factories allow for programmatic registration of post-processors. Typically, post-processors that populate beans via marker interfaces or the like will implement postProcessBeforeInitialization, and post-processors that wrap beans with proxies will normally implement postProcessAfterInitialization.
BeanFactoryPostProcessor: Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory. Application contexts can auto-detect BeanFactoryPostProcessor beans in their bean definitions and apply them before any other beans get created. Useful for custom config files targeted at system administrators that override bean properties configured in the application context. See PropertyResourceConfigurer and its concrete implementations for out-of-the-box solutions that address such configuration needs.
PropertiesFactoryBean: Allows for making a properties file from a classpath location available as Properties instance in a bean factory. Can be used for 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. If neither a location nor local properties are set, an exception will be thrown on initialization. Can create a singleton or a new object on each request. Default is singleton.
ConfigurableListableBeanFactory: Configuration interface to be implemented by most listable bean factories. In addition to ConfigurableBeanFactory, it provides facilities to analyze and modify bean definitions, and to pre-instantiate singletons. This subinterface of BeanFactory is not meant to be used in normal application code: Stick to BeanFactory or ListableBeanFactory for typical use cases. This interface is just meant to allow for framework-internal plug'n'play even when needing access to bean factory configuration methods.
ConfigurableBeanFactory: Configuration interface to be implemented by most bean factories. Provides facilities to configure a bean factory, in addition to the bean factory client methods in the BeanFactory interface. This subinterface of BeanFactory is not meant to be used in normal application code: Stick to BeanFactory or ListableBeanFactory for typical use cases. This interface is just meant to allow for framework-internal plug'n'play even when needing access to bean factory configuration methods.
AbstractFactoryBean: Simple template superclass for FactoryBean implementations thats allows for creating a singleton or a prototype, depending on a flag. If the "singleton" flag is "true" (the default), this class will create once on initialization and subsequently return the singleton instance. Else, this class will create a new instance each time. Subclasses are responsible for implementing the abstract createInstance template method to actually create objects.
PreferencesPlaceholderConfigurer: Subclass of PropertyPlaceholderConfigurer that supports J2SE 1.4's Preferences API (java.util.prefs). Tries to resolve placeholders as keys first in the user preferences, then in the system preferences, then in this configurer's properties. Thus, behaves like PropertyPlaceholderConfigurer if no corresponding preferences defined. Supports custom paths for the system and user preferences trees. Uses the respective root nodes if not specified.
BeanDefinitionHolder: Holder for a BeanDefinition with name and aliases. Recognized by AbstractAutowireCapableBeanFactory for inner bean definitions. Registered by DefaultXmlBeanDefinitionParser, which also uses it as general holder for a parsed bean definition. Can also be used for programmatic registration of inner bean definitions. If you don't care about BeanNameAware and the like, registering RootBeanDefinition or ChildBeanDefinition is good enough.
BeanReferenceFactoryBean: FactoryBean that exposes an arbitrary target bean under a different name. Usually, the target bean will reside in a different bean definition file, using this FactoryBean to link it in and expose it under a different name. Effectively, this corresponds to an alias for the target bean. NOTE: For XML bean definition files, a <alias> tag is available that effectively achieves the same.
CommonsLogFactoryBean: Factory bean for commons-logging Log instances. Will expose the created Log object on getBean calls, and can be passed to bean properites of type org.apache.commons.logging.Log. Useful for sharing Log instances among multiple beans instead of using one Log instance per class name, e.g. for common log topics.
BeanDefinition: A BeanDefinition describes a bean instance, which has property values, constructor argument values, and further information supplied by concrete implementations. This is just a minimal interface: The main intention is to allow BeanFactoryPostProcessors (like PropertyPlaceholderConfigurer) to access and modify property values.
TypedStringValue: Holder for a typed String value. Can be added to bean definitions to explicitly specify a target type for a String value, for example for collection elements. This holder will just store the String value and the target type. The actual conversion will be performed by the bean factory.
InstantiationAwareBeanPostProcessor: Subinterface of BeanPostProcessor that adds a before-instantiation callback. Typically used to suppress default instantiation for specific target beans, for example to create proxies with special TargetSources (pooling targets, lazily initializing targets, etc).
DestructionAwareBeanPostProcessor: Subinterface of BeanPostProcessor that adds a before-destruction callback. The typical usage will be to invoke custom destruction callbacks on specific bean types, matching corresponding initialization callbacks.
ResourceFactoryBean: FactoryBean for Resource descriptors. Exposes a looked-up Resource object. Delegates to the ApplicationContext's getResource method. Resource loading behavior is specific to the context implementation.
| Home | Contact Us | Privacy Policy | Terms of Service |