Package net.sf.jasperreports.spring
Class SpringExtensionsRegistryFactory
java.lang.Object
net.sf.jasperreports.spring.SpringExtensionsRegistryFactory
- All Implemented Interfaces:
ExtensionsRegistryFactory
A
ExtensionsRegistryFactory
which works by loading a Spring beans XML
file and using beans of specific types as extensions.
The factory requires a property named
net.sf.jasperreports.extension.<registry_id>.spring.beans.resource
to be present in the properties map passed to
createRegistry(String, JRPropertiesMap)
.
The value of this property must resolve to a resource name which is loaded
from the context classloader, and parsed as a Spring beans XML file.
Once the Spring beans XML file is loaded, this factory creates a
SpringExtensionsRegistry
instance which will use the bean factory.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRegistry
(String registryId, JRPropertiesMap properties) Instantiates an extensions registry.protected org.springframework.beans.factory.ListableBeanFactory
getBeanFactory
(String registryId, JRPropertiesMap properties)
-
Field Details
-
EXCEPTION_MESSAGE_KEY_NO_SPRING_RESOURCE_SET
- See Also:
-
EXCEPTION_MESSAGE_KEY_SPRING_RESOURCE_NOT_FOUND
- See Also:
-
PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE
The suffix of the property that gives the Spring beans XML resource name.- See Also:
-
-
Constructor Details
-
SpringExtensionsRegistryFactory
public SpringExtensionsRegistryFactory()
-
-
Method Details
-
createRegistry
Description copied from interface:ExtensionsRegistryFactory
Instantiates an extensions registry.- Specified by:
createRegistry
in interfaceExtensionsRegistryFactory
- Parameters:
registryId
- the ID of the registry to instantiate. The ID can be used to identify a set of properties to be used when instantiating the registry.properties
- the map of properties that can be used to configure the registry instantiation process- Returns:
- an extensions registry
- See Also:
-
getBeanFactory
protected org.springframework.beans.factory.ListableBeanFactory getBeanFactory(String registryId, JRPropertiesMap properties)
-