Search in sources :

Example 1 with ReceiverAction

use of org.androidannotations.annotations.ReceiverAction in project androidannotations by androidannotations.

the class ReceiverActionHandler method process.

@Override
public void process(Element element, EReceiverHolder holder) throws Exception {
    ExecutableElement executableElement = (ExecutableElement) element;
    String methodName = element.getSimpleName().toString();
    ReceiverAction annotation = element.getAnnotation(ReceiverAction.class);
    String[] dataSchemes = annotation.dataSchemes();
    String[] actions = annotation.actions();
    JFieldVar actionKeyField = createStaticField(holder, "actions", methodName, actions);
    JFieldVar dataSchemesField = createStaticField(holder, "dataSchemes", methodName, dataSchemes);
    addActionInOnReceive(holder, executableElement, methodName, actionKeyField, dataSchemesField);
}
Also used : ReceiverAction(org.androidannotations.annotations.ReceiverAction) JFieldVar(com.helger.jcodemodel.JFieldVar) ExecutableElement(javax.lang.model.element.ExecutableElement)

Aggregations

JFieldVar (com.helger.jcodemodel.JFieldVar)1 ExecutableElement (javax.lang.model.element.ExecutableElement)1 ReceiverAction (org.androidannotations.annotations.ReceiverAction)1