diff options
Diffstat (limited to 'src/main/javassist/bytecode/annotation/StringMemberValue.java')
-rw-r--r-- | src/main/javassist/bytecode/annotation/StringMemberValue.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/annotation/StringMemberValue.java b/src/main/javassist/bytecode/annotation/StringMemberValue.java new file mode 100644 index 00000000..54cfa438 --- /dev/null +++ b/src/main/javassist/bytecode/annotation/StringMemberValue.java @@ -0,0 +1,47 @@ +/* + * 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 StringMemberValue extends MemberValue +{ + short const_value_index; + + public StringMemberValue(short cvi) + { + tag = 's'; + this.const_value_index = cvi; + } + + public String getValue() + { + return cp.getUtf8Info(const_value_index); + } + public void setValue(String newVal) + { + const_value_index = (short)cp.addUtf8Info(newVal); + } + + public String toString() + { + return "\"" + getValue() + "\""; + } + public void write(DataOutputStream dos) throws IOException + { + super.write(dos); + dos.writeShort(const_value_index); + } +} |