Skip to content

Commit fba47d5

Browse files
committed
no
1 parent 77cdd0f commit fba47d5

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

data-mediator-compiler/src/main/java/com/heaven7/java/data/mediator/compiler/MediatorAnnotationProcessor.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.heaven7.java.data.mediator.*;
44
import com.heaven7.java.data.mediator.GlobalConfig;
5-
import com.heaven7.java.data.mediator.compiler.generator.GroupPropertyGenerator;
5+
import com.heaven7.java.data.mediator.compiler.generator.BaseGenerator;
66
import com.heaven7.java.data.mediator.compiler.generator.StaticLoaderGenerator;
77
import com.heaven7.java.data.mediator.compiler.module.ImportDescData;
88
import com.heaven7.java.data.mediator.compiler.util.TypeUtils;
@@ -21,7 +21,6 @@
2121

2222
import static javax.lang.model.element.Modifier.PRIVATE;
2323
import static javax.lang.model.element.Modifier.PUBLIC;
24-
import static javax.lang.model.element.Modifier.STATIC;
2524

2625
/**
2726
* Created by heaven7 on 2017/8/28 0028.
@@ -32,7 +31,7 @@
3231
}) //use "*" indicate support all Annotations
3332
@SupportedSourceVersion(SourceVersion.RELEASE_7)
3433
public class MediatorAnnotationProcessor extends AbstractProcessor implements CodeGeneratorProvider,
35-
GroupPropertyGenerator.TypeElementDelegate{
34+
BaseGenerator.TypeElementDelegate{
3635

3736
private static final String TAG = "MediatorAnnotationProcessor";
3837
private Filer mFiler;

data-mediator-compiler/src/main/java/com/heaven7/java/data/mediator/compiler/generator/BaseGenerator.java

+5
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,9 @@ protected boolean hasAnnotation(TypeElement te) {
8585
Fields fields = te.getAnnotation(Fields.class);
8686
return fields != null && fields.groups().length > 0;
8787
}
88+
89+
public interface TypeElementDelegate{
90+
TypeElement get(String qualifyName);
91+
ProcessorContext getContext();
92+
}
8893
}

data-mediator-compiler/src/main/java/com/heaven7/java/data/mediator/compiler/generator/GroupPropertyGenerator.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
package com.heaven7.java.data.mediator.compiler.generator;
22

3-
import com.heaven7.java.data.mediator.Fields;
4-
import com.heaven7.java.data.mediator.compiler.FieldData;
53
import com.heaven7.java.data.mediator.compiler.GroupProperty;
64
import com.heaven7.java.data.mediator.compiler.ProcessorContext;
75
import com.heaven7.java.data.mediator.compiler.util.Util;
86
import com.squareup.javapoet.*;
97

10-
import javax.lang.model.element.*;
11-
import javax.lang.model.type.NoType;
12-
import javax.lang.model.type.TypeMirror;
8+
import javax.lang.model.element.Modifier;
9+
import javax.lang.model.element.TypeElement;
1310
import java.io.IOException;
1411
import java.util.List;
15-
import java.util.Map;
1612

1713
import static com.heaven7.java.data.mediator.compiler.DataMediatorConstants.*;
1814

@@ -68,9 +64,4 @@ public boolean generate(TypeElement te, List<GroupProperty> gps, TypeElementDele
6864
return true;
6965
}
7066

71-
public interface TypeElementDelegate{
72-
TypeElement get(String qualifyName);
73-
ProcessorContext getContext();
74-
}
75-
7667
}

0 commit comments

Comments
 (0)