| <!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_171) on Wed Jun 20 14:25:31 CEST 2018 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>RenderTool (VelocityTools 3.0-SNAPSHOT API)</title> |
| <meta name="date" content="2018-06-20"> |
| <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="RenderTool (VelocityTools 3.0-SNAPSHOT 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/RenderTool.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/tools/generic/NumberTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/ResourceTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/generic/RenderTool.html" target="_top">Frames</a></li> |
| <li><a href="RenderTool.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.tools.generic</div> |
| <h2 title="Class RenderTool" class="title">Class RenderTool</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/7/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><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.velocity.tools.generic.RenderTool</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre><a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</a>(<a href="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value--">value</a>="render") |
| <a href="../../../../../org/apache/velocity/tools/config/InvalidScope.html" title="annotation in org.apache.velocity.tools.config">@InvalidScope</a>(<a href="../../../../../org/apache/velocity/tools/config/InvalidScope.html#value--">value</a>="session") |
| public class <span class="typeNameLabel">RenderTool</span> |
| extends <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></pre> |
| <div class="block">This tool exposes methods to evaluate the given |
| strings as VTL (Velocity Template Language) |
| using either a pre-configured context or one you |
| provide directly. |
| <pre> |
| Example of eval(): |
| Input |
| ----- |
| #set( $list = [1,2,3] ) |
| #set( $object = '$list' ) |
| #set( $method = 'size()' ) |
| $render.eval("${object}.$method") |
| |
| Output |
| ------ |
| 3 |
| |
| Example of recurse(): |
| Input |
| ----- |
| #macro( say_hi )hello world!#end |
| #set( $foo = '#say_hi()' ) |
| #set( $bar = '$foo' ) |
| $render.recurse($bar) |
| |
| Output |
| ------ |
| hello world! |
| |
| |
| Toolbox configuration: |
| <tools> |
| <toolbox scope="request"> |
| <tool class="org.apache.velocity.tools.generic.RenderTool"> |
| <property name="parseDepth" type="number" value="10"/> |
| </tool> |
| </toolbox> |
| </tools> |
| </pre> |
| |
| <p>Ok, so these examples are really lame. But, it seems like |
| someone out there is always asking how to do stuff like this |
| and we always tell them to write a tool. Now we can just tell |
| them to use this tool.</p> |
| |
| <p>This tool may be used in any scope, however, the context provided |
| for the <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-java.lang.String-"><code>eval(String)</code></a> and <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-java.lang.String-"><code>recurse(String)</code></a> methods |
| will only be current if the tool is request scoped. If application or |
| session scoped, then the context will be the same one set at the time |
| of the tool's first use. In such a case, each call to eval(String) or |
| recurse(String) will by default create a new Context that wraps the |
| configured one to prevent modifications to the configured Context |
| (concurrent or otherwise). If you wish to risk it and accrete changes |
| then you can relax the thread-safety by setting the 'forceThreadSafe' |
| property to 'false'. </p> |
| |
| <p>Of course none of the previous paragraph likely applies if you are |
| not using the core tool management facilities or if you stick to the |
| <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-org.apache.velocity.context.Context-java.lang.String-"><code>eval(Context,String)</code></a> and <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-org.apache.velocity.context.Context-java.lang.String-"><code>recurse(Context,String)</code></a> |
| methods. :)</p> |
| |
| <p>This tool by default will catch |
| and log any exceptions thrown during rendering and |
| instead return null in such cases. It also limits recursion, by default, |
| to 20 cycles, to prevent infinite loops. Both settings may be configured |
| to behave otherwise.</p></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Version:</span></dt> |
| <dd>$Revision: 1769770 $ $Date: 2016-11-15 11:34:58 +0100 (mar., 15 nov. 2016) $</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Nathan Bubna</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>static int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#DEFAULT_PARSE_DEPTH">DEFAULT_PARSE_DEPTH</a></span></code> |
| <div class="block">The maximum number of loops allowed when recursing.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#KEY_CATCH_EXCEPTIONS">KEY_CATCH_EXCEPTIONS</a></span></code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#KEY_FORCE_THREAD_SAFE">KEY_FORCE_THREAD_SAFE</a></span></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#KEY_PARSE_DEPTH">KEY_PARSE_DEPTH</a></span></code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#log">log</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOGGER_NAME_KEY">LOGGER_NAME_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#USE_CLASS_LOGGER_KEY">USE_CLASS_LOGGER_KEY</a></code></li> |
| </ul> |
| </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/tools/generic/RenderTool.html#RenderTool--">RenderTool</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>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></span>(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> parser)</code> |
| <div class="block">Looks for deprecated parse depth and catch.exceptions properties, |
| as well as any 'forceThreadSafe' setting.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-org.apache.velocity.context.Context-java.lang.String-">eval</a></span>(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl)</code> |
| <div class="block">Evaluates a String containing VTL using the current context, |
| and returns the result as a String.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-java.lang.String-">eval</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl)</code> |
| <div class="block">Evaluates a String containing VTL using the context passed |
| to the <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#setVelocityContext-org.apache.velocity.context.Context-"><code>setVelocityContext(org.apache.velocity.context.Context)</code></a> method.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#getCatchExceptions--">getCatchExceptions</a></span>()</code> |
| <div class="block">Returns <code>true</code> if this render() and eval() methods will |
| catch exceptions thrown during rendering.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#getParseDepth--">getParseDepth</a></span>()</code> |
| <div class="block">Get the maximum number of loops allowed when recursing.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#internalEval-org.apache.velocity.context.Context-java.lang.String-">internalEval</a></span>(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl)</code> </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#internalRecurse-org.apache.velocity.context.Context-java.lang.String-int-">internalRecurse</a></span>(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl, |
| int count)</code> </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-org.apache.velocity.context.Context-java.lang.String-">recurse</a></span>(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl)</code> |
| <div class="block">Recursively evaluates a String containing VTL using the |
| current context, and returns the result as a String.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-java.lang.String-">recurse</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl)</code> |
| <div class="block">Recursively evaluates a String containing VTL using the |
| current context, and returns the result as a String.</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/tools/generic/RenderTool.html#setCatchExceptions-boolean-">setCatchExceptions</a></span>(boolean catchExceptions)</code> |
| <div class="block">Sets whether or not the render() and eval() methods should catch |
| exceptions during their execution or not.</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/tools/generic/RenderTool.html#setParseDepth-int-">setParseDepth</a></span>(int depth)</code> |
| <div class="block">Set the maximum number of loops allowed when recursing.</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/tools/generic/RenderTool.html#setVelocityContext-org.apache.velocity.context.Context-">setVelocityContext</a></span>(org.apache.velocity.context.Context context)</code> |
| <div class="block">Sets the <code>Context</code> to be used by the <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-java.lang.String-"><code>eval(String)</code></a> |
| and <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-java.lang.String-"><code>recurse(String)</code></a> methods.</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/tools/generic/RenderTool.html#setVelocityEngine-org.apache.velocity.app.VelocityEngine-">setVelocityEngine</a></span>(org.apache.velocity.app.VelocityEngine ve)</code> |
| <div class="block">Allow user to specify a VelocityEngine to be used |
| in place of the Velocity singleton.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3> |
| <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-java.util.Map-">configure</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#getLog--">getLog</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#initLogger-org.apache.velocity.tools.generic.ValueParser-">initLogger</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked--">isConfigLocked</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode--">isSafeMode</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig-boolean-">setLockConfig</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode-boolean-">setSafeMode</a></code></li> |
| </ul> |
| <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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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="DEFAULT_PARSE_DEPTH"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DEFAULT_PARSE_DEPTH</h4> |
| <pre>public static final int DEFAULT_PARSE_DEPTH</pre> |
| <div class="block">The maximum number of loops allowed when recursing.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.2</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.RenderTool.DEFAULT_PARSE_DEPTH">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="KEY_PARSE_DEPTH"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>KEY_PARSE_DEPTH</h4> |
| <pre><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> |
| public static final <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> KEY_PARSE_DEPTH</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.RenderTool.KEY_PARSE_DEPTH">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="KEY_CATCH_EXCEPTIONS"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>KEY_CATCH_EXCEPTIONS</h4> |
| <pre><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> |
| public static final <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> KEY_CATCH_EXCEPTIONS</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.RenderTool.KEY_CATCH_EXCEPTIONS">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="KEY_FORCE_THREAD_SAFE"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>KEY_FORCE_THREAD_SAFE</h4> |
| <pre>public static final <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> KEY_FORCE_THREAD_SAFE</pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.RenderTool.KEY_FORCE_THREAD_SAFE">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="RenderTool--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>RenderTool</h4> |
| <pre>public RenderTool()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="configure-org.apache.velocity.tools.generic.ValueParser-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>configure</h4> |
| <pre>protected void configure(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a> parser)</pre> |
| <div class="block">Looks for deprecated parse depth and catch.exceptions properties, |
| as well as any 'forceThreadSafe' setting.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></code> in class <code><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setVelocityEngine-org.apache.velocity.app.VelocityEngine-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setVelocityEngine</h4> |
| <pre>public void setVelocityEngine(org.apache.velocity.app.VelocityEngine ve)</pre> |
| <div class="block">Allow user to specify a VelocityEngine to be used |
| in place of the Velocity singleton.</div> |
| </li> |
| </ul> |
| <a name="setParseDepth-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setParseDepth</h4> |
| <pre>public void setParseDepth(int depth)</pre> |
| <div class="block">Set the maximum number of loops allowed when recursing.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setVelocityContext-org.apache.velocity.context.Context-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setVelocityContext</h4> |
| <pre>public void setVelocityContext(org.apache.velocity.context.Context context)</pre> |
| <div class="block">Sets the <code>Context</code> to be used by the <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-java.lang.String-"><code>eval(String)</code></a> |
| and <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#recurse-java.lang.String-"><code>recurse(String)</code></a> methods.</div> |
| </li> |
| </ul> |
| <a name="getParseDepth--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getParseDepth</h4> |
| <pre>public int getParseDepth()</pre> |
| <div class="block">Get the maximum number of loops allowed when recursing.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setCatchExceptions-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCatchExceptions</h4> |
| <pre>public void setCatchExceptions(boolean catchExceptions)</pre> |
| <div class="block">Sets whether or not the render() and eval() methods should catch |
| exceptions during their execution or not.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.3</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCatchExceptions--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCatchExceptions</h4> |
| <pre>public boolean getCatchExceptions()</pre> |
| <div class="block">Returns <code>true</code> if this render() and eval() methods will |
| catch exceptions thrown during rendering.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>VelocityTools 1.3</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="eval-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>eval</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> eval(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <div class="block"><p>Evaluates a String containing VTL using the context passed |
| to the <a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#setVelocityContext-org.apache.velocity.context.Context-"><code>setVelocityContext(org.apache.velocity.context.Context)</code></a> method. If this tool is request |
| scoped, then this will be the current context and open to modification |
| by the rendered VTL. If application or session scoped, the context |
| will be a new wrapper around the configured context to protect it |
| from modification. |
| The results of the rendering are returned as a String. By default, |
| <code>null</code> will be returned when this throws an exception. |
| This evaluation is not recursive.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>vtl</code> - the code to be evaluated</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the evaluated code as a String</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="recurse-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>recurse</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> recurse(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <div class="block"><p>Recursively evaluates a String containing VTL using the |
| current context, and returns the result as a String. It |
| will continue to re-evaluate the output of the last |
| evaluation until an evaluation returns the same code |
| that was fed into it.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>vtl</code> - the code to be evaluated</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the evaluated code as a String</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/velocity/tools/generic/RenderTool.html#eval-java.lang.String-"><code>eval(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="eval-org.apache.velocity.context.Context-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>eval</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> eval(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <div class="block"><p>Evaluates a String containing VTL using the current context, |
| and returns the result as a String. By default if this fails, then |
| <code>null</code> will be returned, though this tool can be configured |
| to let Exceptions pass through. This evaluation is not recursive.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - the current Context</dd> |
| <dd><code>vtl</code> - the code to be evaluated</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the evaluated code as a String</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="internalEval-org.apache.velocity.context.Context-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>internalEval</h4> |
| <pre>protected <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> internalEval(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="recurse-org.apache.velocity.context.Context-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>recurse</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> recurse(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <div class="block"><p>Recursively evaluates a String containing VTL using the |
| current context, and returns the result as a String. It |
| will continue to re-evaluate the output of the last |
| evaluation until an evaluation returns the same code |
| that was fed into it or the number of recursive loops |
| exceeds the set parse depth.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - the current Context</dd> |
| <dd><code>vtl</code> - the code to be evaluated</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the evaluated code as a String</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="internalRecurse-org.apache.velocity.context.Context-java.lang.String-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>internalRecurse</h4> |
| <pre>protected <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> internalRecurse(org.apache.velocity.context.Context ctx, |
| <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> vtl, |
| int count) |
| throws <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></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/RenderTool.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/tools/generic/NumberTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/velocity/tools/generic/ResourceTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/velocity/tools/generic/RenderTool.html" target="_top">Frames</a></li> |
| <li><a href="RenderTool.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 © 2002–2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |