ClassWriter when creating a type.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | ClassWriterStrategy.Default
Default implementations of class writer strategies. |
| public static class | ClassWriterStrategy.FrameComputingClassWriter
A class writer that piggy-backs on Byte Buddy's |
| Modifier and Type | Method and Description |
|---|---|
| public ClassWriter | |
| public ClassWriter | Returns: The class writer to use.The flags to set. flags, TypePool A type pool for locating types. typePool, ClassReader The class reader from which the original class is read. classReader)Resolves a class writer. |
| resolve | back to summary |
|---|---|
| public ClassWriter resolve(int flags, TypePool typePool) Resolves a class writer.
| |
| resolve | back to summary |
|---|---|
| public ClassWriter resolve(int flags, TypePool typePool, ClassReader classReader) Resolves a class writer.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final ClassWriterStrategy. | CONSTANT_POOL_DISCARDING
A class writer strategy that discards the original class's constant pool if applicable. |
| public static final ClassWriterStrategy. | CONSTANT_POOL_RETAINING
A class writer strategy that retains the original class's constant pool if applicable. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ClassWriter | resolve(int
The flags to set. flags, TypePool A type pool for locating types. typePool)Implements net. |
| public static ClassWriterStrategy. | |
| public static ClassWriterStrategy. |
| CONSTANT_POOL_DISCARDING | back to summary |
|---|---|
| public static final ClassWriterStrategy. A class writer strategy that discards the original class's constant pool if applicable. | |
| CONSTANT_POOL_RETAINING | back to summary |
|---|---|
| public static final ClassWriterStrategy. A class writer strategy that retains the original class's constant pool if applicable. | |
| Default | back to summary |
|---|---|
| private Default() | |
| resolve | back to summary |
|---|---|
| public ClassWriter resolve(int flags, TypePool typePool) Implements net. Doc from net. Resolves a class writer.
| |
| valueOf | back to summary |
|---|---|
| public static ClassWriterStrategy. | |
| values | back to summary |
|---|---|
| public static ClassWriterStrategy. | |
TypePool to avoid class loading or look-up errors when redefining a class.
This is not available when creating a new class where automatic frame computation is however not normally a requirement.
| Modifier and Type | Field and Description |
|---|---|
| private final TypePool | typePool
The type pool to use for computing stack map frames, if required. |
| Access | Constructor and Description |
|---|---|
| public | FrameComputingClassWriter(int
The flags to be handed to the writer. flags, TypePool The type pool to use for computing stack map frames, if required. typePool)Creates a new frame computing class writer. |
| public | FrameComputingClassWriter(ClassReader
The class reader from which the original class is read. classReader, int The flags to be handed to the writer. flags, TypePool The type pool to use for computing stack map frames, if required. typePool)Creates a new frame computing class writer. |
| Modifier and Type | Method and Description |
|---|---|
| protected String | getCommonSuperClass(String
the internal name of a class (see leftTypeName, String Type#getInternalName()).the internal name of another class (see rightTypeName)Type#getInternalName()).Overrides net. |
| typePool | back to summary |
|---|---|
| private final TypePool typePool The type pool to use for computing stack map frames, if required. | |
| FrameComputingClassWriter | back to summary |
|---|---|
| public FrameComputingClassWriter(int flags, TypePool typePool) Creates a new frame computing class writer.
| |
| FrameComputingClassWriter | back to summary |
|---|---|
| public FrameComputingClassWriter(ClassReader classReader, int flags, TypePool typePool) Creates a new frame computing class writer.
| |
| getCommonSuperClass | back to summary |
|---|---|
| protected String getCommonSuperClass(String leftTypeName, String rightTypeName) Overrides net. Doc from net. Returns the common super type of the two given types. The default implementation of this method loads the two given classes and uses the java.lang.Class methods to find the common super class. It can be overridden to compute this common super type in other ways, in particular without actually loading any class, or to take into account the class that is currently being generated by this ClassWriter, which can of course not be loaded since it is under construction.
| |