1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Sun Feb 22 09:00:53 2015 +0100
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Mon Feb 23 08:38:32 2015 +0100
1.3 @@ -22,7 +22,18 @@
1.4
1.5 /** Build your own virtual machine! Use methods in this class to generate
1.6 * a skeleton JVM in JavaScript that contains pre-compiled classes of your
1.7 - * choice. The generated script defines one JavaScript method that can
1.8 + * choice:
1.9 + * <pre>
1.10 + * Writer w = new {@link java.io.StringWriter}();
1.11 + * {@link #newCompiler() Bck2Brwsr.newCompiler}()
1.12 + * .{@link #resources(org.apidesign.vm4brwsr.Bck2Brwsr.Resources)}
1.13 + * .{@link #addRootClasses(java.lang.String...)}
1.14 + * .{@link #addClasses(java.lang.String...)}
1.15 + * .{@link #addExported(java.lang.String...)}
1.16 + * .{@link #generate(java.lang.Appendable) generate(w)};
1.17 + * System.out.{@link java.io.PrintStream#print(java.lang.String) print(w.toString())};
1.18 + * </pre>
1.19 + * The generated script defines one JavaScript method that can
1.20 * be used to bootstrap and load the virtual machine: <pre>
1.21 * var vm = bck2brwsr();
1.22 * var main = vm.loadClass('org.your.pkg.Main');
1.23 @@ -61,7 +72,7 @@
1.24 * returns immediately and the call to the static main method will happen
1.25 * once the virtual machine is initialized and the class available.
1.26 *
1.27 - * @author Jaroslav Tulach <jtulach@netbeans.org>
1.28 + * @author Jaroslav Tulach
1.29 */
1.30 public final class Bck2Brwsr {
1.31 private final ObfuscationLevel level;
1.32 @@ -114,7 +125,7 @@
1.33 * empty Bck2Brwsr virtual machine. The instance can be further
1.34 * configured by calling chain of methods. For example:
1.35 * <pre>
1.36 - * {@link #createCompiler()}.{@link #resources(org.apidesign.vm4brwsr.Bck2Brwsr.Resources) resources(loader)}.{@link #addRootClasses(java.lang.String[]) addRootClasses("your/Clazz")}.{@link #generate(java.lang.Appendable) generate(out)};
1.37 + * {@link #newCompiler()}.{@link #resources(org.apidesign.vm4brwsr.Bck2Brwsr.Resources) resources(loader)}.{@link #addRootClasses(java.lang.String[]) addRootClasses("your/Clazz")}.{@link #generate(java.lang.Appendable) generate(out)};
1.38 * </pre>
1.39 *
1.40 * @return new instance of the Bck2Brwsr compiler
1.41 @@ -265,7 +276,8 @@
1.42 );
1.43 }
1.44
1.45 - /** Turns on the standalone mode. E.g. acts like {@link #library(boolean) library(false)},
1.46 + /** Turns on the standalone mode. E.g. does the opposite of
1.47 + * calling {@link #library(java.lang.String...)},
1.48 * but also allows to specify whether the <em>Bck2Brwsr VM</em> should
1.49 * be included at all. If not, only the skeleton of the launcher is
1.50 * generated without any additional VM classes referenced.
1.51 @@ -311,6 +323,7 @@
1.52 * compiler.
1.53 *
1.54 * @param out the output to write the generated JavaScript to
1.55 + * @throws IOException I/O exception can be thrown when something goes wrong
1.56 * @since 0.5
1.57 */
1.58 public void generate(Appendable out) throws IOException {