当前位置: 首页>>代码示例>>Java>>正文


Java PropertyRegistry类代码示例

本文整理汇总了Java中org.mybatis.generator.config.PropertyRegistry的典型用法代码示例。如果您正苦于以下问题:Java PropertyRegistry类的具体用法?Java PropertyRegistry怎么用?Java PropertyRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyRegistry类属于org.mybatis.generator.config包,在下文中一共展示了PropertyRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testThatFilesAreTheSameAfterMerge

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
@Test
public void testThatFilesAreTheSameAfterMerge() throws Exception {
    DefaultXmlFormatter xmlFormatter = new DefaultXmlFormatter();
    Properties p = new Properties();
    p.setProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE, "true");
    CommentGenerator commentGenerator = new DefaultCommentGenerator();
    commentGenerator.addConfigurationProperties(p);

    Document document = new Document(XmlConstants.MYBATIS3_MAPPER_PUBLIC_ID,
            XmlConstants.MYBATIS3_MAPPER_SYSTEM_ID);
    document.setRootElement(getSqlMapElement(commentGenerator));

    GeneratedXmlFile generatedFile1 = new GeneratedXmlFile(document, "TestMapper.xml", "org.mybatis.test", "src",
            true, xmlFormatter);
    InputSource is1 = new InputSource(new StringReader(generatedFile1.getFormattedContent()));

    GeneratedXmlFile generatedFile2 = new GeneratedXmlFile(document, "TestMapper.xml", "org.mybatis.test", "src",
            true, xmlFormatter);
    InputSource is2 = new InputSource(new StringReader(generatedFile2.getFormattedContent()));

    String mergedSource = XmlFileMergerJaxp.getMergedSource(is1, is2, "TestMapper.xml");

    assertEquals(generatedFile1.getFormattedContent(), mergedSource);
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:25,代码来源:XmlFileMergerTest.java

示例2: isConstructorBased

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
/**
 * Checks if is constructor based.
 *
 * @return true, if is constructor based
 */
