# HG changeset patch # User Jaroslav Tulach # Date 1424677112 -3600 # Node ID 46bf2ce6be799a6866a54a3c2ad1f91caacd71f3 # Parent 0dee66ee08d91cbbfd267ad85f45b140c93dc9f5 Showing how to invoke the Bck2Brwsr.newCompiler and fixing Javadoc lints diff -r 0dee66ee08d9 -r 46bf2ce6be79 rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Sun Feb 22 09:00:53 2015 +0100 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Mon Feb 23 08:38:32 2015 +0100 @@ -22,7 +22,18 @@ /** Build your own virtual machine! Use methods in this class to generate * a skeleton JVM in JavaScript that contains pre-compiled classes of your - * choice. The generated script defines one JavaScript method that can + * choice: + *
+ * Writer w = new {@link java.io.StringWriter}();
+ * {@link #newCompiler() Bck2Brwsr.newCompiler}()
+ *   .{@link #resources(org.apidesign.vm4brwsr.Bck2Brwsr.Resources)}
+ *   .{@link #addRootClasses(java.lang.String...)}
+ *   .{@link #addClasses(java.lang.String...)}
+ *   .{@link #addExported(java.lang.String...)}
+ *   .{@link #generate(java.lang.Appendable) generate(w)};
+ * System.out.{@link java.io.PrintStream#print(java.lang.String) print(w.toString())};
+ * 
+ * The generated script defines one JavaScript method that can * be used to bootstrap and load the virtual machine:
  * var vm = bck2brwsr();
  * var main = vm.loadClass('org.your.pkg.Main');
@@ -61,7 +72,7 @@
  * returns immediately and the call to the static main method will happen
  * once the virtual machine is initialized and the class available.
  *
- * @author Jaroslav Tulach 
+ * @author Jaroslav Tulach
  */
 public final class Bck2Brwsr {
     private final ObfuscationLevel level;
@@ -114,7 +125,7 @@
      * empty Bck2Brwsr virtual machine. The instance can be further
      * configured by calling chain of methods. For example: 
      * 
-     * {@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)};
+     * {@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)};
      * 
* * @return new instance of the Bck2Brwsr compiler @@ -265,7 +276,8 @@ ); } - /** Turns on the standalone mode. E.g. acts like {@link #library(boolean) library(false)}, + /** Turns on the standalone mode. E.g. does the opposite of + * calling {@link #library(java.lang.String...)}, * but also allows to specify whether the Bck2Brwsr VM should * be included at all. If not, only the skeleton of the launcher is * generated without any additional VM classes referenced. @@ -311,6 +323,7 @@ * compiler. * * @param out the output to write the generated JavaScript to + * @throws IOException I/O exception can be thrown when something goes wrong * @since 0.5 */ public void generate(Appendable out) throws IOException {