updated version to 0.2.2

This commit is contained in:
Timo Westkämper 2010-08-19 11:51:27 +00:00
parent aa474720d2
commit cd8655a5c8
3 changed files with 16 additions and 1 deletions

View File

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

View File

@ -24,6 +24,10 @@ import com.mysema.codegen.model.Type;
*/
public interface CodeWriter extends Appendable{
String getRawName(Type type);
String getGenericName(boolean asArgType, Type type);
CodeWriter annotation(Annotation annotation) throws IOException;
CodeWriter annotation(Class<? extends Annotation> annotation) throws IOException;

View File

@ -257,6 +257,16 @@ public final class JavaWriter extends AbstractCodeWriter<JavaWriter>{
private JavaWriter field(String modifier, Type type, String name, String value) throws IOException{
return line(modifier + type.getGenericName(true, packages, classes) + SPACE + name + ASSIGN + value + SEMICOLON).nl();
}
@Override
public String getGenericName(boolean asArgType, Type type) {
return type.getGenericName(asArgType, packages, classes);
}
@Override
public String getRawName(Type type) {
return type.getRawName(packages, classes);
}
@Override
public JavaWriter imports(Class<?>... imports) throws IOException{
@ -423,4 +433,5 @@ public final class JavaWriter extends AbstractCodeWriter<JavaWriter>{
return rv;
}
}