use of org.androidannotations.helper.BundleHelper in project androidannotations by androidannotations.
the class ExtraParameterHandler method getExtraValue.
public IJExpression getExtraValue(VariableElement parameter, JVar extras, JBlock block, JMethod annotatedMethod, JDefinedClass generatedClass) {
String parameterName = parameter.getSimpleName().toString();
AbstractJClass parameterClass = codeModelHelper.typeMirrorToJClass(parameter.asType());
String extraKey = getAnnotationValue(parameter);
if (extraKey == null || extraKey.isEmpty()) {
extraKey = parameterName;
}
BundleHelper bundleHelper = new BundleHelper(getEnvironment(), parameter.asType());
IJExpression restoreMethodCall = bundleHelper.getExpressionToRestoreFromBundle(parameterClass, extras, getStaticExtraField(generatedClass, extraKey), annotatedMethod);
return block.decl(parameterClass, parameterName, restoreMethodCall);
}
Aggregations