diff --git a/Data-mediator-demo/.idea/compiler.xml b/Data-mediator-demo/.idea/compiler.xml
deleted file mode 100644
index 1f2af51..0000000
--- a/Data-mediator-demo/.idea/compiler.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/copyright/profiles_settings.xml b/Data-mediator-demo/.idea/copyright/profiles_settings.xml
deleted file mode 100644
index e7bedf3..0000000
--- a/Data-mediator-demo/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/dictionaries/Administrator.xml b/Data-mediator-demo/.idea/dictionaries/Administrator.xml
deleted file mode 100644
index d87a161..0000000
--- a/Data-mediator-demo/.idea/dictionaries/Administrator.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/gradle.xml b/Data-mediator-demo/.idea/gradle.xml
deleted file mode 100644
index 6b69c38..0000000
--- a/Data-mediator-demo/.idea/gradle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/inspectionProfiles/Project_Default.xml b/Data-mediator-demo/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index aa2d359..0000000
--- a/Data-mediator-demo/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/inspectionProfiles/profiles_settings.xml b/Data-mediator-demo/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index 3b31283..0000000
--- a/Data-mediator-demo/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/misc.xml b/Data-mediator-demo/.idea/misc.xml
deleted file mode 100644
index c7db173..0000000
--- a/Data-mediator-demo/.idea/misc.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Abstraction issues
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/modules.xml b/Data-mediator-demo/.idea/modules.xml
deleted file mode 100644
index e53d282..0000000
--- a/Data-mediator-demo/.idea/modules.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/runConfigurations.xml b/Data-mediator-demo/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/Data-mediator-demo/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data-mediator-demo/.idea/vcs.xml b/Data-mediator-demo/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/Data-mediator-demo/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-binding-test/.idea/vcs.xml b/data-binding-test/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/data-binding-test/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-annotations/.idea/libraries/Gradle__junit_junit_4_11.xml b/data-mediator-annotations/.idea/libraries/Gradle__junit_junit_4_11.xml
deleted file mode 100644
index dc26b34..0000000
--- a/data-mediator-annotations/.idea/libraries/Gradle__junit_junit_4_11.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-annotations/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/data-mediator-annotations/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
deleted file mode 100644
index 8262f72..0000000
--- a/data-mediator-annotations/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/ConvertAction.java b/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/ConvertAction.java
index ca95681..bfb6a0e 100644
--- a/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/ConvertAction.java
+++ b/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/ConvertAction.java
@@ -32,7 +32,7 @@ public void actionPerformed(AnActionEvent e) {
@Override
public void update(AnActionEvent e) {
PsiClass psiClass = getPsiClassFromContext(e);
- e.getPresentation().setEnabled(psiClass != null && !psiClass.isInterface());
+ e.getPresentation().setEnabled(psiClass != null && !psiClass.isInterface() && psiClass.isWritable());
}
private PsiClass getPsiClassFromContext(AnActionEvent e) {
diff --git a/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/PropertyProcessor.java b/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/PropertyProcessor.java
index 3649481..8b18f1a 100644
--- a/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/PropertyProcessor.java
+++ b/data-mediator-convertor-intellij-plugin/src/com/heaven7/plugin/data/mediator/convertor/PropertyProcessor.java
@@ -38,7 +38,7 @@ public void parse(){
LinkedList list = new LinkedList<>();
list.addLast(mPsiClass);
PsiClass superClass = mPsiClass.getSuperClass();
- while (superClass != null){
+ while (superClass != null && superClass.isWritable()){
String qualifiedName = superClass.getQualifiedName();
if(qualifiedName == null || qualifiedName.startsWith("java.") || qualifiedName.startsWith("android.")){
break;
@@ -54,8 +54,10 @@ public void parse(){
private void parseInternal(PsiClass mPsiClass) {
final ClassInfo info = new ClassInfo();
- if(mPsiClass.getSuperClass() != null){
- info.addInterface(getSuperClassAsInterfaceName(mPsiClass.getSuperClass()));
+ PsiClass superClass = mPsiClass.getSuperClass();
+ //must writable
+ if(superClass != null && superClass.isWritable()){
+ info.addInterface(getSuperClassAsInterfaceName(superClass));
}
for(PsiClass pcs : mPsiClass.getInterfaces()){
info.addInterface(pcs.getQualifiedName());
@@ -149,8 +151,19 @@ private void generateInternal(PsiClass mPsiClass, ClassInfo info) {
Util.log("mPsiClass.getName() == null");
return;
}
- final String name = "I" + mPsiClass.getName();
final Project project = mPsiClass.getProject();
+ //delete if exist
+ PsiClass psiClass_pre = JavaPsiFacade.getInstance(project).findClass(getSuperClassAsInterfaceName(mPsiClass),
+ GlobalSearchScope.projectScope(project));
+ if(psiClass_pre != null && psiClass_pre.isValid()){
+ if(!psiClass_pre.isWritable()){
+ Util.log("the previous PsiClass (" + psiClass_pre.getQualifiedName() + ") can write. will be ignored.");
+ return;
+ }
+ psiClass_pre.delete();
+ }
+
+ final String name = "I" + mPsiClass.getName();
JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(project);
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
@@ -158,7 +171,7 @@ private void generateInternal(PsiClass mPsiClass, ClassInfo info) {
if(parent instanceof PsiClass){
Util.log("start nested class.");
PsiClass psic = elementFactory.createInterface(name);
- psic.getModifierList().addAnnotation("com.heaven7.java.data.mediator.Fields(value ={"
+ psic.getModifierList().addAnnotation("com.heaven7.java.data.mediator.Fields(value ={\n"
+ buildFieldAnnotations(info.getPropertyInfos())+ "\n} , generateJsonAdapter = false)");
if (!addExtendInterfaces(info, styleManager, elementFactory, psic)) {
return;
@@ -166,7 +179,7 @@ private void generateInternal(PsiClass mPsiClass, ClassInfo info) {
styleManager.shortenClassReferences(parent.addAfter(psic, mPsiClass));
}else{
PsiDirectory dir = mPsiClass.getContainingFile().getContainingDirectory();
- PsiClass psiClass = createJavaFile(name, "@com.heaven7.java.data.mediator.Fields(value ={"
+ PsiClass psiClass = createJavaFile(name, "@com.heaven7.java.data.mediator.Fields(value ={\n"
+ buildFieldAnnotations(info.getPropertyInfos())
+ "\n}, generateJsonAdapter = false) "
+ "public interface " + name + "{}");
diff --git a/data-mediator-intellij-plugin/.idea/artifacts/data_mediator_intellij_plugin.xml b/data-mediator-intellij-plugin/.idea/artifacts/data_mediator_intellij_plugin.xml
deleted file mode 100644
index b988fa2..0000000
--- a/data-mediator-intellij-plugin/.idea/artifacts/data_mediator_intellij_plugin.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- $PROJECT_DIR$/out/artifacts/data_mediator_intellij_plugin
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/compiler.xml b/data-mediator-intellij-plugin/.idea/compiler.xml
deleted file mode 100644
index 40ed937..0000000
--- a/data-mediator-intellij-plugin/.idea/compiler.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/dictionaries/Administrator.xml b/data-mediator-intellij-plugin/.idea/dictionaries/Administrator.xml
deleted file mode 100644
index d87a161..0000000
--- a/data-mediator-intellij-plugin/.idea/dictionaries/Administrator.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/encodings.xml b/data-mediator-intellij-plugin/.idea/encodings.xml
deleted file mode 100644
index 97626ba..0000000
--- a/data-mediator-intellij-plugin/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/misc.xml b/data-mediator-intellij-plugin/.idea/misc.xml
deleted file mode 100644
index d5d79e0..0000000
--- a/data-mediator-intellij-plugin/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/modules.xml b/data-mediator-intellij-plugin/.idea/modules.xml
deleted file mode 100644
index 8a58157..0000000
--- a/data-mediator-intellij-plugin/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/runConfigurations/data_mediator_plugin.xml b/data-mediator-intellij-plugin/.idea/runConfigurations/data_mediator_plugin.xml
deleted file mode 100644
index 3b0e3fb..0000000
--- a/data-mediator-intellij-plugin/.idea/runConfigurations/data_mediator_plugin.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/uiDesigner.xml b/data-mediator-intellij-plugin/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/data-mediator-intellij-plugin/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/vcs.xml b/data-mediator-intellij-plugin/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/data-mediator-intellij-plugin/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-intellij-plugin/.idea/workspace.xml b/data-mediator-intellij-plugin/.idea/workspace.xml
deleted file mode 100644
index be4243c..0000000
--- a/data-mediator-intellij-plugin/.idea/workspace.xml
+++ /dev/null
@@ -1,932 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- myName
- getTypeString
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1508722599988
-
-
- 1508722599988
-
-
- 1508755290217
-
-
-
- 1508755290218
-
-
- 1508756728558
-
-
-
- 1508756728558
-
-
- 1508821420917
-
-
-
- 1508821420917
-
-
- 1508829402649
-
-
-
- 1508829402649
-
-
- 1508829606751
-
-
-
- 1508829606751
-
-
- 1508923019036
-
-
-
- 1508923019036
-
-
- 1509094479738
-
-
-
- 1509094479738
-
-
- 1509194559667
-
-
-
- 1509194559667
-
-
- 1509327659116
-
-
-
- 1509327659116
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- data-mediator-intellij-plugin
-
-
-
-
-
-
-
-
-
-
-
-
- No facets are configured
-
-
-
-
-
-
-
-
-
-
-
- Python 2.7.13 (E:\study\python\python.exe) interpreter library
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
- data-mediator-intellij-plugin
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/compiler.xml b/data-mediator-support-gson/.idea/compiler.xml
deleted file mode 100644
index 5e72990..0000000
--- a/data-mediator-support-gson/.idea/compiler.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/dictionaries/Administrator.xml b/data-mediator-support-gson/.idea/dictionaries/Administrator.xml
deleted file mode 100644
index d87a161..0000000
--- a/data-mediator-support-gson/.idea/dictionaries/Administrator.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/encodings.xml b/data-mediator-support-gson/.idea/encodings.xml
deleted file mode 100644
index 97626ba..0000000
--- a/data-mediator-support-gson/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/gradle.xml b/data-mediator-support-gson/.idea/gradle.xml
deleted file mode 100644
index 381047d..0000000
--- a/data-mediator-support-gson/.idea/gradle.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_2.xml b/data-mediator-support-gson/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_2.xml
deleted file mode 100644
index 7c0bf24..0000000
--- a/data-mediator-support-gson/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_2.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_base_Java_base_1_1_0.xml b/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_base_Java_base_1_1_0.xml
deleted file mode 100644
index 7f92cb7..0000000
--- a/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_base_Java_base_1_1_0.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_data_mediator_data_mediator_1_2_2.xml b/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_data_mediator_data_mediator_1_2_2.xml
deleted file mode 100644
index 7212e70..0000000
--- a/data-mediator-support-gson/.idea/libraries/Gradle__com_heaven7_java_data_mediator_data_mediator_1_2_2.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/libraries/Gradle__junit_junit_4_12.xml b/data-mediator-support-gson/.idea/libraries/Gradle__junit_junit_4_12.xml
deleted file mode 100644
index 04c10dd..0000000
--- a/data-mediator-support-gson/.idea/libraries/Gradle__junit_junit_4_12.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/data-mediator-support-gson/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
deleted file mode 100644
index 8262f72..0000000
--- a/data-mediator-support-gson/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/misc.xml b/data-mediator-support-gson/.idea/misc.xml
deleted file mode 100644
index e49dbb9..0000000
--- a/data-mediator-support-gson/.idea/misc.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/modules.xml b/data-mediator-support-gson/.idea/modules.xml
deleted file mode 100644
index 5b73ea2..0000000
--- a/data-mediator-support-gson/.idea/modules.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/vcs.xml b/data-mediator-support-gson/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/data-mediator-support-gson/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator-support-gson/.idea/workspace.xml b/data-mediator-support-gson/.idea/workspace.xml
deleted file mode 100644
index 2aadab9..0000000
--- a/data-mediator-support-gson/.idea/workspace.xml
+++ /dev/null
@@ -1,903 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Abstraction issues
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- localhost
- 5050
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1509148293994
-
-
- 1509148293994
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/artifacts/data_mediator_jar.xml b/data-mediator/.idea/artifacts/data_mediator_jar.xml
deleted file mode 100644
index 6200e80..0000000
--- a/data-mediator/.idea/artifacts/data_mediator_jar.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- $PROJECT_DIR$/classes/artifacts/data_mediator_jar
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/compiler.xml b/data-mediator/.idea/compiler.xml
deleted file mode 100644
index a918481..0000000
--- a/data-mediator/.idea/compiler.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/gradle.xml b/data-mediator/.idea/gradle.xml
deleted file mode 100644
index e8a1da0..0000000
--- a/data-mediator/.idea/gradle.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/libraries/Gradle__junit_junit_4_12.xml b/data-mediator/.idea/libraries/Gradle__junit_junit_4_12.xml
deleted file mode 100644
index 04c10dd..0000000
--- a/data-mediator/.idea/libraries/Gradle__junit_junit_4_12.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/data-mediator/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
deleted file mode 100644
index 8262f72..0000000
--- a/data-mediator/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/misc.xml b/data-mediator/.idea/misc.xml
deleted file mode 100644
index 3fa298b..0000000
--- a/data-mediator/.idea/misc.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Abstraction issues
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/modules.xml b/data-mediator/.idea/modules.xml
deleted file mode 100644
index 5d2df57..0000000
--- a/data-mediator/.idea/modules.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/uiDesigner.xml b/data-mediator/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/data-mediator/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/data-mediator/.idea/vcs.xml b/data-mediator/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/data-mediator/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/en/FAQ.md b/docs/en/FAQ.md
new file mode 100644
index 0000000..e69de29
diff --git a/plugin-data-mediator-test/.idea/vcs.xml b/plugin-data-mediator-test/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/plugin-data-mediator-test/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/IStudent.java b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/IStudent.java
new file mode 100644
index 0000000..9f24b99
--- /dev/null
+++ b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/IStudent.java
@@ -0,0 +1,40 @@
+package com.heaven7.plugin.idea.data_mediator.test.convert;
+
+import com.heaven7.java.data.mediator.*;
+import com.heaven7.java.data.mediator.internal.SharedProperties;
+
+@Fields(value = {
+ @Field(propName = "name"),
+ @Field(propName = "id", seriaName = "_id"),
+ @Field(propName = "age", type = int.class, flags = FieldFlags.FLAGS_MAIN_SCOPES_2 | FieldFlags.FLAG_EXPOSE_DEFAULT),
+ @Field(propName = "grade", type = int.class, since = 1.3),
+ @Field(propName = "nickName", since = 1.2, until = 2.6)
+}, generateJsonAdapter = false)
+//this class is convert by convertor plugin
+public interface IStudent extends DataPools.Poolable {
+ Property PROP_name = SharedProperties.get("java.lang.String", "name", 0);
+ Property PROP_id = SharedProperties.get("java.lang.String", "id", 0);
+ Property PROP_age = SharedProperties.get("int", "age", 0);
+ Property PROP_grade = SharedProperties.get("int", "grade", 0);
+ Property PROP_nickName = SharedProperties.get("java.lang.String", "nickName", 0);
+
+ IStudent setName(String name1);
+
+ String getName();
+
+ IStudent setId(String id1);
+
+ String getId();
+
+ IStudent setAge(int age1);
+
+ int getAge();
+
+ IStudent setGrade(int grade1);
+
+ int getGrade();
+
+ IStudent setNickName(String nickName1);
+
+ String getNickName();
+}
diff --git a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/ITestParcelableData_$Impl.java b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/ITestParcelableData_$Impl.java
deleted file mode 100644
index ab6a332..0000000
--- a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/ITestParcelableData_$Impl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.heaven7.plugin.idea.data_mediator.test.convert;
-
-import com.heaven7.java.data.mediator.Field;
-import com.heaven7.java.data.mediator.FieldFlags;
-import com.heaven7.java.data.mediator.Fields;
-import com.heaven7.plugin.idea.data_mediator.test.Student;
-
-@Fields(value = {@Field(propName = "test_int", seriaName = "test_int", type = int.class),
- @Field(propName = "test_long", type = long.class, flags = FieldFlags.FLAGS_MAIN_SCOPES_2 | FieldFlags.FLAG_EXPOSE_DEFAULT | FieldFlags.FLAG_EXPOSE_DESERIALIZE_FALSE),
- @Field(propName = "test_byte", type = byte.class, since = 1.1),
- @Field(propName = "test_short", type = short.class, until = 1.8),
- @Field(propName = "test_float", type = float.class),
- @Field(propName = "test_double", type = double.class),
- @Field(propName = "test_boolean", type = boolean.class),
- @Field(propName = "test_char", type = char.class),
- @Field(propName = "test_Integer", type = Integer.class),
- @Field(propName = "test_Long", type = Long.class),
- @Field(propName = "test_Short", type = Short.class),
- @Field(propName = "test_Byte", type = Byte.class),
- @Field(propName = "test_Float", type = Float.class),
- @Field(propName = "test_Double", type = Double.class),
- @Field(propName = "test_Boolean", type = Boolean.class),
- @Field(propName = "test_Character", type = Character.class),
- @Field(propName = "test_int_list", type = Integer.class, complexType = 2),
- @Field(propName = "test_long_list", type = Long.class, complexType = 2),
- @Field(propName = "test_byte_list", type = Byte.class, complexType = 2),
- @Field(propName = "test_short_list", type = Short.class, complexType = 2),
- @Field(propName = "test_float_list", type = Float.class, complexType = 2),
- @Field(propName = "test_double_list", type = Double.class, complexType = 2),
- @Field(propName = "test_boolean_list", type = Boolean.class, complexType = 2),
- @Field(propName = "test_char_list", type = Character.class, complexType = 2),
- @Field(propName = "test_Integer_list", type = Integer.class, complexType = 2),
- @Field(propName = "test_Long_list", type = Long.class, complexType = 2),
- @Field(propName = "test_Short_list", type = Short.class, complexType = 2),
- @Field(propName = "test_Byte_list", type = Byte.class, complexType = 2),
- @Field(propName = "test_Float_list", type = Float.class, complexType = 2),
- @Field(propName = "test_Double_list", type = Double.class, complexType = 2),
- @Field(propName = "test_Boolean_list", type = Boolean.class, complexType = 2),
- @Field(propName = "test_Character_list", type = Character.class, complexType = 2),
- @Field(propName = "test_int_array", type = int.class, complexType = 1),
- @Field(propName = "test_long_array", type = long.class, complexType = 1),
- @Field(propName = "test_byte_array", type = byte.class, complexType = 1),
- @Field(propName = "test_short_array", type = short.class, complexType = 1),
- @Field(propName = "test_short_array2", type = short.class, complexType = 1),
- @Field(propName = "test_float_array", type = float.class, complexType = 1),
- @Field(propName = "test_double_array", type = double.class, complexType = 1),
- @Field(propName = "test_boolean_array", type = boolean.class, complexType = 1),
- @Field(propName = "test_char_array", type = char.class, complexType = 1),
- @Field(propName = "test_Integer_array", type = Integer.class, complexType = 1),
- @Field(propName = "test_Long_array", type = Long.class, complexType = 1),
- @Field(propName = "test_Short_array", type = Short.class, complexType = 1),
- @Field(propName = "test_Byte_array", type = Byte.class, complexType = 1),
- @Field(propName = "test_Float_array", type = Float.class, complexType = 1),
- @Field(propName = "test_Double_array", type = Double.class, complexType = 1),
- @Field(propName = "test_Boolean_array", type = Boolean.class, complexType = 1),
- @Field(propName = "test_Character_array", type = Character.class, complexType = 1),
- @Field(propName = "test_String"),
- @Field(propName = "test_String_array", complexType = 1),
- @Field(propName = "test_String_list", complexType = 2),
- @Field(propName = "test_ResultData", type = Student.Test.class),
- @Field(propName = "test_ResultData_list", type = Student.Test.class, complexType = 2),
- @Field(propName = "test_ResultData_array", type = Student.Test.class, complexType = 1),
- @Field(propName = "test_SparseArray", type = Student.Test.class, complexType = 3)},
- generateJsonAdapter = false)
-public interface ITestParcelableData_$Impl {
-}
diff --git a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter.java b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter.java
new file mode 100644
index 0000000..b8a8a2e
--- /dev/null
+++ b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter.java
@@ -0,0 +1,21 @@
+package com.heaven7.plugin.idea.data_mediator.test.convert;
+
+import com.heaven7.java.data.mediator.Field;
+import com.heaven7.java.data.mediator.Fields;
+
+public class Outter {
+
+ public static class Inner{
+ private String name;
+ }
+
+ public static class TestInner1 extends Outter2.Inner2_1.Inner2_2{
+ private String testInner1;
+ }
+
+ @Fields(value = {@Field(propName = "testInner1")
+ }, generateJsonAdapter = false)
+ public interface ITestInner1 extends Outter2.Inner2_1.IInner2_2 {
+ }
+
+}
diff --git a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter2.java b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter2.java
new file mode 100644
index 0000000..2111d72
--- /dev/null
+++ b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Outter2.java
@@ -0,0 +1,24 @@
+package com.heaven7.plugin.idea.data_mediator.test.convert;
+
+
+
+import com.heaven7.java.data.mediator.Field;
+import com.heaven7.java.data.mediator.Fields;
+
+import java.util.ArrayList;
+
+public class Outter2 {
+
+ public static class Inner2_1 {
+ //just test
+ public static class Inner2_2 extends ArrayList{
+ private String text;
+ }
+
+ @Fields(value = {@Field(propName = "text")
+ }, generateJsonAdapter = false)
+ public interface IInner2_2 {
+ }
+
+ }
+}
diff --git a/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Student.java b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Student.java
new file mode 100644
index 0000000..f790011
--- /dev/null
+++ b/plugin-data-mediator-test/src/main/java/com/heaven7/plugin/idea/data_mediator/test/convert/Student.java
@@ -0,0 +1,25 @@
+package com.heaven7.plugin.idea.data_mediator.test.convert;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.annotations.Since;
+import com.google.gson.annotations.Until;
+
+//auto generate the module of 'data-mediator'(自动生成DataMediator 框架 需要的数据模型 )
+public class Student {
+
+ private String name;
+
+ @SerializedName("_id")
+ private String id;
+
+ @Expose
+ private int age;
+ @Since(1.3)
+ private int grade;
+
+ @Since(1.2)
+ @Until(2.6)
+ private String nickName;
+
+}
diff --git a/res/data-mediator-convertor.gif b/res/data-mediator-convertor.gif
new file mode 100644
index 0000000..c208192
Binary files /dev/null and b/res/data-mediator-convertor.gif differ