package com.softwaremill.macwire;

import java.lang.annotation.*;

@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
@Inherited
public @interface Module {
}

@@ -60,16 +60,1664 @@
 ion.*;%0A%0A
+/**%0A * A Module groups classes of similar concern wired by macwire.%0A * Modules can then be assembled to form larger modules.%0A *%0A * A dependency on module M1 by module M2 is simply defined by a constructor parameter:%0A * %3Cpre class=%22code%22%3E%0A *     class M1%0A *     class M2(m1: M1) // M2 depends on M1%0A * %3C/pre%3E%0A *%0A * Module dependencies are interesting when accessing the members of the dependency:%0A * %3Cpre class=%22code%22%3E%0A *     class A%0A *     class B(a : A)%0A *%0A *     class M1 %7B%0A *         lazy val a = wire%5BA%5D%0A *     %7D%0A *%0A *     class M2(m1: M1) %7B%0A *         import m1.a%0A *%0A *         lazy val b = wire%5BB%5D%0A *     %7D%0A * %3C/pre%3E%0A *%0A * But having to always import the module members can become cumbersome:%0A * %3Cpre class=%22code%22%3E%0A *     class M9(m1: M1, m2: M2, m3) %7B%0A *         import m1._%0A *         import m2._%0A *         import m3._%0A *%0A *         lazy val x = wire%5BX%5D%0A *     %7D%0A *%0A *     class M10(m1: M1, m2: M2, m3: M3, m4: M4) %7B%0A *         import m1._%0A *         import m2._%0A *         import m3._%0A *         import m4._%0A *%0A *         lazy val y = wire%5BY%5D%0A *     %7D%0A * %3C/pre%3E%0A *%0A * That's when the %7B@code @Module%7D annotation comes into play. It will indicate that the members%0A * of the class should be searched by macwire when it is depended upon:%0A * %3Cpre class=%22code%22%3E%0A *     &#064;Module class M1%0A *     &#064;Module class M2%0A *     &#064;Module class M3%0A *     &#064;Module class M4%0A *%0A *     class M9(m1: M1, m2: M2, m3) %7B%0A *         // no import needed as M1, M2 and M3 are marked as &#064;Module%0A *         lazy val x = wire%5BX%5D%0A *     %7D%0A *%0A *     class M10(m1: M1, m2: M2, m3: M3, m4: M4) %7B%0A *         lazy val y = wire%5BY%5D%0A *     %7D%0A * %3C/pre%3E%0A */%0A
 @Retenti

document @Module