org.mybatis.generator.api.dom.DefaultJavaFormatter Java Examples

The following examples show how to use org.mybatis.generator.api.dom.DefaultJavaFormatter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectFactory.java    From mapper-generator-javafx with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #2
Source File: ObjectFactory.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
/**
 * 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 (!StringUtility.stringHasValue(type)) {
        type = DefaultJavaFormatter.class.getName();
    }

    JavaFormatter answer = (JavaFormatter) createInternalObject(type);

    answer.setContext(context);

    return answer;
}
 
Example #3
Source File: ObjectFactory.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
public static JavaFormatter createJavaFormatter(Context context) {
    String type = context.getProperty(PropertyRegistry.CONTEXT_JAVA_FORMATTER);
    if (!StringUtility.stringHasValue(type)) {
        type = DefaultJavaFormatter.class.getName();
    }

    JavaFormatter answer = (JavaFormatter) createInternalObject(type);

    answer.setContext(context);

    return answer;
}
 
Example #4
Source File: CreateGenericInterfacePlugin.java    From mybatis-generator-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles() {
	List<GeneratedJavaFile> models = new ArrayList<>();

	GeneratedJavaFile genericInterfaceFile =
			new GeneratedJavaFile(genericInterface, context.getJavaClientGeneratorConfiguration().getTargetProject(), new DefaultJavaFormatter());

	models.add(genericInterfaceFile);

	return models;
}
 
Example #5
Source File: DynamicSqlPlugin.java    From mybatis-generator-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) {
	List<GeneratedJavaFile> models = new ArrayList<>();

	CompilationUnit unit = DynamicSqlSupportClassGenerator
			.of(introspectedTable, context.getCommentGenerator(), tableClassSuffix, addAliasedColumns, addTableAlias, tableAliasFieldName, properties)
			.generate();

	GeneratedJavaFile dynamicSqlModel =
			new GeneratedJavaFile(unit, context.getJavaClientGeneratorConfiguration().getTargetProject(), new DefaultJavaFormatter());

	models.add(dynamicSqlModel);

	return models;
}