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 classClassWriter.LocalInfo
-
Field Summary
Fields Modifier and Type Field Description private CodeStream_dataBufferprivate CodeStream_poolBufferprivate CodeStream_signatureBufferprivate TypeBuilder<?>_typeBuilderprivate static intDATA_BUFFER_SIZEprivate static intJAVA_MAGICprivate static intPOOL_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description ClassWriter(TypeBuilder<?> typeBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intbeginAttributes()private voidendAttribute(int index)private voidendAttributes(int index, int count)private java.lang.annotation.RetentionPolicygetAnnotationRetention(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)private java.util.List<ClassWriter.LocalInfo>getLocalInfo(MethodBuilder builder)private booleanneedsLocalVariableTableEntry(Type<?> localType)(package private) voidputChar(CodeStream buf, int op, int x)(package private) voidputInt(CodeStream buf, int adr, int x)private voidwriteAnnotation(AnnotationBuilder<? extends java.lang.annotation.Annotation> a)private intwriteAttribute(java.lang.String attributeName)private voidwriteAttributeType(java.lang.Object value)private voidwriteBody(MethodBuilder method)voidwriteClass(CodeStream out)voidwriteClass(java.io.OutputStream out)private voidwriteCore()private intwriteEnclosingMethodAttribute(TypeBuilder<?> t)private voidwriteField(FieldBuilder field)private voidwriteFields()private intwriteFlagAttributes(long flags)private voidwriteInnerTypeInfo(Type<?> type)private intwriteInnerTypes()private intwriteJavaAnnotations(ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> annotations)private intwriteMemberAttributes(MemberInfo member)private voidwriteMethod(MethodBuilder method)private voidwriteMethods()private intwriteParameterAttributes(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)
-
-