All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jas.StringElemValPair Maven / Gradle / Ivy

/**
 * ElemValPairs are embedded into class files
 * and used for further ???
 * @author $Author: Jennifer Lhotak$
 * @version $Revision: 1.1 $
 */

package jas;

import java.io.*;
import java.util.*;

public class StringElemValPair extends ElemValPair {

    AsciiCP val;

    void resolve(ClassEnv e){
        super.resolve(e);
        e.addCPItem(val);
    }

    /**
    * Note: An annotation attr is associated with a class,
    * method or field so you need to create a new VisibilityAnnotationAttr for 
    */
    public StringElemValPair(String name, char kind, String val) { //
        super(name, kind);
        this.val = new AsciiCP(val);
    }

    int size(){
        return super.size() + 2;
    }


    void write(ClassEnv e, DataOutputStream out)
        throws IOException, jasError
        {
        super.write(e, out);    
        out.writeShort(e.getCPIndex(val));
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy