Package net.sf.jasperreports.extensions
Class SpringExtensionsRegistryFactory
- java.lang.Object
-
- net.sf.jasperreports.extensions.SpringExtensionsRegistryFactory
-
- All Implemented Interfaces:
ExtensionsRegistryFactory
public class SpringExtensionsRegistryFactory extends Object implements ExtensionsRegistryFactory
AExtensionsRegistryFactorywhich 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.resourceto be present in the properties map passed tocreateRegistry(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
SpringExtensionsRegistryinstance which will use the bean factory.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXCEPTION_MESSAGE_KEY_NO_SPRING_RESOURCE_SETstatic StringEXCEPTION_MESSAGE_KEY_SPRING_RESOURCE_NOT_FOUNDstatic StringPROPERTY_SUFFIX_SPRING_BEANS_RESOURCEThe suffix of the property that gives the Spring beans XML resource name.
-
Constructor Summary
Constructors Constructor Description SpringExtensionsRegistryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionsRegistrycreateRegistry(String registryId, JRPropertiesMap properties)Instantiates an extensions registry.protected org.springframework.beans.factory.ListableBeanFactorygetBeanFactory(String registryId, JRPropertiesMap properties)
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_NO_SPRING_RESOURCE_SET
public static final String EXCEPTION_MESSAGE_KEY_NO_SPRING_RESOURCE_SET
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_SPRING_RESOURCE_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_SPRING_RESOURCE_NOT_FOUND
- See Also:
- Constant Field Values
-
PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE
public static final String PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE
The suffix of the property that gives the Spring beans XML resource name.- See Also:
- Constant Field Values
-
-
Method Detail
-
createRegistry
public ExtensionsRegistry createRegistry(String registryId, JRPropertiesMap properties)
Description copied from interface:ExtensionsRegistryFactoryInstantiates an extensions registry.- Specified by:
createRegistryin 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:
DefaultExtensionsRegistry.PROPERTY_REGISTRY_PREFIX
-
getBeanFactory
protected org.springframework.beans.factory.ListableBeanFactory getBeanFactory(String registryId, JRPropertiesMap properties)
-
-