public class ClassWriter extends java.lang.Object implements ClassConstants
Modifier and Type | Field and Description |
---|---|
protected short |
_codeIndex |
protected short |
_constantValueIndex |
protected short |
_deprecatedIndex |
protected short |
_exceptionsIndex |
protected short |
_innerClassesIndex |
protected short |
_lineNumberTableIndex |
protected short |
_localVariableTableIndex |
protected short |
_signatureIndex |
protected short |
_sourceFileIndex |
protected short |
_syntheticIndex |
protected java.util.Map<java.lang.String,java.lang.Short> |
classToIndex |
protected ConstantPool |
cpool |
static boolean |
DEBUG |
protected java.io.DataOutputStream |
dos |
protected InstanceKlass |
klass |
protected java.util.Map<java.lang.String,java.lang.Short> |
utf8ToIndex |
JVM_ACC_ABSTRACT, JVM_ACC_ANNOTATION, JVM_ACC_BRIDGE, JVM_ACC_ENUM, JVM_ACC_FIELD_ACCESS_WATCHED, JVM_ACC_FIELD_FLAGS, JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE, JVM_ACC_FIELD_MODIFICATION_WATCHED, JVM_ACC_FINAL, JVM_ACC_HAS_CHECKED_EXCEPTIONS, JVM_ACC_HAS_FINALIZER, JVM_ACC_HAS_JSRS, JVM_ACC_HAS_LINE_NUMBER_TABLE, JVM_ACC_HAS_LOCAL_VARIABLE_TABLE, JVM_ACC_HAS_LOOPS, JVM_ACC_HAS_MIRANDA_METHODS, JVM_ACC_HAS_MONITOR_BYTECODES, JVM_ACC_HAS_VANILLA_CONSTRUCTOR, JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE, JVM_ACC_IS_OBSOLETE, JVM_ACC_LOOPS_FLAG_INIT, JVM_ACC_MONITOR_MATCH, JVM_ACC_NATIVE, JVM_ACC_NOT_OSR_COMPILABLE, JVM_ACC_PRIVATE, JVM_ACC_PROMOTED_FLAGS, JVM_ACC_PROTECTED, JVM_ACC_PUBLIC, JVM_ACC_QUEUED, JVM_ACC_STATIC, JVM_ACC_STRICT, JVM_ACC_SUPER, JVM_ACC_SYNCHRONIZED, JVM_ACC_SYNTHETIC, JVM_ACC_TRANSIENT, JVM_ACC_VARARGS, JVM_ACC_VOLATILE, JVM_ACC_WRITTEN_FLAGS, JVM_CONSTANT_Class, JVM_CONSTANT_ClassIndex, JVM_CONSTANT_Double, JVM_CONSTANT_Fieldref, JVM_CONSTANT_Float, JVM_CONSTANT_Integer, JVM_CONSTANT_InterfaceMethodref, JVM_CONSTANT_Invalid, JVM_CONSTANT_InvokeDynamic, JVM_CONSTANT_Long, JVM_CONSTANT_MethodHandle, JVM_CONSTANT_MethodHandleInError, JVM_CONSTANT_Methodref, JVM_CONSTANT_MethodType, JVM_CONSTANT_MethodTypeInError, JVM_CONSTANT_NameAndType, JVM_CONSTANT_String, JVM_CONSTANT_StringIndex, JVM_CONSTANT_Unicode, JVM_CONSTANT_UnresolvedClass, JVM_CONSTANT_UnresolvedClassInError, JVM_CONSTANT_Utf8, JVM_RECOGNIZED_CLASS_MODIFIERS, JVM_RECOGNIZED_FIELD_MODIFIERS, JVM_RECOGNIZED_METHOD_MODIFIERS, JVM_REF_getField, JVM_REF_getStatic, JVM_REF_invokeInterface, JVM_REF_invokeSpecial, JVM_REF_invokeStatic, JVM_REF_invokeVirtual, JVM_REF_newInvokeSpecial, JVM_REF_putField, JVM_REF_putStatic, MAJOR_VERSION, MAJOR_VERSION_OLD, MINOR_VERSION, MINOR_VERSION_OLD
Constructor and Description |
---|
ClassWriter(InstanceKlass kls,
java.io.OutputStream os) |
Modifier and Type | Method and Description |
---|---|
protected void |
debugMessage(java.lang.String message) |
protected static int |
extractHighShortFromInt(int val) |
protected static int |
extractLowShortFromInt(int val) |
protected boolean |
hasSyntheticAttribute(short accessFlags) |
protected boolean |
isSynthetic(short accessFlags) |
protected void |
rewriteByteCode(Method m,
byte[] code) |
void |
write() |
protected void |
writeClassAccessFlags() |
protected void |
writeClassAttributes() |
protected void |
writeConstantPool() |
protected void |
writeFields() |
protected void |
writeGenericSignature(java.lang.String signature) |
protected void |
writeIndex(int index) |
protected void |
writeInterfaces() |
protected void |
writeMethod(Method m) |
protected void |
writeMethods() |
protected void |
writeSuperClass() |
protected void |
writeSynthetic() |
protected void |
writeThisClass() |
protected void |
writeVersion() |
public static final boolean DEBUG
protected InstanceKlass klass
protected java.io.DataOutputStream dos
protected ConstantPool cpool
protected java.util.Map<java.lang.String,java.lang.Short> classToIndex
protected java.util.Map<java.lang.String,java.lang.Short> utf8ToIndex
protected short _sourceFileIndex
protected short _innerClassesIndex
protected short _syntheticIndex
protected short _deprecatedIndex
protected short _constantValueIndex
protected short _codeIndex
protected short _exceptionsIndex
protected short _lineNumberTableIndex
protected short _localVariableTableIndex
protected short _signatureIndex
public ClassWriter(InstanceKlass kls, java.io.OutputStream os)
protected void debugMessage(java.lang.String message)
protected static int extractHighShortFromInt(int val)
protected static int extractLowShortFromInt(int val)
public void write() throws java.io.IOException
java.io.IOException
protected void writeVersion() throws java.io.IOException
java.io.IOException
protected void writeIndex(int index) throws java.io.IOException
java.io.IOException
protected void writeConstantPool() throws java.io.IOException
java.io.IOException
protected void writeClassAccessFlags() throws java.io.IOException
java.io.IOException
protected void writeThisClass() throws java.io.IOException
java.io.IOException
protected void writeSuperClass() throws java.io.IOException
java.io.IOException
protected void writeInterfaces() throws java.io.IOException
java.io.IOException
protected void writeFields() throws java.io.IOException
java.io.IOException
protected boolean isSynthetic(short accessFlags)
protected boolean hasSyntheticAttribute(short accessFlags)
protected void writeSynthetic() throws java.io.IOException
java.io.IOException
protected void writeMethods() throws java.io.IOException
java.io.IOException
protected void writeMethod(Method m) throws java.io.IOException
java.io.IOException
protected void rewriteByteCode(Method m, byte[] code)
protected void writeGenericSignature(java.lang.String signature) throws java.io.IOException
java.io.IOException
protected void writeClassAttributes() throws java.io.IOException
java.io.IOException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.