类 MarkupTool
java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.MarkupTool
- 所有已实现的接口:
Serializable
NOTE: This tools is considered "alpha" quality due to lack of testing
and a generally unpolished API. Feel free to use but expect changes.
Also, this is not automatically provided via the default tools.xml file.
A tool to make it easy to generate XML or HTML on the fly. It uses a CSS-type syntax with a vaguely jQuery-ish API to help you generate the markup you need.
Example uses in a template:
#set( $foospan = $markup.span.id($foo.id).body($foo) )
$markup.tag('table tr.bar td').body("This is $foospan")
Output:
<table>
<tr class="bar">
<td>This is <span id="foo1">my first foo.</span></td>
</tr>
</table>
Example tools.xml config:
<tools>
<toolbox scope="application">
<tool class="org.apache.velocity.tools.generic.alpha.MarkupTool"/>
</toolbox>
</tools>
- 从以下版本开始:
- VelocityTools 2.0
- 版本:
- $Id$
- 作者:
- Nathan Bubna
- 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段从类继承的字段 org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY -
构造器概要
构造器 -
方法概要
从类继承的方法 org.apache.velocity.tools.generic.SafeConfig
configure, configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig, setSafeMode