forked from greenrobot/EventBus
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to use @subscribe annotation
- This allows for cleaner code and more flexibility - with method naming
- Loading branch information
Rick Brock
committed
Nov 7, 2014
1 parent
4cdd420
commit e42992a
Showing
4 changed files
with
119 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package de.greenrobot.event; | ||
|
||
|
||
public enum DeclarationType { | ||
/** | ||
* Declare via annotations | ||
*/ | ||
ANNOTATIONS, | ||
/** | ||
* Declare via Method Naming | ||
*/ | ||
METHOD_NAME | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
EventBus/src/de/greenrobot/event/annotations/Subscribe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.greenrobot.event.annotations; | ||
|
||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import de.greenrobot.event.ThreadMode; | ||
|
||
@Documented | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD}) | ||
public @interface Subscribe { | ||
ThreadMode threadMode() default ThreadMode.PostThread; | ||
} |