javassist.bytecode.annotation
Class EnumMemberValue

java.lang.Object
  extended by javassist.bytecode.annotation.MemberValue
      extended by javassist.bytecode.annotation.EnumMemberValue

public class EnumMemberValue
extends MemberValue

Enum constant value.

Author:
Bill Burke, Shigeru Chiba

Constructor Summary
EnumMemberValue(ConstPool cp)
          Constructs an enum constant value.
EnumMemberValue(int type, int value, ConstPool cp)
          Constructs an enum constant value.
 
Method Summary
 void accept(MemberValueVisitor visitor)
          Accepts a visitor.
 java.lang.String getType()
          Obtains the enum type name.
 java.lang.String getValue()
          Obtains the name of the enum constant value.
 void setType(java.lang.String typename)
          Changes the enum type name.
 void setValue(java.lang.String name)
          Changes the name of the enum constant value.
 java.lang.String toString()
           
 void write(AnnotationsWriter writer)
          Writes the value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnumMemberValue

public EnumMemberValue(int type,
                       int value,
                       ConstPool cp)
Constructs an enum constant value. The initial value is specified by the constant pool entries at the given indexes.

Parameters:
type - the index of a CONSTANT_Utf8_info structure representing the enum type.
value - the index of a CONSTANT_Utf8_info structure. representing the enum value.

EnumMemberValue

public EnumMemberValue(ConstPool cp)
Constructs an enum constant value. The initial value is not specified.

Method Detail

getType

public java.lang.String getType()
Obtains the enum type name.

Returns:
a fully-qualified type name.

setType

public void setType(java.lang.String typename)
Changes the enum type name.

Parameters:
typename - a fully-qualified type name.

getValue

public java.lang.String getValue()
Obtains the name of the enum constant value.


setValue

public void setValue(java.lang.String name)
Changes the name of the enum constant value.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(AnnotationsWriter writer)
           throws java.io.IOException
Writes the value.

Specified by:
write in class MemberValue
Throws:
java.io.IOException

accept

public void accept(MemberValueVisitor visitor)
Accepts a visitor.

Specified by:
accept in class MemberValue


Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2008 Shigeru Chiba. All Rights Reserved.