boot/src/main/java/org/apidesign/html/boot/impl/FnUtils.java
branchpreprocess
changeset 331 72dda6af599b
parent 323 86aabecda7a3
child 332 386429032402
     1.1 --- a/boot/src/main/java/org/apidesign/html/boot/impl/FnUtils.java	Wed Nov 06 15:15:54 2013 +0100
     1.2 +++ b/boot/src/main/java/org/apidesign/html/boot/impl/FnUtils.java	Sun Nov 24 15:39:55 2013 +0100
     1.3 @@ -29,6 +29,7 @@
     1.4  import java.util.Collections;
     1.5  import java.util.Enumeration;
     1.6  import java.util.List;
     1.7 +import java.util.Map;
     1.8  import java.util.concurrent.Callable;
     1.9  import org.apidesign.html.boot.spi.Fn;
    1.10  import org.objectweb.asm.AnnotationVisitor;
    1.11 @@ -52,6 +53,19 @@
    1.12      private FnUtils() {
    1.13      }
    1.14      
    1.15 +    /** Seeks for {@link JavaScriptBody} and {@link JavaScriptResource} annotations
    1.16 +     * in the bytecode and converts them into real code. Used by Maven plugin
    1.17 +     * postprocessing classes.
    1.18 +     * 
    1.19 +     * @param bytecode the original bytecode with javascript specific annotations
    1.20 +     * @param resources the resources to load
    1.21 +     * @return the transformed bytecode
    1.22 +     * @since 0.7
    1.23 +     */
    1.24 +    public static byte[] transform(byte[] bytecode, Map<String,InputStream> resources) {
    1.25 +        return transform(null, bytecode);
    1.26 +    }
    1.27 +    
    1.28      public static boolean isJavaScriptCapable(ClassLoader l) {
    1.29          if (l instanceof JsClassLoader) {
    1.30              return true;