public void visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute) { // Read the default element value. ElementValue elementValue = createElementValue(); elementValue.accept(clazz, null, this); annotationDefaultAttribute.defaultValue = elementValue; }
public void visitStackMapTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapTableAttribute stackMapTableAttribute) { // Read the stack map frames. stackMapTableAttribute.u2stackMapFramesCount = dataInput.readUnsignedShort(); stackMapTableAttribute.stackMapFrames = new StackMapFrame[stackMapTableAttribute.u2stackMapFramesCount]; for (int index = 0; index < stackMapTableAttribute.u2stackMapFramesCount; index++) { StackMapFrame stackMapFrame = createStackMapFrame(); stackMapFrame.accept(clazz, method, codeAttribute, 0, this); stackMapTableAttribute.stackMapFrames[index] = stackMapFrame; } }
public void visitMoreZeroFrame(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, MoreZeroFrame moreZeroFrame) { moreZeroFrame.u2offsetDelta = dataInput.readUnsignedShort(); // Read the verification types of the additional local variables. moreZeroFrame.additionalVariables = new VerificationType[moreZeroFrame.additionalVariablesCount]; for (int index = 0; index < moreZeroFrame.additionalVariablesCount; index++) { VerificationType verificationType = createVerificationType(); verificationType.accept(clazz, method, codeAttribute, offset, this); moreZeroFrame.additionalVariables[index] = verificationType; } }
public void visitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation) { // Read the target info. TargetInfo targetInfo = createTargetInfo(); targetInfo.accept(clazz, typeAnnotation, this); typeAnnotation.targetInfo = targetInfo; // Read the type path. int u1pathLength = dataInput.readUnsignedByte(); typeAnnotation.typePath = new TypePathInfo[u1pathLength]; for (int index = 0; index < u1pathLength; index++) { TypePathInfo typePathInfo = new TypePathInfo(); visitTypePathInfo(clazz, typeAnnotation, typePathInfo); typeAnnotation.typePath[index] = typePathInfo; } // Read the actual annotation. visitAnnotation(clazz, typeAnnotation); }
for (int index = 1; index < programClass.u2constantPoolCount; index++) Constant constant = createConstant(); constant.accept(programClass, this); programClass.constantPool[index] = constant; this.visitProgramField(programClass, programField); programClass.fields[index] = programField; this.visitProgramMethod(programClass, programMethod); programClass.methods[index] = programMethod; for (int index = 0; index < programClass.u2attributesCount; index++) Attribute attribute = createAttribute(programClass); attribute.accept(programClass, this); programClass.attributes[index] = attribute;
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Read the stack size and local variable frame size. codeAttribute.u2maxStack = dataInput.readUnsignedShort(); codeAttribute.u2maxLocals = dataInput.readUnsignedShort(); // Read the byte code. codeAttribute.u4codeLength = dataInput.readInt(); byte[] code = new byte[codeAttribute.u4codeLength]; dataInput.readFully(code); codeAttribute.code = code; // Read the exceptions. codeAttribute.u2exceptionTableLength = dataInput.readUnsignedShort(); codeAttribute.exceptionTable = new ExceptionInfo[codeAttribute.u2exceptionTableLength]; for (int index = 0; index < codeAttribute.u2exceptionTableLength; index++) { ExceptionInfo exceptionInfo = new ExceptionInfo(); this.visitExceptionInfo(clazz, method, codeAttribute, exceptionInfo); codeAttribute.exceptionTable[index] = exceptionInfo; } // Read the code attributes. codeAttribute.u2attributesCount = dataInput.readUnsignedShort(); codeAttribute.attributes = new Attribute[codeAttribute.u2attributesCount]; for (int index = 0; index < codeAttribute.u2attributesCount; index++) { Attribute attribute = createAttribute(clazz); attribute.accept(clazz, method, codeAttribute, this); codeAttribute.attributes[index] = attribute; } }
public void visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue) { // Read the annotation. Annotation annotationValue = new Annotation(); visitAnnotation(clazz, annotationValue); annotationElementValue.annotationValue = annotationValue; }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { // Read the general field information. programField.u2accessFlags = dataInput.readUnsignedShort(); programField.u2nameIndex = dataInput.readUnsignedShort(); programField.u2descriptorIndex = dataInput.readUnsignedShort(); // Read the field attributes. programField.u2attributesCount = dataInput.readUnsignedShort(); programField.attributes = new Attribute[programField.u2attributesCount]; for (int index = 0; index < programField.u2attributesCount; index++) { Attribute attribute = createAttribute(programClass); attribute.accept(programClass, programField, this); programField.attributes[index] = attribute; } }
public void visitInnerClassesAttribute(Clazz clazz, InnerClassesAttribute innerClassesAttribute) { // Read the inner classes. innerClassesAttribute.u2classesCount = dataInput.readUnsignedShort(); innerClassesAttribute.classes = new InnerClassesInfo[innerClassesAttribute.u2classesCount]; for (int index = 0; index < innerClassesAttribute.u2classesCount; index++) { InnerClassesInfo innerClassesInfo = new InnerClassesInfo(); this.visitInnerClassesInfo(clazz, innerClassesInfo); innerClassesAttribute.classes[index] = innerClassesInfo; } }
public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute) { // Read the stack map frames (only full frames, without tag). stackMapAttribute.u2stackMapFramesCount = dataInput.readUnsignedShort(); stackMapAttribute.stackMapFrames = new FullFrame[stackMapAttribute.u2stackMapFramesCount]; for (int index = 0; index < stackMapAttribute.u2stackMapFramesCount; index++) { FullFrame stackMapFrame = new FullFrame(); this.visitFullFrame(clazz, method, codeAttribute, index, stackMapFrame); stackMapAttribute.stackMapFrames[index] = stackMapFrame; } }
clazz.accept(new ProgramClassReader(dataInputStream));
for (int index = 1; index < programClass.u2constantPoolCount; index++) Constant constant = createConstant(); constant.accept(programClass, this); programClass.constantPool[index] = constant; this.visitProgramField(programClass, programField); programClass.fields[index] = programField; this.visitProgramMethod(programClass, programMethod); programClass.methods[index] = programMethod; for (int index = 0; index < programClass.u2attributesCount; index++) Attribute attribute = createAttribute(programClass); attribute.accept(programClass, this); programClass.attributes[index] = attribute;
public void visitTypeAnnotation(Clazz clazz, TypeAnnotation typeAnnotation) { // Read the target info. TargetInfo targetInfo = createTargetInfo(); targetInfo.accept(clazz, typeAnnotation, this); typeAnnotation.targetInfo = targetInfo; // Read the type path. int u1pathLength = dataInput.readUnsignedByte(); typeAnnotation.typePath = new TypePathInfo[u1pathLength]; for (int index = 0; index < u1pathLength; index++) { TypePathInfo typePathInfo = new TypePathInfo(); visitTypePathInfo(clazz, typeAnnotation, typePathInfo); typeAnnotation.typePath[index] = typePathInfo; } // Read the actual annotation. visitAnnotation(clazz, typeAnnotation); }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Read the stack size and local variable frame size. codeAttribute.u2maxStack = dataInput.readUnsignedShort(); codeAttribute.u2maxLocals = dataInput.readUnsignedShort(); // Read the byte code. codeAttribute.u4codeLength = dataInput.readInt(); byte[] code = new byte[codeAttribute.u4codeLength]; dataInput.readFully(code); codeAttribute.code = code; // Read the exceptions. codeAttribute.u2exceptionTableLength = dataInput.readUnsignedShort(); codeAttribute.exceptionTable = new ExceptionInfo[codeAttribute.u2exceptionTableLength]; for (int index = 0; index < codeAttribute.u2exceptionTableLength; index++) { ExceptionInfo exceptionInfo = new ExceptionInfo(); visitExceptionInfo(clazz, method, codeAttribute, exceptionInfo); codeAttribute.exceptionTable[index] = exceptionInfo; } // Read the code attributes. codeAttribute.u2attributesCount = dataInput.readUnsignedShort(); codeAttribute.attributes = new Attribute[codeAttribute.u2attributesCount]; for (int index = 0; index < codeAttribute.u2attributesCount; index++) { Attribute attribute = createAttribute(clazz); attribute.accept(clazz, method, codeAttribute, this); codeAttribute.attributes[index] = attribute; } }
public void visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue) { // Read the annotation. Annotation annotationValue = new Annotation(); this.visitAnnotation(clazz, annotationValue); annotationElementValue.annotationValue = annotationValue; }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { // Read the general field information. programField.u2accessFlags = dataInput.readUnsignedShort(); programField.u2nameIndex = dataInput.readUnsignedShort(); programField.u2descriptorIndex = dataInput.readUnsignedShort(); // Read the field attributes. programField.u2attributesCount = dataInput.readUnsignedShort(); programField.attributes = new Attribute[programField.u2attributesCount]; for (int index = 0; index < programField.u2attributesCount; index++) { Attribute attribute = createAttribute(programClass); attribute.accept(programClass, programField, this); programField.attributes[index] = attribute; } }
public void visitInnerClassesAttribute(Clazz clazz, InnerClassesAttribute innerClassesAttribute) { // Read the inner classes. innerClassesAttribute.u2classesCount = dataInput.readUnsignedShort(); innerClassesAttribute.classes = new InnerClassesInfo[innerClassesAttribute.u2classesCount]; for (int index = 0; index < innerClassesAttribute.u2classesCount; index++) { InnerClassesInfo innerClassesInfo = new InnerClassesInfo(); visitInnerClassesInfo(clazz, innerClassesInfo); innerClassesAttribute.classes[index] = innerClassesInfo; } }
public void visitStackMapAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, StackMapAttribute stackMapAttribute) { // Read the stack map frames (only full frames, without tag). stackMapAttribute.u2stackMapFramesCount = dataInput.readUnsignedShort(); stackMapAttribute.stackMapFrames = new FullFrame[stackMapAttribute.u2stackMapFramesCount]; for (int index = 0; index < stackMapAttribute.u2stackMapFramesCount; index++) { FullFrame stackMapFrame = new FullFrame(); visitFullFrame(clazz, method, codeAttribute, index, stackMapFrame); stackMapAttribute.stackMapFrames[index] = stackMapFrame; } }
clazz.accept(new ProgramClassReader(dataInputStream));
for (int index = 1; index < programClass.u2constantPoolCount; index++) Constant constant = createConstant(); constant.accept(programClass, this); programClass.constantPool[index] = constant; this.visitProgramField(programClass, programField); programClass.fields[index] = programField; this.visitProgramMethod(programClass, programMethod); programClass.methods[index] = programMethod; for (int index = 0; index < programClass.u2attributesCount; index++) Attribute attribute = createAttribute(programClass); attribute.accept(programClass, this); programClass.attributes[index] = attribute;