getset idea generation method, String trim its operation type

Need to generate a java class in their field get and set methods, there will inevitably be left blank type String, so here trim its operating field of type String
template needs to be rewritten to generate get and set

1.alt + insert generate pop-up box, select getter and setter
Here Insert Picture Description
2. Select behind setter template of ...

3. Adding a new template
Here Insert Picture Description
4 template code

#set($paramName = $helper.getParamName($field, $project))
#if($field.modifierStatic)
static ##
#end
void set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) {
#if ($field.name == $paramName)
    #if (!$field.modifierStatic)
    this.##
    #else
        $classname.##
    #end
#end
$field.name = ##
#if($field.string)
    $paramName == null ? null : $paramName.##
trim();
#else
    $paramName;
#end
}

5. Finished FIG.

Here Insert Picture Description

Template code from https://blog.csdn.net/qq_17457105/article/details/78137159

Guess you like

Origin blog.csdn.net/u010996565/article/details/93721423