aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/annotation/ClassMemberValue.java
blob: 8931eb0518532af97f688a3e1d17b96acf475231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package javassist.bytecode.annotation;

import java.io.DataOutputStream;
import java.io.IOException;

/**
 * Comment
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.1 $
 *
 **/
public class ClassMemberValue extends MemberValue
{
   short class_info_index;

   public ClassMemberValue(short cii)
   {
      tag = 'c';
      this.class_info_index = cii;
   }

   public String getClassName()
   {
      return cp.getClassInfo(class_info_index);
   }

   public void setClassName(String name)
   {
      class_info_index = (short)cp.addClassInfo(name);
   }

   public String toString()
   {
       return getClassName();
   }
   public void write(DataOutputStream dos) throws IOException
   {
      super.write(dos);
      dos.writeShort(class_info_index);
   }
}