Package org.codehaus.janino.util
Class ClassFile.FieldInfo
java.lang.Object
org.codehaus.janino.util.ClassFile.FieldInfo
- All Implemented Interfaces:
Annotatable
- Enclosing class:
ClassFile
Representation of a "method_info" structure, as defined by JVMS7 4.5.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldInfo
(short accessFlags, short nameIndex, short descriptorIndex, List<ClassFile.AttributeInfo> attributes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotationsAttributeEntry
(boolean runtimeVisible, String fieldDescriptor, Map<Short, ClassFile.ElementValue> elementValuePairs) Adds a "Runtime[In]visibleAnnotations" attribute tothis
object (if that annotation does not yet exist) and adds an entry to it.void
addAttribute
(ClassFile.AttributeInfo attribute) Adds the attribute to this field.short
getAnnotations
(boolean runtimeVisible) getDescriptor
(ClassFile classFile) void
store
(DataOutputStream dos) Writes this object to aDataOutputStream
, in the format described inJVMS7 4.5.
-
Constructor Details
-
FieldInfo
public FieldInfo(short accessFlags, short nameIndex, short descriptorIndex, List<ClassFile.AttributeInfo> attributes)
-
-
Method Details
-
getAccessFlags
public short getAccessFlags()- Returns:
- The modifier flags of the field; or'ed values are the constants declared in
Mod
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatable
- Returns:
- The annotations of this field
-
getName
- Returns:
- The field's name
-
getDescriptor
- Returns:
- The field descriptor describing this field
-
getAttributes
- Returns:
- The attributes of this field
-
addAttribute
Adds the attribute to this field. -
addAnnotationsAttributeEntry
public void addAnnotationsAttributeEntry(boolean runtimeVisible, String fieldDescriptor, Map<Short, ClassFile.ElementValue> elementValuePairs) Description copied from interface:Annotatable
Adds a "Runtime[In]visibleAnnotations" attribute tothis
object (if that annotation does not yet exist) and adds an entry to it.- Specified by:
addAnnotationsAttributeEntry
in interfaceAnnotatable
- Parameters:
elementValuePairs
- Maps "elemant_name_index" (ClassFile.ConstantUtf8Info
) to "element_value", see JVMS8 4.7.16
-
store
Writes this object to aDataOutputStream
, in the format described inJVMS7 4.5.- Throws:
IOException
-