public class ClassWriter extends ClassFile
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
static class |
ClassWriter.PoolOverflow
Thrown when the constant pool is over full.
|
static class |
ClassWriter.StringOverflow |
ClassFile.NameAndType, ClassFile.Version
Modifier and Type | Field and Description |
---|---|
protected static Context.Key<ClassWriter> |
classWriterKey |
CONSTANT_Class, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_InvokeDynamic, CONSTANT_Long, CONSTANT_MethodHandle, CONSTANT_Methodref, CONSTANT_MethodType, CONSTANT_NameandType, CONSTANT_String, CONSTANT_Unicode, CONSTANT_Utf8, JAVA_MAGIC, MAX_CODE, MAX_DIMENSIONS, MAX_LOCALS, MAX_PARAMETERS, MAX_STACK, REF_getField, REF_getStatic, REF_invokeInterface, REF_invokeSpecial, REF_invokeStatic, REF_invokeVirtual, REF_newInvokeSpecial, REF_putField, REF_putStatic
Modifier | Constructor and Description |
---|---|
protected |
ClassWriter(Context context)
Construct a class writer, given an options table.
|
Modifier and Type | Method and Description |
---|---|
static String |
flagNames(long flags)
Return flags as a string, separated by " ".
|
static ClassWriter |
instance(Context context)
Get the ClassWriter instance for this context.
|
JavaFileObject |
writeClass(Symbol.ClassSymbol c)
Emit a class file for a given class.
|
void |
writeClassFile(OutputStream out,
Symbol.ClassSymbol c)
Write class `c' to outstream `out'.
|
protected int |
writeEnclosingMethodAttribute(Name attributeName,
Symbol.ClassSymbol c)
Write the EnclosingMethod attribute with a specified name.
|
protected int |
writeExtraClassAttributes(Symbol.ClassSymbol c)
Allows subclasses to write additional class attributes
|
Name |
xClassName(Type t)
Given a type t, return the extended class name of its erasure in
external representation.
|
externalize, externalize, internalize, internalize
protected static final Context.Key<ClassWriter> classWriterKey
protected ClassWriter(Context context)
public static ClassWriter instance(Context context)
public static String flagNames(long flags)
public Name xClassName(Type t)
protected int writeEnclosingMethodAttribute(Name attributeName, Symbol.ClassSymbol c)
public JavaFileObject writeClass(Symbol.ClassSymbol c) throws IOException, ClassWriter.PoolOverflow, ClassWriter.StringOverflow
c
- The class from which a class file is generated.IOException
ClassWriter.PoolOverflow
ClassWriter.StringOverflow
public void writeClassFile(OutputStream out, Symbol.ClassSymbol c) throws IOException, ClassWriter.PoolOverflow, ClassWriter.StringOverflow
protected int writeExtraClassAttributes(Symbol.ClassSymbol c)
Copyright © 2017 earcam. All rights reserved.