camelCase name in file template
Answered
Hi!
I want to create file name template. Here is 1 example: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206853275-File-templates-lower-upper-camel-case
#set( $NAME_CAMEL = ${StringUtils.removeAndHump( ${NAME} )} )
But it no longer works. It just leaves the case as it is.
So I tried to use alternative way
${ Character.toLowerCase(${NAME}.charAt(0)) + ${NAME}.substring(1)}
But Intellij says:
Unable to parse template "VtjPersonHandler" Error message: org.apache.velocity.runtime.parser.TemplateParseException: Encountered " " at MyTemplate[line 1, column 23] Was expecting:
How do I fix that?
Please sign in to leave a comment.
So basically, you want to have a class named MyClass, and the file itself named myClass.java, correct?
Rain
Inside the template, you can use this code:
Thanks, that helped.