| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_191) on Sat Feb 27 13:52:04 CET 2021 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>VelocityEngineFactory (Apache Velocity 2.3 API)</title> |
| <meta name="date" content="2021-02-27"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="VelocityEngineFactory (Apache Velocity 2.3 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/VelocityEngineFactory.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/velocity/spring/SpringResourceLoader.html" title="class in org.apache.velocity.spring"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/velocity/spring/VelocityEngineFactoryBean.html" title="class in org.apache.velocity.spring"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/velocity/spring/VelocityEngineFactory.html" target="_top">Frames</a></li> |
| <li><a href="VelocityEngineFactory.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.velocity.spring</div> |
| <h2 title="Class VelocityEngineFactory" class="title">Class VelocityEngineFactory</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.velocity.spring.VelocityEngineFactory</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactoryBean.html" title="class in org.apache.velocity.spring">VelocityEngineFactoryBean</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">VelocityEngineFactory</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Factory that configures a VelocityEngine. Can be used standalone, |
| but typically you will either use <a href="../../../../org/apache/velocity/spring/VelocityEngineFactoryBean.html" title="class in org.apache.velocity.spring"><code>VelocityEngineFactoryBean</code></a> |
| for preparing a VelocityEngine as bean reference, or |
| <a href="https://docs.spring.io/spring-framework/docs/4.3.29.RELEASE/javadoc-api/org/springframework/web/servlet/view/velocity/VelocityConfigurer.html">org.springframework.web.servlet.view.velocity.VelocityConfigurer</a> |
| for web views. |
| |
| <p>The optional "configLocation" property sets the location of the Velocity |
| properties file, within the current application. Velocity properties can be |
| overridden via "velocityProperties", or even completely specified locally, |
| avoiding the need for an external properties file. |
| |
| <p>The "resourceLoaderPath" property can be used to specify the Velocity |
| resource loader path via Spring's Resource abstraction, possibly relative |
| to the Spring application context. |
| |
| <p>The simplest way to use this class is to specify a |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-"><code>"resourceLoaderPath"</code></a>; the |
| VelocityEngine typically then does not need any further configuration.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2020-05-29</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Juergen Hoeller, Claude Brisson</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setConfigLocation-org.springframework.core.io.Resource-"><code>setConfigLocation(org.springframework.core.io.Resource)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityProperties-java.util.Properties-"><code>setVelocityProperties(java.util.Properties)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-"><code>setResourceLoaderPath(java.lang.String)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#createVelocityEngine--"><code>createVelocityEngine()</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactoryBean.html" title="class in org.apache.velocity.spring"><code>VelocityEngineFactoryBean</code></a>, |
| <a href="https://docs.spring.io/spring-framework/docs/4.3.29.RELEASE/javadoc-api/org/springframework/web/servlet/view/velocity/VelocityConfigurer.html">org.springframework.web.servlet.view.velocity.VelocityConfigurer</a>, |
| <a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app"><code>VelocityEngine</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static org.slf4j.Logger</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#logger">logger</a></span></code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#VelocityEngineFactory--">VelocityEngineFactory</a></span>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#createVelocityEngine--">createVelocityEngine</a></span>()</code> |
| <div class="block">Prepare the VelocityEngine instance and return it.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected org.springframework.core.io.ResourceLoader</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#getResourceLoader--">getResourceLoader</a></span>()</code> |
| <div class="block">Return the Spring ResourceLoader to use for loading Velocity template files.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#initSpringResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-">initSpringResourceLoader</a></span>(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</code> |
| <div class="block">Initialize a SpringResourceLoader for the given VelocityEngine.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#initVelocityResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-">initVelocityResourceLoader</a></span>(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</code> |
| <div class="block">Initialize a Velocity resource loader for the given VelocityEngine: |
| either a standard Velocity FileResourceLoader or a SpringResourceLoader.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#isPreferFileSystemAccess--">isPreferFileSystemAccess</a></span>()</code> |
| <div class="block">Return whether to prefer file system access for template loading.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#newVelocityEngine--">newVelocityEngine</a></span>()</code> |
| <div class="block">Return a new VelocityEngine.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#postProcessVelocityEngine-org.apache.velocity.app.VelocityEngine-">postProcessVelocityEngine</a></span>(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine)</code> |
| <div class="block">To be implemented by subclasses that want to perform custom |
| post-processing of the VelocityEngine after this FactoryBean |
| performed its default configuration (but before VelocityEngine.init).</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setConfigLocation-org.springframework.core.io.Resource-">setConfigLocation</a></span>(org.springframework.core.io.Resource configLocation)</code> |
| <div class="block">Set the location of the Velocity config file.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setPreferFileSystemAccess-boolean-">setPreferFileSystemAccess</a></span>(boolean preferFileSystemAccess)</code> |
| <div class="block">Set whether to prefer file system access for template loading.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoader-org.springframework.core.io.ResourceLoader-">setResourceLoader</a></span>(org.springframework.core.io.ResourceLoader resourceLoader)</code> |
| <div class="block">Set the Spring ResourceLoader to use for loading Velocity template files.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-">setResourceLoaderPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</code> |
| <div class="block">Set the Velocity resource loader path via a Spring resource location.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityProperties-java.util.Properties-">setVelocityProperties</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> velocityProperties)</code> |
| <div class="block">Set Velocity properties, like "file.resource.loader.path".</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityPropertiesMap-java.util.Map-">setVelocityPropertiesMap</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>> velocityPropertiesMap)</code> |
| <div class="block">Set Velocity properties as Map, to allow for non-String values |
| like "ds.resource.loader.instance".</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="logger"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>logger</h4> |
| <pre>protected static final org.slf4j.Logger logger</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="VelocityEngineFactory--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>VelocityEngineFactory</h4> |
| <pre>public VelocityEngineFactory()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="setConfigLocation-org.springframework.core.io.Resource-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setConfigLocation</h4> |
| <pre>public void setConfigLocation(org.springframework.core.io.Resource configLocation)</pre> |
| <div class="block">Set the location of the Velocity config file. |
| Alternatively, you can specify all properties locally.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityProperties-java.util.Properties-"><code>setVelocityProperties(java.util.Properties)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-"><code>setResourceLoaderPath(java.lang.String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setVelocityProperties-java.util.Properties-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setVelocityProperties</h4> |
| <pre>public void setVelocityProperties(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> velocityProperties)</pre> |
| <div class="block">Set Velocity properties, like "file.resource.loader.path". |
| Can be used to override values in a Velocity config file, |
| or to specify all necessary properties locally. |
| <p>Note that the Velocity resource loader path also be set to any |
| Spring resource location via the "resourceLoaderPath" property. |
| Setting it here is just necessary when using a non-file-based |
| resource loader.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityPropertiesMap-java.util.Map-"><code>setVelocityPropertiesMap(java.util.Map<java.lang.String, java.lang.Object>)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setConfigLocation-org.springframework.core.io.Resource-"><code>setConfigLocation(org.springframework.core.io.Resource)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-"><code>setResourceLoaderPath(java.lang.String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setVelocityPropertiesMap-java.util.Map-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setVelocityPropertiesMap</h4> |
| <pre>public void setVelocityPropertiesMap(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>> velocityPropertiesMap)</pre> |
| <div class="block">Set Velocity properties as Map, to allow for non-String values |
| like "ds.resource.loader.instance".</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityProperties-java.util.Properties-"><code>setVelocityProperties(java.util.Properties)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setResourceLoaderPath-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setResourceLoaderPath</h4> |
| <pre>public void setResourceLoaderPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</pre> |
| <div class="block">Set the Velocity resource loader path via a Spring resource location. |
| Accepts multiple locations in Velocity's comma-separated path style. |
| <p>When populated via a String, standard URLs like "file:" and "classpath:" |
| pseudo URLs are supported, as understood by ResourceLoader. Allows for |
| relative paths when running in an ApplicationContext. |
| <p>Will define a path for the default Velocity resource loader with the name |
| "file". If the specified resource cannot be resolved to a <code>java.io.File</code>, |
| a generic SpringResourceLoader will be used under the name "spring", without |
| modification detection. |
| <p>Note that resource caching will be enabled in any case. With the file |
| resource loader, the last-modified timestamp will be checked on access to |
| detect changes. With SpringResourceLoader, the resource will be cached |
| forever (for example for class path resources). |
| <p>To specify a modification check interval for files, use Velocity's |
| standard "file.resource.loader.modificationCheckInterval" property. By default, |
| the file timestamp is checked on every access (which is surprisingly fast). |
| Of course, this just applies when loading resources from the file system. |
| <p>To enforce the use of SpringResourceLoader, i.e. to not resolve a path |
| as file system resource in any case, turn off the "preferFileSystemAccess" |
| flag. See the latter's javadoc for details.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoader-org.springframework.core.io.ResourceLoader-"><code>setResourceLoader(org.springframework.core.io.ResourceLoader)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setVelocityProperties-java.util.Properties-"><code>setVelocityProperties(java.util.Properties)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setPreferFileSystemAccess-boolean-"><code>setPreferFileSystemAccess(boolean)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/SpringResourceLoader.html" title="class in org.apache.velocity.spring"><code>SpringResourceLoader</code></a>, |
| <a href="../../../../org/apache/velocity/runtime/resource/loader/FileResourceLoader.html" title="class in org.apache.velocity.runtime.resource.loader"><code>FileResourceLoader</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setResourceLoader-org.springframework.core.io.ResourceLoader-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setResourceLoader</h4> |
| <pre>public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)</pre> |
| <div class="block">Set the Spring ResourceLoader to use for loading Velocity template files. |
| The default is DefaultResourceLoader. Will get overridden by the |
| ApplicationContext if running in a context.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>DefaultResourceLoader</code>, |
| <code>ApplicationContext</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getResourceLoader--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getResourceLoader</h4> |
| <pre>protected org.springframework.core.io.ResourceLoader getResourceLoader()</pre> |
| <div class="block">Return the Spring ResourceLoader to use for loading Velocity template files.</div> |
| </li> |
| </ul> |
| <a name="setPreferFileSystemAccess-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setPreferFileSystemAccess</h4> |
| <pre>public void setPreferFileSystemAccess(boolean preferFileSystemAccess)</pre> |
| <div class="block">Set whether to prefer file system access for template loading. |
| File system access enables hot detection of template changes. |
| <p>If this is enabled, VelocityEngineFactory will try to resolve the |
| specified "resourceLoaderPath" as file system resource (which will work |
| for expanded class path resources and ServletContext resources too). |
| <p>Default is "true". Turn this off to always load via SpringResourceLoader |
| (i.e. as stream, without hot detection of template changes), which might |
| be necessary if some of your templates reside in an expanded classes |
| directory while others reside in jar files.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#setResourceLoaderPath-java.lang.String-"><code>setResourceLoaderPath(java.lang.String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isPreferFileSystemAccess--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPreferFileSystemAccess</h4> |
| <pre>protected boolean isPreferFileSystemAccess()</pre> |
| <div class="block">Return whether to prefer file system access for template loading.</div> |
| </li> |
| </ul> |
| <a name="createVelocityEngine--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createVelocityEngine</h4> |
| <pre>public <a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> createVelocityEngine() |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, |
| <a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></pre> |
| <div class="block">Prepare the VelocityEngine instance and return it.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the VelocityEngine instance</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if the config file wasn't found</dd> |
| <dd><code><a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></code> - on Velocity initialization failure</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="newVelocityEngine--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newVelocityEngine</h4> |
| <pre>protected <a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> newVelocityEngine() |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, |
| <a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></pre> |
| <div class="block">Return a new VelocityEngine. Subclasses can override this for |
| custom initialization, or for using a mock object for testing. |
| <p>Called by <code>createVelocityEngine()</code>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the VelocityEngine instance</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if a config file wasn't found</dd> |
| <dd><code><a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></code> - on Velocity initialization failure</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#createVelocityEngine--"><code>createVelocityEngine()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="initVelocityResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>initVelocityResourceLoader</h4> |
| <pre>protected void initVelocityResourceLoader(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</pre> |
| <div class="block">Initialize a Velocity resource loader for the given VelocityEngine: |
| either a standard Velocity FileResourceLoader or a SpringResourceLoader. |
| <p>Called by <code>createVelocityEngine()</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>velocityEngine</code> - the VelocityEngine to configure</dd> |
| <dd><code>resourceLoaderPath</code> - the path to load Velocity resources from</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/runtime/resource/loader/FileResourceLoader.html" title="class in org.apache.velocity.runtime.resource.loader"><code>FileResourceLoader</code></a>, |
| <a href="../../../../org/apache/velocity/spring/SpringResourceLoader.html" title="class in org.apache.velocity.spring"><code>SpringResourceLoader</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#initSpringResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-"><code>initSpringResourceLoader(org.apache.velocity.app.VelocityEngine, java.lang.String)</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#createVelocityEngine--"><code>createVelocityEngine()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="initSpringResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>initSpringResourceLoader</h4> |
| <pre>protected void initSpringResourceLoader(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> resourceLoaderPath)</pre> |
| <div class="block">Initialize a SpringResourceLoader for the given VelocityEngine. |
| <p>Called by <code>initVelocityResourceLoader</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>velocityEngine</code> - the VelocityEngine to configure</dd> |
| <dd><code>resourceLoaderPath</code> - the path to load Velocity resources from</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/SpringResourceLoader.html" title="class in org.apache.velocity.spring"><code>SpringResourceLoader</code></a>, |
| <a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#initVelocityResourceLoader-org.apache.velocity.app.VelocityEngine-java.lang.String-"><code>initVelocityResourceLoader(org.apache.velocity.app.VelocityEngine, java.lang.String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="postProcessVelocityEngine-org.apache.velocity.app.VelocityEngine-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>postProcessVelocityEngine</h4> |
| <pre>protected void postProcessVelocityEngine(<a href="../../../../org/apache/velocity/app/VelocityEngine.html" title="class in org.apache.velocity.app">VelocityEngine</a> velocityEngine) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, |
| <a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></pre> |
| <div class="block">To be implemented by subclasses that want to perform custom |
| post-processing of the VelocityEngine after this FactoryBean |
| performed its default configuration (but before VelocityEngine.init). |
| <p>Called by <code>createVelocityEngine()</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>velocityEngine</code> - the current VelocityEngine</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if a config file wasn't found</dd> |
| <dd><code><a href="../../../../org/apache/velocity/exception/VelocityException.html" title="class in org.apache.velocity.exception">VelocityException</a></code> - on Velocity initialization failure</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/velocity/spring/VelocityEngineFactory.html#createVelocityEngine--"><code>createVelocityEngine()</code></a>, |
| <a href="../../../../org/apache/velocity/app/VelocityEngine.html#init--"><code>VelocityEngine.init()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/VelocityEngineFactory.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/velocity/spring/SpringResourceLoader.html" title="class in org.apache.velocity.spring"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/velocity/spring/VelocityEngineFactoryBean.html" title="class in org.apache.velocity.spring"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/velocity/spring/VelocityEngineFactory.html" target="_top">Frames</a></li> |
| <li><a href="VelocityEngineFactory.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2000–2021 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |