Module net.shibboleth.ext.spring
Class VelocityEngineFactoryBean
- java.lang.Object
-
- net.shibboleth.ext.spring.velocity.VelocityEngineFactory
-
- net.shibboleth.ext.spring.velocity.VelocityEngineFactoryBean
-
- All Implemented Interfaces:
Aware,FactoryBean<org.apache.velocity.app.VelocityEngine>,InitializingBean,ResourceLoaderAware
public class VelocityEngineFactoryBean extends VelocityEngineFactory implements FactoryBean<org.apache.velocity.app.VelocityEngine>, InitializingBean, ResourceLoaderAware
Factory bean that configures a VelocityEngine and provides it as bean reference. This bean is intended for any kind of usage of Velocity in application code, e.g. for generating email content. For web views, VelocityConfigurer is used to set up a VelocityEngine for views.The simplest way to use this class is to specify a "resourceLoaderPath"; you do not need any further configuration then. For example, in a web application context:
<bean id="velocityEngine" class="net.shibboleth.ext.spring.velocity.VelocityEngineFactoryBean"> <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/> </bean>
See the base class VelocityEngineFactory for configuration details.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.velocity.app.VelocityEnginevelocityEngineEngine being created.-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description VelocityEngineFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.apache.velocity.app.VelocityEnginegetObject()Class<? extends org.apache.velocity.app.VelocityEngine>getObjectType()booleanisSingleton()-
Methods inherited from class net.shibboleth.ext.spring.velocity.VelocityEngineFactory
createVelocityEngine, initSpringResourceLoader, initVelocityResourceLoader, newVelocityEngine, postProcessVelocityEngine, setConfigLocation, setPreferFileSystemAccess, setResourceLoader, setResourceLoaderPath, setVelocityProperties, setVelocityPropertiesMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws IOException, org.apache.velocity.exception.VelocityException- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
IOExceptionorg.apache.velocity.exception.VelocityException
-
getObject
@Nullable public org.apache.velocity.app.VelocityEngine getObject()
- Specified by:
getObjectin interfaceFactoryBean<org.apache.velocity.app.VelocityEngine>
-
getObjectType
@Nullable public Class<? extends org.apache.velocity.app.VelocityEngine> getObjectType()
- Specified by:
getObjectTypein interfaceFactoryBean<org.apache.velocity.app.VelocityEngine>
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceFactoryBean<org.apache.velocity.app.VelocityEngine>
-
-