Esempio n. 1
0
        public MethodInfo(MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
        {
            accessFlags = reader.ReadUInt16();
            nameIndex = reader.ReadUInt16();
            descriptorIndex = reader.ReadUInt16();
            attributeCount = reader.ReadUInt16();

            if (log.IsDebugEnabled) log.DebugFormat("Method = {0}{1}",pool[nameIndex - 1],pool[descriptorIndex-1]);
            attributes = new AttributeInfo[attributeCount];
            for (int i = 0; i < attributeCount; i++)
            {
                attributes[i] = AttributeInfo.readAttributeInfo(reader,pool);

                if (attributes[i] is CodeAttribute){
                    methodCode = (CodeAttribute) attributes[i];
                }

            }

            //	if (log.IsDebugEnabled) log.DebugFormat("Name should be {0}",pool[nameIndex-1]);
            name = (ConstantPoolInfo_UTF8)pool[nameIndex - 1];
            descriptor = (ConstantPoolInfo_UTF8)pool[descriptorIndex - 1];

            //			deriveParameterCount();
        }
Esempio n. 2
0
 public CodeAttribute(ConstantPoolInfo_UTF8 utf8Name, MSBBinaryReaderWrapper reader, ConstantPoolInfo[] pool)
     : base(utf8Name,reader,pool)
 {
     //
     // TODO: Add constructor logic here
     //
 }
Esempio n. 3
0
        public FieldInfo(MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
        {
            accessFlags = reader.ReadUInt16();
            nameIndex = reader.ReadUInt16();
            descriptorIndex = reader.ReadUInt16();
            //if (log.IsDebugEnabled) log.DebugFormat("Name should be {0}",pool[nameIndex-1]);
            name = (ConstantPoolInfo_UTF8)pool[nameIndex - 1];
            descriptor = (ConstantPoolInfo_UTF8)pool[descriptorIndex - 1];

            attributeCount = reader.ReadUInt16();

            attributes = new AttributeInfo[attributeCount];
            for (int i = 0; i < attributeCount; i++)
            {
                attributes[i] = AttributeInfo.readAttributeInfo(reader,pool);
            }
        }
Esempio n. 4
0
        public InnerClassInfo(MSBBinaryReaderWrapper reader, ConstantPoolInfo[] pool)
        {
            UInt16 innerClassIndex = reader.ReadUInt16();

            if (innerClassIndex != 0){
                innerClass = (ConstantPoolInfo_Class) pool[innerClassIndex - 1];
            }

            UInt16 outerClassIndex = reader.ReadUInt16();
            if (outerClassIndex != 0){
                outerClass = (ConstantPoolInfo_Class) pool[outerClassIndex - 1];
            }

            UInt16 innerNameIndex = reader.ReadUInt16();
            if (innerNameIndex != 0){
                innerName = (ConstantPoolInfo_UTF8) pool[innerNameIndex - 1];
            }

            accessFlags = reader.ReadUInt16();
        }
 public override void resolve(ConstantPoolInfo[] pool)
 {
     name = (ConstantPoolInfo_UTF8)pool[nameIndex-1];
     descriptor = (ConstantPoolInfo_UTF8)pool[descriptorIndex-1];
 }
Esempio n. 6
0
 public LineNumberTableAttribute(ConstantPoolInfo_UTF8 utf8Name, MSBBinaryReaderWrapper reader, ConstantPoolInfo[] pool)
     : base(utf8Name,reader,pool)
 {
 }
Esempio n. 7
0
 public AttributeInfo(ConstantPoolInfo_UTF8 name, MSBBinaryReaderWrapper reader,ConstantPoolInfo[] pool)
 {
     this.name = name;
     length = reader.ReadUInt32();
     parse(reader,pool);
 }
Esempio n. 8
0
        public static ConstantPoolInfo readConstantPoolEntry(MSBBinaryReaderWrapper reader)
        {
            byte tag = reader.ReadByte();

            ConstantPoolInfo info = null;
            switch (tag)
            {
                case TYPE_CLASS:
                {
                    info = new ConstantPoolInfo_Class(tag);
                    break;
                }
                case TYPE_METHOD_REF:
                {
                    info = new ConstantPoolInfo_MethodRef(tag);
                    break;
                }
            case TYPE_INTERFACE_METHOD_REF:
            {
                info = new ConstantPoolInfo_InterfaceMethodRef(tag);
                break;
            }
                case TYPE_FIELD_REF:
                {
                    info = new ConstantPoolInfo_FieldRef(tag);
                    break;
                }
                case TYPE_STRING:
                {
                    info = new ConstantPoolInfo_String(tag);
                    break;
                }
                case TYPE_UTF8:
                {
                    info = new ConstantPoolInfo_UTF8(tag);
                    break;
                }
                case TYPE_NAME_AND_TYPE:
                {
                    info = new ConstantPoolInfo_NameAndType(tag);
                    break;
                }
            case TYPE_INTEGER:
            {
                info = new ConstantPoolInfo_Integer(tag);
                break;
            }
            case TYPE_FLOAT:
            {
                info = new ConstantPoolInfo_Float(tag);
                break;
            }
            case TYPE_DOUBLE:
            {
                info = new ConstantPoolInfo_Double(tag);
                break;
            }
            case TYPE_LONG:
            {
                info = new ConstantPoolInfo_Long(tag);
                break;
            }

            default:
                {
                    throw new UnknownConstantPoolTypeException(String.Format("Do not know how to parse {0}",tag));
                }

            }

            info.parse(reader);

            return info;
        }
Esempio n. 9
0
        ConstantPoolInfo value; // should point to Long,String,Int..

        #endregion Fields

        #region Constructors

        public ConstantValueAttribute(ConstantPoolInfo_UTF8 utf8Name, MSBBinaryReaderWrapper reader, ConstantPoolInfo[] pool)
            : base(utf8Name,reader,pool)
        {
        }
Esempio n. 10
0
 public InnerClassesAttribute(ConstantPoolInfo_UTF8 utf8Name, MSBBinaryReaderWrapper reader, ConstantPoolInfo[] pool)
     : base(utf8Name,reader,pool)
 {
 }