Home » openjdk-7 » com.sun.tools » javac » jvm » [javadoc | source]
public class: ClassWriter [javadoc | source]
This class provides operations to map an internal symbol table graph rooted in a ClassSymbol into a 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.
Nested Class Summary:
public static class  ClassWriter.PoolOverflow  Thrown when the constant pool is over full. 
public static class  ClassWriter.StringOverflow   
class  ClassWriter.AttributeWriter  A visitor to write an attribute including its leading single-character marker. 
abstract static class  ClassWriter.StackMapTableFrame  An entry in the JSR202 StackMapTable 
Field Summary
protected static final  Key<ClassWriter> classWriterKey     
 boolean debugstackmap    Switch: describe the generated stackmap 
static final  int DATA_BUF_SIZE    The initial sizes of the data and constant pool buffers. sizes are increased when buffers get full. 
static final  int POOL_BUF_SIZE     
 ByteBuffer databuf    An output buffer for member info. 
 ByteBuffer poolbuf    An output buffer for the constant pool. 
 ByteBuffer sigbuf    An output buffer for type signatures. 
 Pool pool    The constant pool. 
 Set<ClassSymbol> innerClasses    The inner classes to be written, as a set. 
 ListBuffer<ClassSymbol> innerClassesQueue    The inner classes to be written, as a queue where enclosing classes come first. 
static final  int SAME_FRAME_SIZE    The tags and constants used in compressed stackmap. 
static final  int SAME_LOCALS_1_STACK_ITEM_EXTENDED     
static final  int SAME_FRAME_EXTENDED     
static final  int FULL_FRAME     
static final  int MAX_LOCAL_LENGTH_DIFF     
 AttributeWriter awriter     
Fields inherited from com.sun.tools.javac.jvm.ClassFile:
Method from com.sun.tools.javac.jvm.ClassWriter Summary:
adjustFlags,   assembleClassSig,   assembleParamsSig,   assembleSig,   assembleSig,   beginAttrs,   endAttr,   endAttrs,   enterInner,   fieldName,   flagNames,   getLastModified,   hasTypeVar,   instance,   nameType,   putChar,   putInt,   typeSig,   writeAttr,   writeClass,   writeClassFile,   writeCode,   writeCompoundAttribute,   writeEnclosingMethodAttribute,   writeField,   writeFields,   writeFlagAttrs,   writeInnerClasses,   writeJavaAnnotations,   writeMemberAttrs,   writeMethod,   writeMethods,   writeParameterAttrs,   writePool,   writeStackMap,   writeStackMapType,   xClassName
Methods from com.sun.tools.javac.jvm.ClassFile:
externalize,   externalize,   internalize,   internalize
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.jvm.ClassWriter Detail:
 int adjustFlags(long flags) 
  void assembleClassSig(Type type) 
  void assembleParamsSig(List<Type> typarams) 
  void assembleSig(Type type) 
    Assemble signature of given type in string buffer.
  void assembleSig(List<Type> types) 
 int beginAttrs() 
    Leave space for attribute count and return index for number of attributes field.
  void endAttr(int index) 
    Fill in attribute length.
  void endAttrs(int index,
    int count) 
    Fill in number of attributes.
  void enterInner(ClassSymbol c) 
    Enter an inner class into the `innerClasses' set/queue.
 Name fieldName(Symbol sym) 
    Given a field, return its name.
 public static String flagNames(long flags) 
    Return flags as a string, separated by " ".
 long getLastModified(FileObject filename) 
 boolean hasTypeVar(List<Type> l) 
 public static ClassWriter instance(Context context) 
    Get the ClassWriter instance for this context.
 NameAndType nameType(Symbol sym) 
    Given a symbol, return its name-and-type.
  void putChar(ByteBuffer buf,
    int op,
    int x) 
    Write a character into given byte buffer; byte buffer will not be grown.
  void putInt(ByteBuffer buf,
    int adr,
    int x) 
    Write an integer into given byte buffer; byte buffer will not be grown.
 Name typeSig(Type type) 
    Return signature of given type
 int writeAttr(Name attrName) 
    Write header for an attribute to data buffer and return position past attribute length index.
 public JavaFileObject writeClass(ClassSymbol c) throws IOException, PoolOverflow, StringOverflow 
    Emit a class file for a given class.
 public  void writeClassFile(OutputStream out,
    ClassSymbol c) throws IOException, PoolOverflow, StringOverflow 
    Write class `c' to outstream `out'.
  void writeCode(Code code) 
    Write code attribute of method.
  void writeCompoundAttribute(Compound c) 
    Write a compound attribute excluding the '@' marker.
 int writeEnclosingMethodAttribute(ClassSymbol c) 
    Write the EnclosingMethod attribute if needed. Returns the number of attributes written (0 or 1).
  void writeField(VarSymbol v) 
    Write field symbol, entering all references into constant pool.
  void writeFields(Entry e) 
 int writeFlagAttrs(long flags) 
    Write flag attributes; return number of attributes written.
  void writeInnerClasses() 
    Write "inner classes" attribute.
 int writeJavaAnnotations(List<Compound> attrs) 
    Write Java-language annotations; return number of JVM attributes written (zero or one).
 int writeMemberAttrs(Symbol sym) 
    Write member (field or method) attributes; return number of attributes written.
  void writeMethod(MethodSymbol m) 
    Write method symbol, entering all references into constant pool.
  void writeMethods(Entry e) 
 int writeParameterAttrs(MethodSymbol m) 
    Write method parameter annotations; return number of attributes written.
  void writePool(Pool pool) throws PoolOverflow, StringOverflow 
    Write constant pool to pool buffer. Note: during writing, constant pool might grow since some parts of constants still need to be entered.
  void writeStackMap(Code code) 
  void writeStackMapType(Type t) 
 public Name xClassName(Type t) 
    Given a type t, return the extended class name of its erasure in external representation.