IDEA setter 方法模板修改,对String进行判空和trim()

#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
#if ($field.String)
    $field.name = $paramName ## 
     == null ? null :$paramName.##
     trim();
#else
    $field.name = $paramName;
#end
}

你可能感兴趣的:(开发工具)