KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > jiapi > file > SyntheticAttribute


1 package alt.jiapi.file;
2
3 import java.io.ByteArrayOutputStream JavaDoc;
4 import java.io.DataInputStream JavaDoc;
5 import java.io.DataOutputStream JavaDoc;
6 import java.io.IOException JavaDoc;
7 import java.util.List JavaDoc;
8 import java.util.LinkedList JavaDoc;
9 import java.util.Iterator JavaDoc;
10
11 /**
12  * Class SyntheticAttribute.
13  *
14  * @author Mika Riekkinen
15  * @see Java Virtual Machine Specification 2nd edition, ch. 4.7.6
16  */

17 public class SyntheticAttribute extends Attribute {
18     public static final String JavaDoc ATTRIBUTE_NAME = "Synthetic";
19     private byte[] bytes = new byte[0];
20
21     /**
22      * Creates a new Syntehtic attribute.
23      * ConstantPool is added an utf8_info, with name 'Synthetic'
24      *
25      * @param cp a ConstantPool, that is related to this attribute
26      */

27     public SyntheticAttribute(ConstantPool cp) {
28         super(cp.addUtf8Info(ATTRIBUTE_NAME).getEntryIndex());
29
30         setConstantPool(cp);
31     }
32
33     /**
34      * @param nameIndex an index in constant pool, that points to
35      * constant_utf8_info "Synthetic"
36      */

37     SyntheticAttribute(short nameIndex, DataInputStream JavaDoc dis) throws IOException JavaDoc {
38         super(nameIndex);
39     }
40     
41     public byte[] getBytes() {
42         return bytes;
43     }
44 }
45
46
Popular Tags