本文整理汇总了Java中org.mybatis.generator.internal.util.StringUtility类的典型用法代码示例。如果您正苦于以下问题:Java StringUtility类的具体用法?Java StringUtility怎么用?Java StringUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtility类属于org.mybatis.generator.internal.util包,在下文中一共展示了StringUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validate
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public boolean validate(List<String> warnings) {
this.searchString = this.properties.getProperty("searchString");
this.replaceString = this.properties.getProperty("replaceString");
valid = StringUtility.stringHasValue(this.searchString) && StringUtility.stringHasValue(this.replaceString);
if(valid) {
this.pattern = Pattern.compile(this.searchString);
} else {
// if(!StringUtility.stringHasValue(this.searchString)) {
// warnings.add(Messages.getString("ValidationError.18", "RenameExampleClassPlugin", "searchString"));
// }
//
// if(!StringUtility.stringHasValue(this.replaceString)) {
// warnings.add(Messages.getString("ValidationError.18", "RenameExampleClassPlugin", "replaceString"));
// }
}
return true;
}
开发者ID:ychaoyang,项目名称:autotest,代码行数:19,代码来源:RenameExampleClassPlugin.java示例2: addModelClassComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
if (!this.suppressAllComments && this.addRemarkComments) {
StringBuilder sb = new StringBuilder();
topLevelClass.addJavaDocLine("/**");
String remarks = introspectedTable.getRemarks();
if (this.addRemarkComments && StringUtility.stringHasValue(remarks)) {
topLevelClass.addJavaDocLine(" * Database Table Remarks:");
String[] remarkLines = remarks.split(System.getProperty("line.separator"));
String[] var6 = remarkLines;
int var7 = remarkLines.length;
for (int var8 = 0; var8 < var7; ++var8) {
String remarkLine = var6[var8];
topLevelClass.addJavaDocLine(" * " + remarkLine);
}
}
topLevelClass.addJavaDocLine(" *");
topLevelClass.addJavaDocLine(" * This class was generated by MyBatis Generator.");
sb.append(" * This class corresponds to the database table ");
sb.append(introspectedTable.getFullyQualifiedTable());
topLevelClass.addJavaDocLine(sb.toString());
this.addJavadocTag(topLevelClass, true);
topLevelClass.addJavaDocLine(" */");
}
}
开发者ID:ychaoyang,项目名称:autotest,代码行数:27,代码来源:DefaultCommentGenerator.java示例3: addConfigurationProperties
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addConfigurationProperties(Properties properties) {
this.properties.putAll(properties);
suppressDate = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE));
suppressAllComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_ALL_COMMENTS));
addRemarkComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_ADD_REMARK_COMMENTS));
String dateFormatString = properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_DATE_FORMAT);
if (StringUtility.stringHasValue(dateFormatString)) {
dateFormat = new SimpleDateFormat(dateFormatString);
}
}
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:18,代码来源:DefaultCommentGenerator.java示例4: addGetterComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* getter方法注释
*
* @param method
* @param introspectedTable
* @param introspectedColumn
*/
public void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
StringBuilder sb = new StringBuilder();
method.addJavaDocLine("/**");
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" * 获取");
sb.append(introspectedColumn.getRemarks());
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" *");
}
sb.setLength(0);
sb.append(" * @return ");
sb.append(introspectedColumn.getActualColumnName());
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" - ");
sb.append(introspectedColumn.getRemarks());
}
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" */");
}
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:27,代码来源:MapperCommentGenerator.java示例5: addSetterComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* setter方法注释
*
* @param method
* @param introspectedTable
* @param introspectedColumn
*/
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
StringBuilder sb = new StringBuilder();
method.addJavaDocLine("/**");
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" * 设置");
sb.append(introspectedColumn.getRemarks());
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" *");
}
Parameter parm = method.getParameters().get(0);
sb.setLength(0);
sb.append(" * @param ");
sb.append(parm.getName());
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" ");
sb.append(introspectedColumn.getRemarks());
}
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" */");
}
开发者ID:godlike110,项目名称:tk-mybatis,代码行数:28,代码来源:MapperCommentGenerator.java示例6: addConfigurationProperties
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addConfigurationProperties(Properties properties) {
this.properties.putAll(properties);
suppressDate = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE));
suppressAllComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_ALL_COMMENTS));
addRemarkComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_ADD_REMARK_COMMENTS));
String dateFormatString = properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_DATE_FORMAT);
if (StringUtility.stringHasValue(dateFormatString)) {
dateFormat = new SimpleDateFormat(dateFormatString);
}
}
开发者ID:comboent,项目名称:mbg-extend,代码行数:18,代码来源:SimpleCommentGenerator.java示例7: addFieldComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addFieldComment(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn) {
if (suppressAllComments) {
return;
}
String remarks = introspectedColumn.getRemarks();
if (!StringUtility.stringHasValue(remarks)) {
return;
}
field.addJavaDocLine("/**"); //$NON-NLS-1$
String lineSep = System.getProperty("line.separator");
if (StringUtility.stringHasValue(remarks)) {
String[] remarkLines = remarks.split(lineSep); //$NON-NLS-1$
for (String remarkLine : remarkLines) {
field.addJavaDocLine(" * " + remarkLine); //$NON-NLS-1$
}
}
field.addJavaDocLine(" */"); //$NON-NLS-1$
}
开发者ID:comboent,项目名称:mbg-extend,代码行数:26,代码来源:SimpleCommentGenerator.java示例8: getTools
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* 获取工具
* @param context
* @param introspectedTable
* @param warnings
* @return
*/
public static IncrementsPluginTools getTools(Context context, IntrospectedTable introspectedTable, List<String> warnings) {
IncrementsPluginTools tools = new IncrementsPluginTools(context, introspectedTable);
// 判断是否启用了插件
if (PluginTools.getPluginConfiguration(context, IncrementsPlugin.class) != null) {
String incrementsColumns = introspectedTable.getTableConfigurationProperty(IncrementsPlugin.PRO_INCREMENTS_COLUMNS);
if (StringUtility.stringHasValue(incrementsColumns)) {
// 切分
String[] incrementsColumnsStrs = incrementsColumns.split(",");
for (String incrementsColumnsStr : incrementsColumnsStrs) {
IntrospectedColumn column = IntrospectedTableTools.safeGetColumn(introspectedTable, incrementsColumnsStr);
if (column == null) {
warnings.add("itfsw:插件" + IncrementsPlugin.class.getTypeName() + "插件没有找到column为" + incrementsColumnsStr.trim() + "的字段!");
} else {
tools.columns.add(column);
}
}
}
}
return tools;
}
开发者ID:itfsw,项目名称:mybatis-generator-plugin,代码行数:28,代码来源:IncrementsPluginTools.java示例9: safeGetColumn
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* 安全获取column 通过正则获取的name可能包含beginningDelimiter&&endingDelimiter
*
* @param introspectedTable
* @param columnName
* @return
*/
public static IntrospectedColumn safeGetColumn(IntrospectedTable introspectedTable, String columnName) {
// columnName
columnName = columnName.trim();
// 过滤
String beginningDelimiter = introspectedTable.getContext().getBeginningDelimiter();
if (StringUtility.stringHasValue(beginningDelimiter)) {
columnName = columnName.replaceFirst("^" + beginningDelimiter, "");
}
String endingDelimiter = introspectedTable.getContext().getEndingDelimiter();
if (StringUtility.stringHasValue(endingDelimiter)) {
columnName = columnName.replaceFirst(endingDelimiter + "$", "");
}
return introspectedTable.getColumn(columnName);
}
开发者ID:itfsw,项目名称:mybatis-generator-plugin,代码行数:23,代码来源:IntrospectedTableTools.java示例10: validate
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public boolean validate(List<String> warnings) {
// 插件使用前提是数据库为MySQL
if ("com.mysql.jdbc.Driver".equalsIgnoreCase(this.getContext().getJdbcConnectionConfiguration().getDriverClass()) == false) {
warnings.add("itfsw:插件" + this.getClass().getTypeName() + "插件使用前提是数据库为MySQL!");
return false;
}
// 插件是否开启了多sql提交
Properties properties = this.getProperties();
String allowMultiQueries = properties.getProperty(PRO_ALLOW_MULTI_QUERIES);
this.allowMultiQueries = allowMultiQueries == null ? false : StringUtility.isTrue(allowMultiQueries);
if (this.allowMultiQueries) {
// 提示用户注意信息
warnings.add("itfsw:插件" + this.getClass().getTypeName() + "插件您开启了allowMultiQueries支持,注意在jdbc url 配置中增加“allowMultiQueries=true”支持(不怎么建议使用该功能,开启多sql提交会增加sql注入的风险,请确保你所有sql都使用MyBatis书写,请不要使用statement进行sql提交)!");
}
return super.validate(warnings);
}
开发者ID:itfsw,项目名称:mybatis-generator-plugin,代码行数:24,代码来源:UpsertPlugin.java示例11: addConfigurationProperties
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addConfigurationProperties(Properties properties) {
this.properties.putAll(properties);
suppressDate = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE));
suppressAllComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_ALL_COMMENTS));
addRemarkComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_ADD_REMARK_COMMENTS));
String dateFormatString = properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_DATE_FORMAT);
if (StringUtility.stringHasValue(dateFormatString)) {
dateFormat = new SimpleDateFormat(dateFormatString);
}
//添加作者配置
String authorString = properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_AUTHOR);
if (StringUtility.stringHasValue(authorString)) {
author = authorString;
}
}
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:24,代码来源:DefaultCommentGenerator.java示例12: addSetterComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
StringBuilder sb = new StringBuilder();
method.addJavaDocLine("/**");
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" * 设置");
sb.append(introspectedColumn.getRemarks());
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" *");
}
Parameter param = (Parameter)method.getParameters().get(0);
sb.setLength(0);
sb.append(" * @param ");
sb.append(param.getName());
if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
sb.append(" ");
sb.append(introspectedColumn.getRemarks());
}
method.addJavaDocLine(sb.toString());
method.addJavaDocLine(" */");
}
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:23,代码来源:MyCommentGenerator.java示例13: addConfigurationProperties
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
@Override
public void addConfigurationProperties(Properties properties) {
this.properties.putAll(properties);
suppressDate = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE));
suppressAllComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_ALL_COMMENTS));
addRemarkComments = isTrue(properties
.getProperty(PropertyRegistry.COMMENT_GENERATOR_ADD_REMARK_COMMENTS));
String dateFormatString = properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_DATE_FORMAT);
if (StringUtility.stringHasValue(dateFormatString)) {
dateFormat = new SimpleDateFormat(dateFormatString);
}
}
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:19,代码来源:DefaultCommentGenerator.java示例14: validate
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
@Override
public boolean validate(List<String> warnings) {
boolean valid = true;
if (!StringUtility.stringHasValue(this.properties.getProperty("targetProject"))) {
warnings.add(Messages.getString("ValidationError.18", "MapperConfigPlugin", "targetProject"));
valid = false;
}
if (!StringUtility.stringHasValue(this.properties.getProperty("targetPackage"))) {
warnings.add(Messages.getString("ValidationError.18", "MapperConfigPlugin", "targetPackage"));
valid = false;
}
return valid;
}
开发者ID:ychaoyang,项目名称:autotest,代码行数:16,代码来源:MapperConfigPlugin.java示例15: addConfigurationProperties
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addConfigurationProperties(Properties properties) {
this.properties.putAll(properties);
this.suppressDate = StringUtility.isTrue(properties.getProperty("suppressDate"));
this.suppressAllComments = StringUtility.isTrue(properties.getProperty("suppressAllComments"));
this.addRemarkComments = StringUtility.isTrue(properties.getProperty("addRemarkComments"));
String dateFormatString = properties.getProperty("dateFormat");
if (StringUtility.stringHasValue(dateFormatString)) {
this.dateFormat = new SimpleDateFormat(dateFormatString);
}
}
开发者ID:ychaoyang,项目名称:autotest,代码行数:12,代码来源:DefaultCommentGenerator.java本文标签属性:
示例:示例志愿表
代码:代码是什么
java:java模拟器
StringUtility:StringUtility