EscapeVelocity 0.9.1
Added more features for closer compatibility with Apache Velocity 1.7.
-
$foreach.index
in addition to the existing$foreach.hasNext
. -
Strings with single quotes
'foo'
in addition to the existing double quotes"foo"
. Also, within double quotes (but not single ones) references are expanded, as in"Impl_$p"
. -
Commas are optionally allowed between parameters in macro calls. The Velocity documentation doesn't mention this but the implementation allows it.
-
It is not an error if a block comment
#*
is not closed before the end of the file, again consistently with Velocity. -
$map.key
is equivalent to$map["key"]
when$map
is ajava.util.Map
. -
Static methods can be called on
Class
objects. For example, if$Thread
has been set equal tojava.lang.Thread.class
then$Thread.yield()
is a valid method call.
Also, optimized method lookup for references like $foo.bar()
. This makes template evaluation twice as fast on some benchmarks.