Package com.strobel.reflection.emit
Class ClassWriter
- java.lang.Object
-
- com.strobel.reflection.emit.ClassWriter
-
final class ClassWriter extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ClassWriter.LocalInfo
-
Field Summary
Fields Modifier and Type Field Description private CodeStream
_dataBuffer
private CodeStream
_poolBuffer
private CodeStream
_signatureBuffer
private TypeBuilder<?>
_typeBuilder
private static int
DATA_BUFFER_SIZE
private static int
JAVA_MAGIC
private static int
POOL_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description ClassWriter(TypeBuilder<?> typeBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
beginAttributes()
private void
endAttribute(int index)
private void
endAttributes(int index, int count)
private java.lang.annotation.RetentionPolicy
getAnnotationRetention(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)
private java.util.List<ClassWriter.LocalInfo>
getLocalInfo(MethodBuilder builder)
private boolean
needsLocalVariableTableEntry(Type<?> localType)
(package private) void
putChar(CodeStream buf, int op, int x)
(package private) void
putInt(CodeStream buf, int adr, int x)
private void
writeAnnotation(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)
private int
writeAttribute(java.lang.String attributeName)
private void
writeAttributeType(java.lang.Object value)
private void
writeBody(MethodBuilder method)
void
writeClass(CodeStream out)
void
writeClass(java.io.OutputStream out)
private void
writeCore()
private int
writeEnclosingMethodAttribute(TypeBuilder<?> t)
private void
writeField(FieldBuilder field)
private void
writeFields()
private int
writeFlagAttributes(long flags)
private void
writeInnerTypeInfo(Type<?> type)
private int
writeInnerTypes()
private int
writeJavaAnnotations(ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> annotations)
private int
writeMemberAttributes(MemberInfo member)
private void
writeMethod(MethodBuilder method)
private void
writeMethods()
private int
writeParameterAttributes(MethodBuilder method)
-
-
-
Field Detail
-
JAVA_MAGIC
private static final int JAVA_MAGIC
- See Also:
- Constant Field Values
-
DATA_BUFFER_SIZE
private static final int DATA_BUFFER_SIZE
- See Also:
- Constant Field Values
-
POOL_BUFFER_SIZE
private static final int POOL_BUFFER_SIZE
- See Also:
- Constant Field Values
-
_dataBuffer
private final CodeStream _dataBuffer
-
_poolBuffer
private final CodeStream _poolBuffer
-
_signatureBuffer
private final CodeStream _signatureBuffer
-
_typeBuilder
private final TypeBuilder<?> _typeBuilder
-
-
Constructor Detail
-
ClassWriter
ClassWriter(TypeBuilder<?> typeBuilder)
-
-
Method Detail
-
writeClass
public void writeClass(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
writeClass
public void writeClass(CodeStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
writeCore
private void writeCore()
-
writeEnclosingMethodAttribute
private int writeEnclosingMethodAttribute(TypeBuilder<?> t)
-
writeInnerTypes
private int writeInnerTypes()
-
writeInnerTypeInfo
private void writeInnerTypeInfo(Type<?> type)
-
writeFields
private void writeFields()
-
writeField
private void writeField(FieldBuilder field)
-
writeMethods
private void writeMethods()
-
writeMethod
private void writeMethod(MethodBuilder method)
-
writeBody
private void writeBody(MethodBuilder method)
-
needsLocalVariableTableEntry
private boolean needsLocalVariableTableEntry(Type<?> localType)
-
getLocalInfo
private java.util.List<ClassWriter.LocalInfo> getLocalInfo(MethodBuilder builder)
-
writeMemberAttributes
private int writeMemberAttributes(MemberInfo member)
-
writeParameterAttributes
private int writeParameterAttributes(MethodBuilder method)
-
getAnnotationRetention
private java.lang.annotation.RetentionPolicy getAnnotationRetention(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)
-
writeJavaAnnotations
private int writeJavaAnnotations(ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> annotations)
-
writeAnnotation
private void writeAnnotation(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)
-
writeAttributeType
private void writeAttributeType(java.lang.Object value)
-
writeAttribute
private int writeAttribute(java.lang.String attributeName)
-
beginAttributes
private int beginAttributes()
-
endAttributes
private void endAttributes(int index, int count)
-
endAttribute
private void endAttribute(int index)
-
writeFlagAttributes
private int writeFlagAttributes(long flags)
-
putChar
void putChar(CodeStream buf, int op, int x)
-
putInt
void putInt(CodeStream buf, int adr, int x)
-
-