Skip to content

Commit ac156ed

Browse files
committed
Add JavaDoc for ActivityIntentBuilder and related classes
1 parent 9df2a3c commit ac156ed

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/api/builder/ActivityIntentBuilder.java‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,44 @@
1919
import android.content.Intent;
2020
import android.os.Bundle;
2121

22+
/**
23+
* Base class for generated {@link android.app.Activity Activity} {@link Intent}
24+
* builders, which provide a fluent API to build {@link Intent}s and start the
25+
* generated {@link android.app.Activity Activity}.
26+
*
27+
* @param <I>
28+
* The actual class, so method chain can return the generated class
29+
* and provide generated methods
30+
*/
2231
public abstract class ActivityIntentBuilder<I extends ActivityIntentBuilder<I>> extends IntentBuilder<I> implements ActivityStarter {
2332

2433
protected Bundle lastOptions;
2534

35+
/**
36+
* Creates a builder for a given {@link android.app.Activity Activity}
37+
* class.
38+
*
39+
* @param context
40+
* A {@link Context} of the application package implementing this
41+
* class.
42+
* @param clazz
43+
* The component class that is to be used for the {@link Intent}.
44+
*/
2645
public ActivityIntentBuilder(Context context, Class<?> clazz) {
2746
super(context, clazz);
2847
}
2948

49+
/**
50+
* Creates a builder which will append to a previously created
51+
* {@link android.content.Intent Intent}.
52+
*
53+
* @param context
54+
* A {@link Context} of the application package implementing this
55+
* class.
56+
* @param intent
57+
* The previously created {@link Intent} to append to.
58+
*
59+
*/
3060
public ActivityIntentBuilder(Context context, Intent intent) {
3161
super(context, intent);
3262
}
@@ -39,6 +69,13 @@ public final void start() {
3969
@Override
4070
public abstract void startForResult(int requestCode);
4171

72+
/**
73+
* Adds additional options {@link Bundle} to the start method.
74+
*
75+
* @param options
76+
* the {@link android.app.Activity Activity} options
77+
* @return an {@link ActivityStarter} instance to provide starter methods
78+
*/
4279
public ActivityStarter withOptions(Bundle options) {
4380
lastOptions = options;
4481
return this;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
package org.androidannotations.api.builder;
22

3+
/**
4+
* Provides methods for starting an {@link android.app.Activity Activity}.
5+
*/
36
public interface ActivityStarter {
47

8+
/**
9+
* Starts the {@link android.app.Activity Activity}, by calling
10+
* {@link android.app.Activity#startActivity(android.content.Intent)
11+
* Activity#startActivity(android.content.Intent)} for the previously given
12+
* {@link android.content.Context Context} or Fragment or support Fragment
13+
* objects. It also passes the given extras, the options
14+
* {@link android.os.Bundle Bundle}, if new methods are available which
15+
* accept that.
16+
*/
517
void start();
618

19+
/**
20+
* Starts the {@link android.app.Activity Activity} for result, by calling
21+
* {@link android.app.Activity#startActivityForResult(android.content.Intent, int)
22+
* Activity#startActivityForResult(android.content.Intent, int)} for the
23+
* previously given {@link android.content.Context Context} or Fragment or
24+
* support Fragment objects. It also passes the given extras, the options
25+
* {@link android.os.Bundle Bundle}, if new methods are available which
26+
* accept that.
27+
*
28+
* @param requestCode
29+
* this code will be returned in onActivityResult() when the
30+
* activity exits.
31+
*/
732
void startForResult(int requestCode);
833
}

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/api/builder/Builder.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
*/
1616
package org.androidannotations.api.builder;
1717

18+
/**
19+
* Base class for fluent builders.
20+
*/
1821
public abstract class Builder {
1922
}

0 commit comments

Comments
 (0)