mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
This commit is contained in:
parent
1a5da4ffa0
commit
cb4eb2e595
@ -32,7 +32,7 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
|
||||
|
||||
private static final String EXTENDS = " extends ";
|
||||
|
||||
private static final String IMPLEMENTS = " implements ";
|
||||
private static final String WITH = " with ";
|
||||
|
||||
private static final String IMPORT = "import ";
|
||||
|
||||
@ -204,12 +204,24 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
|
||||
append(EXTENDS + getGenericName(false, superClass));
|
||||
}
|
||||
if (interfaces.length > 0){
|
||||
append(IMPLEMENTS);
|
||||
for (int i = 0; i < interfaces.length; i++){
|
||||
if (i > 0){
|
||||
append(COMMA);
|
||||
if (superClass == null){
|
||||
append(EXTENDS);
|
||||
append(getGenericName(false, interfaces[0]));
|
||||
append(WITH);
|
||||
for (int i = 1; i < interfaces.length; i++){
|
||||
if (i > 1){
|
||||
append(COMMA);
|
||||
}
|
||||
append(getGenericName(false, interfaces[i]));
|
||||
}
|
||||
}else{
|
||||
append(WITH);
|
||||
for (int i = 0; i < interfaces.length; i++){
|
||||
if (i > 0){
|
||||
append(COMMA);
|
||||
}
|
||||
append(getGenericName(false, interfaces[i]));
|
||||
}
|
||||
append(getGenericName(false, interfaces[i]));
|
||||
}
|
||||
}
|
||||
append(" {").nl().nl();
|
||||
@ -237,12 +249,17 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
|
||||
beginLine(TRAIT + getGenericName(false, type));
|
||||
if (interfaces.length > 0){
|
||||
append(EXTENDS);
|
||||
for (int i = 0; i < interfaces.length; i++){
|
||||
if (i > 0){
|
||||
append(COMMA);
|
||||
append(getGenericName(false, interfaces[0]));
|
||||
if (interfaces.length > 1){
|
||||
append(WITH);
|
||||
for (int i = 1; i < interfaces.length; i++){
|
||||
if (i > 1){
|
||||
append(COMMA);
|
||||
}
|
||||
append(getGenericName(false, interfaces[i]));
|
||||
}
|
||||
append(getGenericName(false, interfaces[i]));
|
||||
}
|
||||
|
||||
}
|
||||
append(" {").nl().nl();
|
||||
goIn();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user