Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
do not use the method name as action for @ReceiverAction
  • Loading branch information
dodgex committed May 5, 2015
commit f9b40c78c12025b0fc77ed7bf819f66f8e22e395
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
/**
* <p>
* Should be used on a method that must respond to a specific action in an
* {@link EReceiver} annotated class. The method name will be used as action
* name unless the {@link #value()} field is set.
* {@link EReceiver} annotated class.
* </p>
* <p>
* The class MAY contain several {@link ReceiverAction} annotated methods.
Expand Down Expand Up @@ -94,12 +93,11 @@
public @interface ReceiverAction {

/**
* Define a set of actions this method should handle. If this field isn't
* set the annotated method name will be used.
*
* Define a set of actions this method should handle.
*
* @return the actions
*/
String[] value() default {};
String[] actions();

/**
* Define a set of data schemes to filter the Intent. If this field isn't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ public void process(Element element, EReceiverHolder holder) throws Exception {

ReceiverAction annotation = element.getAnnotation(ReceiverAction.class);
String[] dataSchemes = annotation.dataSchemes();
String[] actions = annotation.value();
if (actions.length == 0) {
actions = new String[] { methodName };
}
String[] actions = annotation.actions();

JFieldVar actionKeyField = createStaticField(holder, "actions", methodName, actions);
JFieldVar dataSchemesField = createStaticField(holder, "dataSchemes", methodName, dataSchemes);
Expand Down