KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jas > AnnotationDefaultAttr


1 /**
2  * Signature attributes are embedded into class files
3  * and used for further ???
4  * @author $Author: Jennifer Lhotak$
5  * @version $Revision: 1.1 $
6  */

7
8 package jas;
9
10 import java.io.*;
11 import java.util.*;
12
13 public class AnnotationDefaultAttr {
14
15     static CP attr = new AsciiCP("AnnotationDefault");
16     ElemValPair elem;
17
18     void resolve(ClassEnv e){
19         e.addCPItem(attr);
20         elem.resolve(e);
21     }
22
23     /**
24     * Note: A signature attr is associated with a <em>class</em>,
25     * method or field so you need to create a new SignatureAttr for
26     */

27     public AnnotationDefaultAttr(ElemValPair s) { //
28
elem = s;
29     }
30
31     int size(){
32         return elem.size();
33     }
34
35
36     void write(ClassEnv e, DataOutputStream out)
37         throws IOException, jasError
38         {
39         
40         out.writeShort(e.getCPIndex(attr));
41         out.writeInt(size()); // fixed length
42
elem.write(e, out);
43     }
44 }
45
Popular Tags