Releases: google/escapevelocity
EscapeVelocity 1.1
Several Velocity features are newly supported:
- Macro invocation like
#@foo() ... #end, where the...is available in the body of thefoomacro as$bodyContent. (bc4ab4a) - The
#breakdirective, though#break($foreach.parent)remains unsupported. (014eb69) - The
#evaluatedirective. (bec0a84) - The
#definedirective. (18d40b1) - We now allow both
#foreach ($x in ...)and#foreach (${x} in ...). (3695313)
Also:
EscapeVelocity 1.0
Many changes for greater compatibility with Apache Velocity 1.7.
#parsedirectives now take effect when the containing template is evaluated rather than when it is parsed. That means that the argument no longer has to be a constant string. (f34d95b)- An unrecognized
#directiveis now ignored rather than causing an exception. (a0ae2ba) - The
$foreachvariable, defined in#foreachloops, now supports$foreach.count,$foreach.first, and$foreach.last, in addition to.hasNextand.indexwhich were already supported. (0c7d704) - String concatenation with
+is now supported. (String interpolation was already supported.) (c6e256a) - The words
and,or,notcan be used as synonyms for&&,||,!respectively. (d2c4514) - Added support for list and range literals,
[1, 2, 3]and[1..100]. (7b2e154) - The handling of whitespace before
#setis now closer to (and perhaps identical to) Velocity's. (ebf6a94) - Null-handling is more like Velocity, in particular with the
$!foosyntax. (6e2a874)
EscapeVelocity 0.9.1
Added more features for closer compatibility with Apache Velocity 1.7.
-
$foreach.indexin 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.keyis equivalent to$map["key"]when$mapis ajava.util.Map. -
Static methods can be called on
Classobjects. For example, if$Threadhas been set equal tojava.lang.Thread.classthen$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.
EscapeVelocity 0.9
This is the initial release. Previously this code was part of AutoValue, where it has existed for several years.