Package javassist.bytecode.annotation
Class EnumMemberValue
java.lang.Object
javassist.bytecode.annotation.MemberValue
javassist.bytecode.annotation.EnumMemberValue
Enum constant value.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
(package private) int
Fields inherited from class javassist.bytecode.annotation.MemberValue
cp, tag
-
Constructor Summary
ConstructorsConstructorDescriptionEnumMemberValue
(int type, int value, ConstPool cp) Constructs an enum constant value.Constructs an enum constant value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(MemberValueVisitor visitor) Accepts a visitor.getType()
Obtains the enum type name.(package private) Class
<?> getType
(ClassLoader cl) getValue()
Obtains the name of the enum constant value.(package private) Object
getValue
(ClassLoader cl, ClassPool cp, Method m) Returns the value.void
renameClass
(String oldname, String newname) void
renameClass
(Map<String, String> classnames) void
Changes the enum type name.void
Changes the name of the enum constant value.toString()
void
write
(AnnotationsWriter writer) Writes the value.Methods inherited from class javassist.bytecode.annotation.MemberValue
loadClass
-
Field Details
-
typeIndex
int typeIndex -
valueIndex
int valueIndex
-
-
Constructor Details
-
EnumMemberValue
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
Constructs an enum constant value. The initial value is not specified.
-
-
Method Details
-
getValue
Description copied from class:MemberValue
Returns the value. If the value type is a primitive type, the returned value is boxed.- Specified by:
getValue
in classMemberValue
- Throws:
ClassNotFoundException
-
getType
- Specified by:
getType
in classMemberValue
- Throws:
ClassNotFoundException
-
renameClass
- Overrides:
renameClass
in classMemberValue
-
renameClass
- Overrides:
renameClass
in classMemberValue
-
getType
Obtains the enum type name.- Returns:
- a fully-qualified type name.
-
setType
Changes the enum type name.- Parameters:
typename
- a fully-qualified type name.
-
getValue
Obtains the name of the enum constant value. -
setValue
Changes the name of the enum constant value. -
toString
-
write
Writes the value.- Specified by:
write
in classMemberValue
- Throws:
IOException
-
accept
Accepts a visitor.- Specified by:
accept
in classMemberValue
-