/** * Returns a new object graph that includes all of the objects in this graph, * plus additional objects in the {@literal @}{@link Module}-annotated * modules. This graph is a subgraph of the returned graph. * * <p>The current graph is not modified by this operation: its objects and the * dependency links between them are unchanged. But this graph's objects may * be shared by both graphs. For example, the singletons of this graph may be * injected and used by the returned graph. * * <p>This <strong>does not</strong> inject any members or validate the graph. * See {@link #create} for guidance on injection and validation. */ public ObjectGraph plus(Object... modules) { linkEverything(); return makeGraph(this, plugin, modules); }
/** * Do runtime graph problem detection. For fastest graph creation, rely on * build time tools for graph validation. * * @throws IllegalStateException if this graph has problems. */ public void validate() { Map<String, Binding<?>> allBindings = linkEverything(); new ProblemDetector().detectProblems(allBindings.values()); }