public boolean isConstructorBased() {
    if (isImmutable()) {
        return true;
    }
    
    Properties properties;
    
    if (tableConfiguration.getProperties().containsKey(PropertyRegistry.ANY_CONSTRUCTOR_BASED)) {
        properties = tableConfiguration.getProperties();
    } else {
        properties = context.getJavaModelGeneratorConfiguration().getProperties();
    }
    
    return isTrue(properties.getProperty(PropertyRegistry.ANY_CONSTRUCTOR_BASED));
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:21,代码来源:IntrospectedTable.java

示例3: addConfigurationProperties

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:18,代码来源:DefaultCommentGenerator.java

示例4: getExampleMethodVisibility

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
public JavaVisibility getExampleMethodVisibility() {
    if (exampleMethodVisibility == null) {
        String type = context
                .getJavaClientGeneratorConfiguration()
                .getProperty(PropertyRegistry.DAO_EXAMPLE_METHOD_VISIBILITY);
        if (stringHasValue(type)) {
            if ("public".equalsIgnoreCase(type)) { //$NON-NLS-1$
                exampleMethodVisibility = JavaVisibility.PUBLIC;
            } else if ("private".equalsIgnoreCase(type)) { //$NON-NLS-1$
                exampleMethodVisibility = JavaVisibility.PRIVATE;
            } else if ("protected".equalsIgnoreCase(type)) { //$NON-NLS-1$
                exampleMethodVisibility = JavaVisibility.PROTECTED;
            } else if ("default".equalsIgnoreCase(type)) { //$NON-NLS-1$
                exampleMethodVisibility = JavaVisibility.DEFAULT;
            } else {
                exampleMethodVisibility = JavaVisibility.PUBLIC;
                warnings.add(getString("Warning.16", type)); //$NON-NLS-1$
            }
        } else {
            exampleMethodVisibility = JavaVisibility.PUBLIC;
        }
    }

    return exampleMethodVisibility;
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:26,代码来源:AbstractDAOElementGenerator.java

示例5: addConfigurationProperties

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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

示例6: addConfigurationProperties

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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

示例7: addConfigurationProperties

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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

示例8: getExtraCompilationUnits

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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:DomKing,项目名称:springbootWeb,代码行数:16,代码来源:AnnotatedClientGenerator.java

示例9: isImmutable

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
/**
 * Checks if is immutable.
 *
 * @return true, if is immutable
 */
public boolean isImmutable() {
    Properties properties;
    
    if (tableConfiguration.getProperties().containsKey(PropertyRegistry.ANY_IMMUTABLE)) {
        properties = tableConfiguration.getProperties();
    } else {
        properties = context.getJavaModelGeneratorConfiguration().getProperties();
    }
    
    return isTrue(properties.getProperty(PropertyRegistry.ANY_IMMUTABLE));
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:17,代码来源:IntrospectedTable.java

示例10: BaseRules

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的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

示例11: isTrimStringsEnabled

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
/**
 * Checks if is trim strings enabled.
 *
 * @param context
 *            the context
 * @return true, if is trim strings enabled
 */
private static boolean isTrimStringsEnabled(Context context) {
    Properties properties = context
            .getJavaModelGeneratorConfiguration().getProperties();
    boolean rc = isTrue(properties
            .getProperty(PropertyRegistry.MODEL_GENERATOR_TRIM_STRINGS));
    return rc;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:15,代码来源:JavaBeansUtil.java

示例12: getRootClass

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
public String getRootClass() {
    String rootClass = introspectedTable
            .getTableConfigurationProperty(PropertyRegistry.ANY_ROOT_CLASS);
    if (rootClass == null) {
        Properties properties = context
                .getJavaModelGeneratorConfiguration().getProperties();
        rootClass = properties.getProperty(PropertyRegistry.ANY_ROOT_CLASS);
    }

    return rootClass;
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:12,代码来源:AbstractJavaGenerator.java

示例13: createJavaFormatter

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
/**
 * Creates a new Object object.
 *
 * @param context
 *            the context
 * @return the java formatter
 */
public static JavaFormatter createJavaFormatter(Context context) {
    String type = context.getProperty(PropertyRegistry.CONTEXT_JAVA_FORMATTER);
    if (!stringHasValue(type)) {
        type = DefaultJavaFormatter.class.getName();
    }

    JavaFormatter answer = (JavaFormatter) createInternalObject(type);

    answer.setContext(context);

    return answer;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:20,代码来源:ObjectFactory.java

示例14: isTrimStringsEnabled

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
/**
 * Checks if is trim strings enabled.
 *
 * @param column
 *            the column
 * @return true, if is trim strings enabled
 */
private static boolean isTrimStringsEnabled(IntrospectedColumn column) {
    String trimSpaces = column.getProperties().getProperty(PropertyRegistry.MODEL_GENERATOR_TRIM_STRINGS);
    if (trimSpaces != null) {
        return isTrue(trimSpaces);
    }
    return isTrimStringsEnabled(column.getIntrospectedTable());
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:15,代码来源:JavaBeansUtil.java

示例15: getModelPackage

import org.mybatis.generator.config.PropertyRegistry; //导入依赖的package包/类
private String getModelPackage( IntrospectedTable introspectedTable,Context context){
	StringBuilder sb = new StringBuilder();
	sb.append(context.getJavaModelGeneratorConfiguration().getTargetPackage());
	sb.append(introspectedTable.getFullyQualifiedTable().getSubPackageForModel(StringUtility.isTrue(context.getJavaModelGeneratorConfiguration().getProperty(PropertyRegistry.ANY_ENABLE_SUB_PACKAGES))));
	String pakkage = sb.toString();
	return pakkage;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:8,代码来源:OneToOnePlugin.java


注:本文中的org.mybatis.generator.config.PropertyRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。