Object instantiate(@Nonnull DAGNode<Component, Dependency> node) throws InjectionException { DAGNode<Component,Dependency> n2 = processNode(node, node); return instantiator.instantiate(n2); }
public <T> T tryGetInstance(QualifierMatcher qmatch, Class<T> type) throws InjectionException { DAGNode<Component, Dependency> node = GraphtUtils.findSatisfyingNode(graph, qmatch, type); return node != null ? type.cast(instantiator.instantiate(node)) : null; }
@Nonnull @Override public Object apply(@Nullable DAGNode<Component, Dependency> input) { Preconditions.checkNotNull(input, "input node"); try { return instantiate(input); } catch (InjectionException e) { throw new RecommenderBuildException("cannot instantiate " + input.getLabel(), e); } }
@Nullable public <T> T tryGetInstance(Class<T> type) throws InjectionException { Desire d = Desires.create(null, type, true); DAGEdge<Component, Dependency> e = graph.getOutgoingEdgeWithLabel(l -> l.hasInitialDesire(d)); if (e != null) { return type.cast(instantiator.instantiate(e.getTail())); } else { DAGNode<Component, Dependency> node = GraphtUtils.findSatisfyingNode(graph, Qualifiers.matchDefault(), type); if (node != null) { return type.cast(instantiator.instantiate(node)); } else { return null; } } }
Object result = instantiator.instantiate(node); if (result == null) {
Object instantiate(@Nonnull DAGNode<Component, Dependency> node) throws InjectionException { DAGNode<Component,Dependency> n2 = processNode(node, node); return instantiator.instantiate(n2); }
public <T> T tryGetInstance(QualifierMatcher qmatch, Class<T> type) throws InjectionException { DAGNode<Component, Dependency> node = GraphtUtils.findSatisfyingNode(graph, qmatch, type); return node != null ? type.cast(instantiator.instantiate(node)) : null; }
@Nonnull @Override public Object apply(@Nullable DAGNode<Component, Dependency> input) { Preconditions.checkNotNull(input, "input node"); try { return instantiate(input); } catch (InjectionException e) { throw new RecommenderBuildException("cannot instantiate " + input.getLabel(), e); } }
@Nullable public <T> T tryGetInstance(Class<T> type) throws InjectionException { Desire d = Desires.create(null, type, true); DAGEdge<Component, Dependency> e = graph.getOutgoingEdgeWithLabel(l -> l.hasInitialDesire(d)); if (e != null) { return type.cast(instantiator.instantiate(e.getTail())); } else { DAGNode<Component, Dependency> node = GraphtUtils.findSatisfyingNode(graph, Qualifiers.matchDefault(), type); if (node != null) { return type.cast(instantiator.instantiate(node)); } else { return null; } } }
Object result = instantiator.instantiate(node); if (result == null) {