Class ClassFile.ConstantElementValue
java.lang.Object
org.codehaus.janino.util.ClassFile.ConstantElementValue
- All Implemented Interfaces:
ClassFile.ElementValue
- Direct Known Subclasses:
ClassFile.BooleanElementValue, ClassFile.ByteElementValue, ClassFile.CharElementValue, ClassFile.ClassElementValue, ClassFile.DoubleElementValue, ClassFile.FloatElementValue, ClassFile.IntElementValue, ClassFile.LongElementValue, ClassFile.ShortElementValue, ClassFile.StringElementValue
- Enclosing class:
ClassFile
public abstract static class ClassFile.ConstantElementValue
extends Object
implements ClassFile.ElementValue
Convenience class for element values that are constants (as opposed to annotations, enum constants and
arrays).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceClassFile.ConstantElementValue.Visitor<R, EX extends Throwable>The visitor interface for the implementation of the "visitor" pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal shortThe index of the constant pool entry that holds the constant value for this annotation element.private final byte -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract <R, EX extends Throwable>
Raccept(ClassFile.ConstantElementValue.Visitor<R, EX> visitor) Invokes the respective method of theClassFile.ConstantElementValue.Visitor.<R, EX extends Throwable>
Raccept(ClassFile.ElementValue.Visitor<R, EX> visitor) Invokes the respective method of theClassFile.ElementValue.Visitor.bytegetTag()voidstore(DataOutputStream dos) Writes this element value in an element-value-type dependent way; see JVMS8 4.7.16.1.
-
Field Details
-
tag
private final byte tag -
constantValueIndex
public final short constantValueIndexThe index of the constant pool entry that holds the constant value for this annotation element.
-
-
Constructor Details
-
ConstantElementValue
public ConstantElementValue(byte tag, short constantValueIndex)
-
-
Method Details
-
getTag
public byte getTag()- Specified by:
getTagin interfaceClassFile.ElementValue- Returns:
- The "tag" byte to use when storing this "value" in an "element_value" structure
-
store
Description copied from interface:ClassFile.ElementValueWrites this element value in an element-value-type dependent way; see JVMS8 4.7.16.1. The "tag" byte is snot part of this writing!- Specified by:
storein interfaceClassFile.ElementValue- Throws:
IOException
-
accept
@Nullable public <R, EX extends Throwable> R accept(ClassFile.ElementValue.Visitor<R, EX> visitor) throws EXDescription copied from interface:ClassFile.ElementValueInvokes the respective method of theClassFile.ElementValue.Visitor.- Specified by:
acceptin interfaceClassFile.ElementValue- Throws:
EX
-
accept
@Nullable protected abstract <R, EX extends Throwable> R accept(ClassFile.ConstantElementValue.Visitor<R, EX> visitor) throws EXInvokes the respective method of theClassFile.ConstantElementValue.Visitor.- Throws:
EX
-