Package alt.jiapi.file

Examples of alt.jiapi.file.ConstantPool$NameAndTypeInfo


    // modified indicates whether or not bytes are up-to-date
    private boolean modified = false;
//     private byte[] bytes;

    public InstructionList() {
        this.constantPool = new ConstantPool();
        this.instructions = new LinkedList();
    }
View Full Code Here


        modified = true;
        i.setAttribute("synthetic");

        if (i instanceof CPInstruction) {
            CPInstruction cpIns = (CPInstruction)i;
            ConstantPool cp = cpIns.getConstantPool();

            if (!constantPool.equals(cp)) {
                cpIns.replaceConstantPool(constantPool);
            }
        }
View Full Code Here

        modified = true;
        i.setAttribute("synthetic");
       
        if (i instanceof CPInstruction) {
            CPInstruction cpIns = (CPInstruction)i;
            ConstantPool cp = cpIns.getConstantPool();

            if (!constantPool.equals(cp)) {
                cpIns.replaceConstantPool(constantPool);
            }
        }
View Full Code Here

*/
public class InstructionFactory {
    private ConstantPool cp;

    public InstructionFactory() {
        this.cp = new ConstantPool();
    }
View Full Code Here

        Instruction instruction = new FieldAccess(bytes, cp);
        return instruction;
    }

    public Instruction getField(JiapiField field) {
        ConstantPool cp =
            field.getDeclaringClass().getConstantPool();

        ConstantPool.ClassInfo ci =
            cp.addClassInfo(field.getDeclaringClass().getName());
        ConstantPool.FieldRefInfo fri =
            cp.addFieldRefInfo(ci, field.getName(), field.getDescriptor());

        int index = fri.getEntryIndex();

        int modifiers = field.getModifiers();
        byte[] bytes = new byte[3];
View Full Code Here

     * @return an InstructionList
     */
    public Instruction setField(JiapiField field) {
        // NOTE: We could return InstructionList
        //       and do a checkcast before putfield or pustatic
        ConstantPool cp =
            field.getDeclaringClass().getConstantPool();

        ConstantPool.ClassInfo ci =
            cp.addClassInfo(field.getDeclaringClass().getName());
        ConstantPool.FieldRefInfo fri =
            cp.addFieldRefInfo(ci, field.getName(), field.getDescriptor());

        int index = fri.getEntryIndex();


        int modifiers = field.getModifiers();
View Full Code Here

    ClassBuilder(ClassFile clazz) {
        this.clazz = clazz;
    }

    JiapiField addField(short modifiers, String type, String name) throws FieldExistsException {
        ConstantPool cp = clazz.getConstantPool();

        // Check, that the field don't exist
        List fields = clazz.getFields();
        Iterator i = fields.iterator();
        while(i.hasNext()) {
View Full Code Here

        return new JiapiField(f);
    }


    JiapiMethod addMethod(short modifiers, String name, Signature signature) throws MethodExistsException {
        ConstantPool cp = clazz.getConstantPool();


        // Add Synthetic attribute for the field
        List attrs = new LinkedList();
        attrs.add(new SyntheticAttribute(cp));
View Full Code Here

     * Gets all the interfaces, that this class directly implements.
     *
     * @return names of the implemented interfaces
     */
    public String[] getInterfaceNames() {
        ConstantPool cp = clazz.getConstantPool();
        List l = clazz.getInterfaces();

        String[] iNames = new String[l.size()];
        for (int i = 0; i < iNames.length; i++) {
            Interface iFace = (Interface)l.get(i);
View Full Code Here

TOP

Related Classes of alt.jiapi.file.ConstantPool$NameAndTypeInfo

Copyright © 2018 www.massapicom. 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.