Class StaticClassWriter
- java.lang.Object
-
- org.objectweb.asm.ClassVisitor
-
- org.objectweb.asm.ClassWriter
-
- com.google.monitoring.runtime.instrumentation.StaticClassWriter
-
public class StaticClassWriter extends org.objectweb.asm.ClassWriterAClassWriterthat looks for static class data in the classpath when the classes are not available at runtime.ClassWriter uses class hierarchy information, which it gets by looking at loaded classes, to make some decisions about the best way to write classes. The problem with this is that it fails if the superclass hasn't been loaded yet. StaticClassWriter fails over to looking for the class hierarchy information in the ClassLoader's resources (usually the classpath) if the class it needs hasn't been loaded yet.
This class was heavily influenced by ASM's org.objectweb.asm.util.ClassWriterComputeFramesTest, which contains the same logic in a subclass. The code here has been slightly cleaned up for readability.
-
-
Constructor Summary
Constructors Constructor Description StaticClassWriter(org.objectweb.asm.ClassReader classReader, int flags, java.lang.ClassLoader classLoader)StaticClassWriter(org.objectweb.asm.ClassReader classReader, int flags, java.lang.ClassLoader classLoader, boolean alwaysStatic)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetCommonSuperClass(java.lang.String type1, java.lang.String type2)-
Methods inherited from class org.objectweb.asm.ClassWriter
getClassLoader, hasFlags, newClass, newConst, newConstantDynamic, newField, newHandle, newHandle, newInvokeDynamic, newMethod, newMethodType, newModule, newNameType, newPackage, newUTF8, toByteArray, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
-
-
-
Constructor Detail
-
StaticClassWriter
public StaticClassWriter(org.objectweb.asm.ClassReader classReader, int flags, java.lang.ClassLoader classLoader)- Parameters:
classLoader- the class loader that loaded this class
-
StaticClassWriter
public StaticClassWriter(org.objectweb.asm.ClassReader classReader, int flags, java.lang.ClassLoader classLoader, boolean alwaysStatic)- Parameters:
classLoader- the class loader that loaded this classalwaysStatic- whether to always load class data statically
-
-