All Downloads are FREE. Search and download functionalities are using the official Maven repository.

icepick.ViewInjector Maven / Gradle / Ivy

package icepick;

import android.os.Parcelable;
import java.util.Map;

class ViewInjector extends AbsInjector {

  ViewInjector(Object target, Parcelable argument, Map, StateHelper> cachedHelpers) {
    super(target, argument, cachedHelpers);
  }

  Parcelable inject(Action action) {
    try {
      StateHelper inject = getHelperForClass(target.getClass());
      if (inject != null) {
        return action.invoke(inject, target, argument);
      }
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new UnableToInjectException(target, e);
    }

    return argument; // return super value
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy