diff options
author | patriot1burke <patriot1burke@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-04-03 02:11:24 +0000 |
---|---|---|
committer | patriot1burke <patriot1burke@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2004-04-03 02:11:24 +0000 |
commit | ed96cc41015dae453237abc3934c2570e770bf53 (patch) | |
tree | a85a78911d6cb464dd571f3b53fe93bb22552e7c /src/main/javassist/bytecode/annotation/ClassMemberValue.java | |
parent | 98cf25f68b5aef0df53b6778644d6e41702de8bc (diff) | |
download | javassist-ed96cc41015dae453237abc3934c2570e770bf53.tar.gz javassist-ed96cc41015dae453237abc3934c2570e770bf53.zip |
added annotation support. Only Enum types not supported when adding
annotations. This will also work on JDK 1.4. Well, it should.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@75 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/bytecode/annotation/ClassMemberValue.java')
-rw-r--r-- | src/main/javassist/bytecode/annotation/ClassMemberValue.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/annotation/ClassMemberValue.java b/src/main/javassist/bytecode/annotation/ClassMemberValue.java new file mode 100644 index 00000000..8931eb05 --- /dev/null +++ b/src/main/javassist/bytecode/annotation/ClassMemberValue.java @@ -0,0 +1,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); + } +} |