Search in sources :

Example 1 with ServiceAction

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

the class ServiceActionHandler method process.

@Override
public void process(Element element, EIntentServiceHolder holder) throws Exception {
    ExecutableElement executableElement = (ExecutableElement) element;
    String methodName = element.getSimpleName().toString();
    ServiceAction annotation = element.getAnnotation(ServiceAction.class);
    String extraKey = annotation.value();
    if (extraKey.isEmpty()) {
        extraKey = methodName;
    }
    JFieldVar actionKeyField = createStaticActionField(holder, extraKey, methodName);
    addActionInOnHandleIntent(holder, executableElement, methodName, actionKeyField);
    addActionToIntentBuilder(holder, executableElement, methodName, actionKeyField);
}
Also used : JFieldVar(com.helger.jcodemodel.JFieldVar) ExecutableElement(javax.lang.model.element.ExecutableElement) ServiceAction(org.androidannotations.annotations.ServiceAction)

Aggregations

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