Search in sources :

Example 36 with JavaWriter

use of com.mysema.codegen.JavaWriter in project querydsl by querydsl.

the class AbstractDomainExporter method write.

private void write(Serializer serializer, String path, EntityType type) throws IOException {
    File targetFile = new File(targetFolder, path);
    generatedFiles.add(targetFile);
    Writer w = writerFor(targetFile);
    try {
        CodeWriter writer = new JavaWriter(w);
        if (typeToConfig.containsKey(type.getJavaClass())) {
            serializer.serialize(type, typeToConfig.get(type.getJavaClass()), writer);
        } else {
            serializer.serialize(type, serializerConfig, writer);
        }
    } finally {
        w.close();
    }
}
Also used : JavaWriter(com.mysema.codegen.JavaWriter) CodeWriter(com.mysema.codegen.CodeWriter) CodeWriter(com.mysema.codegen.CodeWriter) JavaWriter(com.mysema.codegen.JavaWriter)

Aggregations

JavaWriter (com.mysema.codegen.JavaWriter)36 Test (org.junit.Test)32 CodeWriter (com.mysema.codegen.CodeWriter)3 StringWriter (java.io.StringWriter)3 ScalaWriter (com.mysema.codegen.ScalaWriter)2 SimpleType (com.mysema.codegen.model.SimpleType)2 Writer (java.io.Writer)2 EnumMap (java.util.EnumMap)2 Map (java.util.Map)2 ClassType (com.mysema.codegen.model.ClassType)1 Type (com.mysema.codegen.model.Type)1 IOException (java.io.IOException)1 Serializable (java.io.Serializable)1 DeclaredType (javax.lang.model.type.DeclaredType)1 NoType (javax.lang.model.type.NoType)1 JavaFileObject (javax.tools.JavaFileObject)1