private void parseClass ( ) throws IOException { int magic = readInt ( ) ; if ( magic != JavaClass . MAGIC ) throw error ( L . l ( "bad magic number in class file" ) ) ; int minor = readShort ( ) ; int major = readShort ( ) ; _class . setMajor ( major ) ; _class . setMinor ( minor ) ; parseConstantPool ( ) ; int accessFlags = readShort ( ) ; _class . setAccessFlags ( accessFlags ) ; int thisClassIndex = readShort ( ) ; _class . setThisClass ( _cp . getClass ( thisClassIndex ) . getName ( ) ) ; int superClassIndex = readShort ( ) ; if ( superClassIndex > 0 ) _class . setSuperClass ( _cp . getClass ( superClassIndex ) . getName ( ) ) ; int interfaceCount = readShort ( ) ; for ( int i = 0 ; i < interfaceCount ; i ++ ) { int classIndex = readShort ( ) ; _class . addInterface ( _cp . getClass ( classIndex ) . getName ( ) ) ; } int fieldCount = readShort ( ) ; for ( int i = 0 ; i < fieldCount ; i ++ ) { parseField ( ) ; } int methodCount = readShort ( ) ; for ( int i = 0 ; i < methodCount ; i ++ ) parseMethod ( ) ; int attrCount = readShort ( ) ; for ( int i = 0 ; i < attrCount ; i ++ ) { Attribute attr = parseAttribute ( ) ; _class . addAttribute ( attr ) ; } }
Parses the ClassFile construct