Class Elements


  • public final class Elements
    extends java.lang.Object
    Exposes elements of a module so they can be inspected, validated or rewritten.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Elements()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<Element> getElements​(Module... modules)
      Records the elements executed by modules.
      static java.util.List<Element> getElements​(Stage stage, Module... modules)
      Records the elements executed by modules.
      static java.util.List<Element> getElements​(Stage stage, java.lang.Iterable<? extends Module> modules)
      Records the elements executed by modules.
      static java.util.List<Element> getElements​(java.lang.Iterable<? extends Module> modules)
      Records the elements executed by modules.
      static Module getModule​(java.lang.Iterable<? extends Element> elements)
      Returns the module composed of elements.
      static Binder withTrustedSource​(com.google.inject.internal.GuiceInternal guiceInternal, Binder binder, java.lang.Object source)
      Internal version of Binder.withSource for establishing a trusted ElementSource chain for source-restricting bindings that are re-written using Element.applyTo(com.google.inject.Binder).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Elements

        public Elements()
    • Method Detail

      • getElements

        public static java.util.List<Element> getElements​(Module... modules)
        Records the elements executed by modules.
      • getElements

        public static java.util.List<Element> getElements​(Stage stage,
                                                          Module... modules)
        Records the elements executed by modules.
      • getElements

        public static java.util.List<Element> getElements​(java.lang.Iterable<? extends Module> modules)
        Records the elements executed by modules.
      • getElements

        public static java.util.List<Element> getElements​(Stage stage,
                                                          java.lang.Iterable<? extends Module> modules)
        Records the elements executed by modules.
      • withTrustedSource

        public static Binder withTrustedSource​(com.google.inject.internal.GuiceInternal guiceInternal,
                                               Binder binder,
                                               java.lang.Object source)
        Internal version of Binder.withSource for establishing a trusted ElementSource chain for source-restricting bindings that are re-written using Element.applyTo(com.google.inject.Binder).

        Using Binder.withSource is not trustworthy because it's a public API that external users can use to spoof the original ElementSource of a binding by calling withSource(bogusElementSource).

      • getModule

        public static Module getModule​(java.lang.Iterable<? extends Element> elements)
        Returns the module composed of elements.