Reputation: 1135
I am using intellij IDEA
, and I want to custom getter template.
The code is like this, looks like some kind of template language
public ##
#if($field.modifierStatic)
static ##
#end
$field.type ##
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project))))
#if ($field.boolean && $field.primitive)
#if ($StringUtil.startsWithIgnoreCase($name, 'is'))
#set($name = $StringUtil.decapitalize($name))
#else
is##
#end
#else
get##
#end
${name}() {
return $field.name;
}
But I can`t find any reference or tutorial, could you give me some info about it?
Upvotes: 2
Views: 102
Reputation: 1135
after a long search, I find it is base on velocity
Velocity is a Java-based template engine. It permits anyone to use a simple yet powerful template language to reference objects defined in Java code.
Upvotes: 2