Package javassist.bytecode.annotation
Class EnumMemberValue
- java.lang.Object
-
- javassist.bytecode.annotation.MemberValue
-
- javassist.bytecode.annotation.EnumMemberValue
-
public class EnumMemberValue extends MemberValue
Enum constant value.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) inttypeIndex(package private) intvalueIndex-
Fields inherited from class javassist.bytecode.annotation.MemberValue
cp, tag
-
-
Constructor Summary
Constructors Constructor Description EnumMemberValue(int type, int value, ConstPool cp)Constructs an enum constant value.EnumMemberValue(ConstPool cp)Constructs an enum constant value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(MemberValueVisitor visitor)Accepts a visitor.java.lang.StringgetType()Obtains the enum type name.(package private) java.lang.Class<?>getType(java.lang.ClassLoader cl)java.lang.StringgetValue()Obtains the name of the enum constant value.(package private) java.lang.ObjectgetValue(java.lang.ClassLoader cl, ClassPool cp, java.lang.reflect.Method m)Returns the value.voidsetType(java.lang.String typename)Changes the enum type name.voidsetValue(java.lang.String name)Changes the name of the enum constant value.java.lang.StringtoString()voidwrite(AnnotationsWriter writer)Writes the value.-
Methods inherited from class javassist.bytecode.annotation.MemberValue
loadClass
-
-
-
-
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
-
getValue
java.lang.Object getValue(java.lang.ClassLoader cl, ClassPool cp, java.lang.reflect.Method m) throws java.lang.ClassNotFoundExceptionDescription copied from class:MemberValueReturns the value. If the value type is a primitive type, the returned value is boxed.- Specified by:
getValuein classMemberValue- Throws:
java.lang.ClassNotFoundException
-
getType
java.lang.Class<?> getType(java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException- Specified by:
getTypein classMemberValue- Throws:
java.lang.ClassNotFoundException
-
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:
toStringin classjava.lang.Object
-
write
public void write(AnnotationsWriter writer) throws java.io.IOException
Writes the value.- Specified by:
writein classMemberValue- Throws:
java.io.IOException
-
accept
public void accept(MemberValueVisitor visitor)
Accepts a visitor.- Specified by:
acceptin classMemberValue
-
-