Skip to content

Commit 5b97589

Browse files
committed
Fix javadocs and rename some variables
1 parent 9d1b3ca commit 5b97589

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/EIntentService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.lang.annotation.Target;
2222

2323
/**
24-
* Use this annotation to enhance an Android Service
24+
* Use this annotation to enhance an Android IntentService
2525
*/
2626
@Retention(RetentionPolicy.CLASS)
2727
@Target(ElementType.TYPE)

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/ServiceAction.java‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@
2020
import java.lang.annotation.RetentionPolicy;
2121
import java.lang.annotation.Target;
2222

23+
import android.app.IntentService;
24+
2325
/**
24-
* Use this annotation to enhance an Android Service
26+
* Should be used on a method that must respond to a specific action in an
27+
* enhanced {@link IntentService}. The method name will be used as action name
28+
* unless the {@link #value()} field is set.
29+
* <p/ >
30+
* The method signature (with attributes) will be a part of the IntentBuilder
31+
* generated for the {@link EIntentService}.
2532
*/
2633
@Retention(RetentionPolicy.CLASS)
2734
@Target(ElementType.METHOD)
2835
public @interface ServiceAction {
2936

37+
/**
38+
* Define the action's name. If this field isn't set the annotated method
39+
* name will be used.
40+
*/
3041
String value() default "";
3142

3243
}

‎AndroidAnnotations/androidannotations/src/main/java/org/androidannotations/helper/APTCodeModelHelper.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ private void addIntentBuilder(JCodeModel codeModel, EBeanHolder holder, boolean
392392
}
393393
}
394394

395-
public JInvocation addIntentBuilderPutExtraMethod(JCodeModel codeModel, EBeanHolder holder, APTCodeModelHelper helper, ProcessingEnvironment processingEnv, JMethod method, TypeMirror elementType, String paramName, String extraName) {
395+
public JInvocation addIntentBuilderPutExtraMethod(JCodeModel codeModel, EBeanHolder holder, APTCodeModelHelper helper, ProcessingEnvironment processingEnv, JMethod method, TypeMirror elementType, String parameterName, String extraName) {
396396
boolean castToSerializable = false;
397397
boolean castToParcelable = false;
398398
if (elementType.getKind() == TypeKind.DECLARED) {
@@ -412,16 +412,16 @@ public JInvocation addIntentBuilderPutExtraMethod(JCodeModel codeModel, EBeanHol
412412
}
413413
}
414414

415-
JClass paramClass = helper.typeMirrorToJClass(elementType, holder);
416-
JVar extraParam = method.param(paramClass, paramName);
415+
JClass parameterClass = helper.typeMirrorToJClass(elementType, holder);
416+
JVar extraParameterVar = method.param(parameterClass, parameterName);
417417
JBlock body = method.body();
418418
JInvocation invocation = body.invoke(holder.intentField, "putExtra").arg(extraName);
419419
if (castToSerializable) {
420-
return invocation.arg(cast(holder.classes().SERIALIZABLE, extraParam));
420+
return invocation.arg(cast(holder.classes().SERIALIZABLE, extraParameterVar));
421421
} else if (castToParcelable) {
422-
return invocation.arg(cast(holder.classes().PARCELABLE, extraParam));
422+
return invocation.arg(cast(holder.classes().PARCELABLE, extraParameterVar));
423423
}
424-
return invocation.arg(extraParam);
424+
return invocation.arg(extraParameterVar);
425425
}
426426

427427
public void addCastMethod(JCodeModel codeModel, EBeanHolder holder) {

0 commit comments

Comments
 (0)