updated version to 0.2.6

This commit is contained in:
Timo Westkämper 2010-09-20 07:34:43 +00:00
parent 8c9fda63d2
commit 57d7f80bcf
2 changed files with 16 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mysema.codegen</groupId>
<artifactId>codegen</artifactId>
<version>0.2.5-SNAPSHOT</version>
<version>0.2.6</version>
<name>Codegen</name>
<description>Code generation and compilation for Java</description>
<parent>

View File

@ -50,6 +50,8 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
private static final String PUBLIC = "public ";
private static final String PUBLIC_CLASS = "class ";
private static final String PUBLIC_OBJECT = "object ";
private static final String VAR = "var ";
@ -155,8 +157,14 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
return this;
}
public ScalaWriter beginClass(String header) throws IOException{
line(PUBLIC_CLASS, header);
public ScalaWriter beginObject(String header) throws IOException {
line(PUBLIC_OBJECT, header, " {");
goIn();
return this;
}
public ScalaWriter beginClass(String header) throws IOException {
line(PUBLIC_CLASS, header, " {");
goIn();
return this;
}
@ -308,7 +316,11 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
}
}
if (rv.endsWith("[]")){
return "Array[" + rv.substring(0, rv.length()-2) + "]";
rv = rv.substring(0, rv.length()-2);
if (classes.contains(rv)){
rv = rv.substring(packageName.length()+1);
}
return "Array[" + rv + "]";
}else{
return rv;
}