Skip to content

Commit 997c324

Browse files
committed
Rename methods ing BaseAnnotationHandler
1 parent 98845d8 commit 997c324

35 files changed

Lines changed: 95 additions & 102 deletions

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/AbstractListenerHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void process(Element element, T holder) {
7878

7979
List<JFieldRef> idsRefs = annotationHelper.extractAnnotationFieldRefs(element, getResourceType(), true);
8080

81-
JDefinedClass listenerAnonymousClass = codeModel().anonymousClass(getListenerClass());
81+
JDefinedClass listenerAnonymousClass = getCodeModel().anonymousClass(getListenerClass());
8282
JMethod listenerMethod = createListenerMethod(listenerAnonymousClass);
8383
listenerMethod.annotate(Override.class);
8484

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/AppHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void validate(Element element, ElementValidation validation) {
4848
public void process(Element element, EComponentHolder holder) {
4949
String fieldName = element.getSimpleName().toString();
5050
String applicationQualifiedName = element.asType().toString();
51-
JClass applicationClass = refClass(applicationQualifiedName + classSuffix());
51+
JClass applicationClass = getJClass(applicationQualifiedName + classSuffix());
5252

5353
holder.getInitBody().assign(ref(fieldName), applicationClass.staticInvoke(EApplicationHolder.GET_APPLICATION_INSTANCE));
5454
}

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/BackgroundHandler.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public void process(Element element, EComponentHolder holder) throws Exception {
5151

5252
JBlock previousMethodBody = codeModelHelper.removeBody(delegatingMethod);
5353

54-
JDefinedClass anonymousTaskClass = codeModel().anonymousClass(BackgroundExecutor.Task.class);
54+
JDefinedClass anonymousTaskClass = getCodeModel().anonymousClass(BackgroundExecutor.Task.class);
5555

56-
JMethod executeMethod = anonymousTaskClass.method(JMod.PUBLIC, codeModel().VOID, "execute");
56+
JMethod executeMethod = anonymousTaskClass.method(JMod.PUBLIC, getCodeModel().VOID, "execute");
5757
executeMethod.annotate(Override.class);
5858

5959
// Catch exception in user code
@@ -73,7 +73,7 @@ public void process(Element element, EComponentHolder holder) throws Exception {
7373
int delay = annotation.delay();
7474
String serial = annotation.serial();
7575

76-
JClass backgroundExecutorClass = refClass(BackgroundExecutor.class);
76+
JClass backgroundExecutorClass = getJClass(BackgroundExecutor.class);
7777
JInvocation newTask = _new(anonymousTaskClass).arg(lit(id)).arg(lit(delay)).arg(lit(serial));
7878
JInvocation executeCall = backgroundExecutorClass.staticInvoke("execute").arg(newTask);
7979

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/BaseAnnotationHandler.java‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import javax.annotation.processing.ProcessingEnvironment;
1919
import javax.lang.model.element.Element;
20-
import javax.lang.model.type.TypeMirror;
2120

2221
import org.androidannotations.AndroidAnnotationsEnvironment;
2322
import org.androidannotations.helper.APTCodeModelHelper;
@@ -77,21 +76,15 @@ protected ProcessHolder.Classes getClasses() {
7776
return environment.getClasses();
7877
}
7978

80-
public JCodeModel codeModel() {
79+
protected JCodeModel getCodeModel() {
8180
return environment.getCodeModel();
8281
}
8382

84-
public JClass refClass(String fullyQualifiedClassName) {
83+
protected JClass getJClass(String fullyQualifiedClassName) {
8584
return environment.getJClass(fullyQualifiedClassName);
8685
}
8786

88-
public JClass refClass(TypeMirror typeMirror) {
89-
return environment.getJClass(typeMirror.toString());
90-
}
91-
92-
public JClass refClass(Class<?> clazz) {
87+
protected JClass getJClass(Class<?> clazz) {
9388
return environment.getJClass(clazz);
9489
}
95-
96-
9790
}

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/BeanHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void process(Element element, EComponentHolder holder) throws Exception {
5858
}
5959

6060
String typeQualifiedName = typeMirror.toString();
61-
JClass injectedClass = refClass(annotationHelper.generatedClassQualifiedNameFromQualifiedName(typeQualifiedName));
61+
JClass injectedClass = getJClass(annotationHelper.generatedClassQualifiedNameFromQualifiedName(typeQualifiedName));
6262

6363
String fieldName = element.getSimpleName().toString();
6464
JFieldRef beanField = ref(fieldName);

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/CheckedChangeHandler.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected void makeCall(JBlock listenerMethodBody, JInvocation call, TypeMirror
6464
@Override
6565
protected void processParameters(EComponentWithViewSupportHolder holder, JMethod listenerMethod, JInvocation call, List<? extends VariableElement> parameters) {
6666
JVar btnParam = listenerMethod.param(getClasses().COMPOUND_BUTTON, "buttonView");
67-
JVar isCheckedParam = listenerMethod.param(codeModel().BOOLEAN, "isChecked");
67+
JVar isCheckedParam = listenerMethod.param(getCodeModel().BOOLEAN, "isChecked");
6868

6969
for (VariableElement parameter : parameters) {
7070
String parameterType = parameter.asType().toString();
@@ -78,7 +78,7 @@ protected void processParameters(EComponentWithViewSupportHolder holder, JMethod
7878

7979
@Override
8080
protected JMethod createListenerMethod(JDefinedClass listenerAnonymousClass) {
81-
return listenerAnonymousClass.method(JMod.PUBLIC, codeModel().VOID, "onCheckedChanged");
81+
return listenerAnonymousClass.method(JMod.PUBLIC, getCodeModel().VOID, "onCheckedChanged");
8282
}
8383

8484
@Override

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/ClickHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected void processParameters(EComponentWithViewSupportHolder holder, JMethod
7171

7272
@Override
7373
protected JMethod createListenerMethod(JDefinedClass listenerAnonymousClass) {
74-
return listenerAnonymousClass.method(JMod.PUBLIC, codeModel().VOID, "onClick");
74+
return listenerAnonymousClass.method(JMod.PUBLIC, getCodeModel().VOID, "onClick");
7575
}
7676

7777
@Override

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/EditorActionHandler.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ protected void makeCall(JBlock listenerMethodBody, JInvocation call, TypeMirror
7474
@Override
7575
protected void processParameters(EComponentWithViewSupportHolder holder, JMethod listenerMethod, JInvocation call, List<? extends VariableElement> userParameters) {
7676
JVar textView = listenerMethod.param(getClasses().TEXT_VIEW, "textView");
77-
JVar actionId = listenerMethod.param(codeModel().INT, "actionId");
77+
JVar actionId = listenerMethod.param(getCodeModel().INT, "actionId");
7878
JVar event = listenerMethod.param(getClasses().KEY_EVENT, "event");
7979

8080
for (VariableElement param : userParameters) {
8181
String paramClassQualifiedName = param.asType().toString();
8282
if (isTypeOrSubclass(CanonicalNameConstants.TEXT_VIEW, param)) {
8383
call.arg(castArgumentIfNecessary(holder, CanonicalNameConstants.TEXT_VIEW, textView, param));
84-
} else if (paramClassQualifiedName.equals(CanonicalNameConstants.INTEGER) || paramClassQualifiedName.equals(codeModel().INT.fullName())) {
84+
} else if (paramClassQualifiedName.equals(CanonicalNameConstants.INTEGER) || paramClassQualifiedName.equals(getCodeModel().INT.fullName())) {
8585
call.arg(actionId);
8686
} else if (paramClassQualifiedName.equals(CanonicalNameConstants.KEY_EVENT)) {
8787
call.arg(event);
@@ -91,7 +91,7 @@ protected void processParameters(EComponentWithViewSupportHolder holder, JMethod
9191

9292
@Override
9393
protected JMethod createListenerMethod(JDefinedClass listenerAnonymousClass) {
94-
return listenerAnonymousClass.method(JMod.PUBLIC, codeModel().BOOLEAN, "onEditorAction");
94+
return listenerAnonymousClass.method(JMod.PUBLIC, getCodeModel().BOOLEAN, "onEditorAction");
9595
}
9696

9797
@Override

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/FocusChangeHandler.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected void makeCall(JBlock listenerMethodBody, JInvocation call, TypeMirror
6565
@Override
6666
protected void processParameters(EComponentWithViewSupportHolder holder, JMethod listenerMethod, JInvocation call, List<? extends VariableElement> parameters) {
6767
JVar viewParam = listenerMethod.param(getClasses().VIEW, "view");
68-
JVar hasFocusParam = listenerMethod.param(codeModel().BOOLEAN, "hasFocus");
68+
JVar hasFocusParam = listenerMethod.param(getCodeModel().BOOLEAN, "hasFocus");
6969

7070
for (VariableElement parameter : parameters) {
7171
String parameterType = parameter.asType().toString();
@@ -79,7 +79,7 @@ protected void processParameters(EComponentWithViewSupportHolder holder, JMethod
7979

8080
@Override
8181
protected JMethod createListenerMethod(JDefinedClass listenerAnonymousClass) {
82-
return listenerAnonymousClass.method(JMod.PUBLIC, codeModel().VOID, "onFocusChange");
82+
return listenerAnonymousClass.method(JMod.PUBLIC, getCodeModel().VOID, "onFocusChange");
8383
}
8484

8585
@Override

‎AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/handler/FragmentByIdHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void process(Element element, EComponentWithViewSupportHolder holder) {
7373

7474
JBlock methodBody = holder.getOnViewChangedBody();
7575

76-
methodBody.assign(ref(fieldName), cast(refClass(typeQualifiedName), invoke(findFragmentById).arg(idRef)));
76+
methodBody.assign(ref(fieldName), cast(getJClass(typeQualifiedName), invoke(findFragmentById).arg(idRef)));
7777

7878
}
7979
}

0 commit comments

Comments
 (0)