rt/aot/src/main/java/org/apidesign/bck2brwsr/aot/BytecodeProcessor.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 13 Sep 2014 13:44:01 +0200
branchjdk8
changeset 1678 35daab73e225
child 1787 ea12a3bb4b33
permissions -rw-r--r--
Can call RetroLambda processor in JAR files.
jaroslav@1678
     1
/**
jaroslav@1678
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1678
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1678
     4
 *
jaroslav@1678
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1678
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1678
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1678
     8
 *
jaroslav@1678
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1678
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1678
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1678
    12
 * GNU General Public License for more details.
jaroslav@1678
    13
 *
jaroslav@1678
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1678
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1678
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1678
    17
 */
jaroslav@1678
    18
package org.apidesign.bck2brwsr.aot;
jaroslav@1678
    19
jaroslav@1678
    20
import java.io.IOException;
jaroslav@1678
    21
import java.util.Map;
jaroslav@1678
    22
import org.apidesign.vm4brwsr.Bck2Brwsr;
jaroslav@1678
    23
jaroslav@1678
    24
/** Replace bytecode of a single class with many new bytecodes.
jaroslav@1678
    25
 *
jaroslav@1678
    26
 * @author Jaroslav Tulach
jaroslav@1678
    27
 */
jaroslav@1678
    28
interface BytecodeProcessor {
jaroslav@1678
    29
    /** Does the conversion.
jaroslav@1678
    30
     * 
jaroslav@1678
    31
     * @param className the resource of the class to replace
jaroslav@1678
    32
     * @param byteCode the bytecode of the class
jaroslav@1678
    33
     * @param resources access to other resources in the system
jaroslav@1678
    34
     * @return map of resource to bytecode which must include at least 
jaroslav@1678
    35
     *   one element of name <code>className</code>
jaroslav@1678
    36
     * @throws IOException 
jaroslav@1678
    37
     */
jaroslav@1678
    38
    public Map<String,byte[]> process(String className, byte[] byteCode, Bck2Brwsr.Resources resources)
jaroslav@1678
    39
    throws IOException;
jaroslav@1678
    40
}