Examples of FieldDescriptorInfo


Examples of fr.xlim.ssd.capmanipulator.library.FieldDescriptorInfo

     * @throws fr.xlim.ssd.capmanipulator.library.exceptions.UnableToReadCapFileException
     *
     */
    public FieldDescriptorInfo load(CapInputStream in) throws UnableToReadCapFileException {

        FieldDescriptorInfo fieldDescriptorInfo = new FieldDescriptorInfo();

        fieldDescriptorInfo.setToken(in.readByte()); // Token reading
        fieldDescriptorInfo.setAccesFlags(in.readByte()); // Access flag reading

        if ((fieldDescriptorInfo.getAccesFlags() & FieldDescriptorInfo.ACC_STATIC) >>> 3 == 1) {
            //the field is a Static Field
            StaticField fieldRef = new StaticField();
            fieldDescriptorInfo.setFieldRef(fieldRef);
            StaticFieldRef sFieldRef = new StaticFieldRefRead().load(in);
            ((StaticField) fieldRef).setStaticField(sFieldRef);

        } else {
            //the fied is an instance field
            ClassRef classref = new ClassRefRead().load(in);
            byte tok = in.readByte();

            FieldRef fieldRef = new InstanceField();
            fieldDescriptorInfo.setFieldRef(fieldRef);
            ((InstanceField) fieldRef).setClass_(classref);
            ((InstanceField) fieldRef).setToken(tok);
        }

        fieldDescriptorInfo.setType(in.readShort()); // Type reading

        return fieldDescriptorInfo;
    }
View Full Code Here

Examples of fr.xlim.ssd.capmanipulator.library.FieldDescriptorInfo

        //reading of the fields
        classDescriptorInfo.setFields(new ArrayList<FieldDescriptorInfo>(classDescriptorInfo.getFieldCount()));

        for (int i = 0; i < classDescriptorInfo.getFieldCount(); i++) {
            FieldDescriptorInfo fDes = new FieldDescriptorInfoRead().load(in);
            classDescriptorInfo.getFields().add(fDes);
        }

        //reading of the methods
        classDescriptorInfo.setMethods(new ArrayList<MethodDescriptorInfo>(classDescriptorInfo.getMethodCount()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.