Velocity string function

后端 未结 4 816
臣服心动
臣服心动 2020-12-30 19:52

I just start using Java Velocity. Now I want to create a java class template.

package $app.package_namespace
public class ${app.name}Station

{
    #foreac         


        
4条回答
  •  隐瞒了意图╮
    2020-12-30 20:36

    You can invoke standard java methods on these objects. If s_attribute.name is type String you can directly use $s_attribute.name.toUpperCase() or for your specific case use $s_attribute.name.substring(0,1).toUpperCase() and $s_attribute.name.substring(1).toLowerCase()

提交回复
热议问题