public final class CodeGenerator extends Object
Modifier and Type | Method and Description |
---|---|
static ClassGeneratorImpl |
defineClass(int modifiers,
String name,
Type superType,
List<Type> impls)
Define a ClassGeneratorImpl for a class.
|
static ClassGeneratorImpl |
defineInterface(int modifiers,
String name,
List<Type> impls)
Define a ClassGeneratorImpl for an interface.
|
static byte[] |
generateBytecode(ClassGeneratorImpl cg,
ClassLoader cl,
ImportList imports,
Properties options,
PrintStream debugOutput)
Convert the Java class or interface defined by ClassGeneratorImpl into an array
of bytecodes.
|
static void |
generateSourceCode(PrintStream ps,
ClassGeneratorImpl cg,
ImportList imports,
Properties options)
Write a source code representation of the class or interface defined by
cg to the PrintStream ps.
|
static void |
generateSourceCode(String sdir,
ClassGeneratorImpl cg,
ImportList imports,
Properties options)
Write a source code representation of the class or interface defined by
cg to a file in the SOURCE_GENERATION_DIRECTORY specified in options.
|
public static ClassGeneratorImpl defineClass(int modifiers, String name, Type superType, List<Type> impls)
public static ClassGeneratorImpl defineInterface(int modifiers, String name, List<Type> impls)
public static byte[] generateBytecode(ClassGeneratorImpl cg, ClassLoader cl, ImportList imports, Properties options, PrintStream debugOutput)
public static void generateSourceCode(PrintStream ps, ClassGeneratorImpl cg, ImportList imports, Properties options) throws IOException
IOException
public static void generateSourceCode(String sdir, ClassGeneratorImpl cg, ImportList imports, Properties options) throws IOException
IOException
Copyright © 2017 Oracle. All rights reserved.