@Override public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
Injector injector = linkedBinding.getInjector(); if (injector != null) { binding = injector.getBinding(linkedBinding.getLinkedKey()); continue;
Injector injector = linkedBinding.getInjector(); if (injector != null) { binding = injector.getBinding(linkedBinding.getLinkedKey()); continue;
@Override public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
@Override public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
public void applyTo(Binder binder) { getScoping().applyTo(binder.withSource(getSource()).bind(getKey()).to(getLinkedKey())); }
private <X> By getSelectorFromComponent(Class<X> component) { By selector = null; if (component.isAnnotationPresent( PageObjectInterface.class)) { Binding<?> binding = pageObjectInjector.getOriginalInjector().getBinding(component); if (binding instanceof LinkedBindingImpl) { selector = PageObjectProviderHelper .retrieveSelectorFromPageObjectInterface( ((LinkedBindingImpl) binding).getLinkedKey().getTypeLiteral().getRawType()); } } else { selector = PageObjectProviderHelper.retrieveSelectorFromPageObjectInterface(component); } return selector; } }
/** * Gets selector from {@link PageObject} if class annotated by this annotation is used in list * * @param field class field * @param originalInjector * @return selector */ public static By getSelectorFromGenericPageObject(Field field, Injector originalInjector) { Class<?> genericType = getGenericType(field); if (genericType != null && genericType.isAnnotationPresent( PageObjectInterface.class)) { Binding<?> binding = originalInjector.getBinding(genericType); if (binding instanceof LinkedBindingImpl) { return PageObjectProviderHelper.retrieveSelectorFromPageObjectInterface( ((LinkedBindingImpl) binding).getLinkedKey().getTypeLiteral().getRawType()); } } else { return retrieveSelectorFromPageObject(field, true); } throw new IllegalArgumentException(ERROR_MSG); }
/** * Gets selector from {@link PageObject} if class annotated by this annotation is used in list * * @param field class field * @param originalInjector * @return selector */ public static By getSelectorFromGenericPageObject(Field field, Injector originalInjector) { Class<?> genericType = getGenericType(field); if (genericType != null && genericType.isAnnotationPresent( PageObjectInterface.class)) { Binding<?> binding = originalInjector.getBinding(genericType); if (binding instanceof LinkedBindingImpl) { return PageObjectProviderHelper.retrieveSelectorFromPageObjectInterface( ((LinkedBindingImpl) binding).getLinkedKey().getTypeLiteral().getRawType()); } } else { return retrieveSelectorFromPageObject(field, true); } throw new IllegalArgumentException(ERROR_MSG); }
protected <X> By getSelectorFromComponent(Class<X> component) { By selector = null; if (component.isAnnotationPresent( PageObjectInterface.class)) { Binding<?> binding = pageObjectInjector.getOriginalInjector().getBinding(component); if (binding instanceof LinkedBindingImpl) { selector = PageObjectProviderHelper .retrieveSelectorFromPageObjectInterface( ((LinkedBindingImpl) binding).getLinkedKey().getTypeLiteral().getRawType()); } } else { selector = PageObjectProviderHelper.retrieveSelectorFromPageObjectInterface(component); } return selector; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { if (binding.getScoping().isEagerSingleton(stage)) { return true; } // handle a corner case where a child injector links to a binding in a parent injector, and // that binding is singleton. We won't catch this otherwise because we only iterate the child's // bindings. if (binding instanceof LinkedBindingImpl) { Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); } return false; }