How to execute functions in file templates? Follow
I simply want to camelcase the filename. I can't find any ressources on this.
Here's what I tried:
#set( $name = camelCase($NAME) )
$name
#set( $name = $camelCase($NAME) )
$name
#set( $name = $camelCase$NAME )
$name
#set( $name = camelCase$NAME )
$name
None of these works.
Please sign in to leave a comment.
Hi there,
Few more examples (code is for PHP, but that should make no difference for you):
File Templates use Apache Velocity template language (http://velocity.apache.org/). You can try using Apache Velocity StringUtils methods in your file templates. For example:
Standard java String functions can also be used - see http://stackoverflow.com/questions/6998412/velocity-string-function, for example.
Another example:
I guess it might be done better now (some better/standard Java function may exist), I wrote this back in 2012 or so (8 years ago)