本文整理汇总了Java中org.mybatis.generator.internal.util.StringUtility类的典型用法代码示例。如果您正苦于以下问题:Java StringUtility类的具体用法?Java StringUtility怎么用?Java StringUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtility类属于org.mybatis.generator.internal.util包,在下文中一共展示了StringUtility类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: addFieldComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
if (!this.suppressAllComments) {
field.addJavaDocLine("/**");
String remarks = introspectedColumn.getRemarks();
if (this.addRemarkComments && StringUtility.stringHasValue(remarks)) {
field.addJavaDocLine(" * Database Column 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];
field.addJavaDocLine(" * " + remarkLine);
}
}
field.addJavaDocLine(" *");
field.addJavaDocLine(" * This field was generated by MyBatis Generator.");
StringBuilder sb = new StringBuilder();
sb.append(" * This field corresponds to the database column ");
sb.append(introspectedTable.getFullyQualifiedTable());
sb.append('.');
sb.append(introspectedColumn.getActualColumnName());
field.addJavaDocLine(sb.toString());
this.addJavadocTag(field, false);
field.addJavaDocLine(" */");
}
}
开发者ID:ychaoyang,项目名称:autotest,代码行数:29,代码来源:DefaultCommentGenerator.java
示例17: BaseRules
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
/**
* Instantiates a new base rules.
*
* @param introspectedTable
* the introspected table
*/
public BaseRules(IntrospectedTable introspectedTable) {
super();
this.introspectedTable = introspectedTable;
this.tableConfiguration = introspectedTable.getTableConfiguration();
String modelOnly = tableConfiguration.getProperty(PropertyRegistry.TABLE_MODEL_ONLY);
isModelOnly = StringUtility.isTrue(modelOnly);
}
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:14,代码来源:BaseRules.java
示例18: addModelClassComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
@Override
public void addModelClassComment(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable) {
if (suppressAllComments || !addRemarkComments) {
return;
}
StringBuilder sb = new StringBuilder();
topLevelClass.addJavaDocLine("/**"); //$NON-NLS-1$
String remarks = introspectedTable.getRemarks();
if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
topLevelClass.addJavaDocLine(" * Database Table Remarks:");
String[] remarkLines = remarks.split(System.getProperty("line.separator")); //$NON-NLS-1$
for (String remarkLine : remarkLines) {
topLevelClass.addJavaDocLine(" * " + remarkLine); //$NON-NLS-1$
}
}
topLevelClass.addJavaDocLine(" *"); //$NON-NLS-1$
topLevelClass
.addJavaDocLine(" * This class was generated by MyBatis Generator."); //$NON-NLS-1$
sb.append(" * This class corresponds to the database table "); //$NON-NLS-1$
sb.append(introspectedTable.getFullyQualifiedTable());
topLevelClass.addJavaDocLine(sb.toString());
addJavadocTag(topLevelClass, true);
topLevelClass.addJavaDocLine(" */"); //$NON-NLS-1$
}
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:33,代码来源:DefaultCommentGenerator.java
示例19: addFieldComment
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
public void addFieldComment(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn) {
if (suppressAllComments) {
return;
}
field.addJavaDocLine("/**"); //$NON-NLS-1$
String remarks = introspectedColumn.getRemarks();
if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
field.addJavaDocLine(" * Database Column Remarks:");
String[] remarkLines = remarks.split(System.getProperty("line.separator")); //$NON-NLS-1$
for (String remarkLine : remarkLines) {
field.addJavaDocLine(" * " + remarkLine); //$NON-NLS-1$
}
}
field.addJavaDocLine(" *"); //$NON-NLS-1$
field
.addJavaDocLine(" * This field was generated by MyBatis Generator."); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(" * This field corresponds to the database column "); //$NON-NLS-1$
sb.append(introspectedTable.getFullyQualifiedTable());
sb.append('.');
sb.append(introspectedColumn.getActualColumnName());
field.addJavaDocLine(sb.toString());
addJavadocTag(field, false);
field.addJavaDocLine(" */"); //$NON-NLS-1$
}
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:34,代码来源:DefaultCommentGenerator.java
示例20: getExtraCompilationUnits
import org.mybatis.generator.internal.util.StringUtility; //导入依赖的package包/类
@Override
public List<CompilationUnit> getExtraCompilationUnits() {
boolean useLegacyBuilder = false;
String prop = context.getJavaClientGeneratorConfiguration().getProperty(PropertyRegistry.CLIENT_USE_LEGACY_BUILDER);
if (StringUtility.stringHasValue(prop)) {
useLegacyBuilder = Boolean.valueOf(prop);
}
SqlProviderGenerator sqlProviderGenerator = new SqlProviderGenerator(useLegacyBuilder);
sqlProviderGenerator.setContext(context);
sqlProviderGenerator.setIntrospectedTable(introspectedTable);
sqlProviderGenerator.setProgressCallback(progressCallback);
sqlProviderGenerator.setWarnings(warnings);
return sqlProviderGenerator.getCompilationUnits();
}
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:16,代码来源:AnnotatedClientGenerator.java
注:本文中的org.mybatis.generator.internal.util.StringUtility类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论