public class ClassFile.MethodInfo extends Object implements Annotatable
| Constructor and Description |
|---|
MethodInfo(short accessFlags,
short nameIndex,
short descriptorIndex,
List<ClassFile.AttributeInfo> attributes)
Initializes the "method_info" structure.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotationsAttributeEntry(boolean runtimeVisible,
String fieldDescriptor,
Map<Short,ClassFile.AnnotationsAttribute.ElementValue> elementValuePairs)
Adds a "Runtime[In]visibleAnnotations" attribute to
this object (if that annotation does not yet exist)
and adds an entry to it. |
void |
addAttribute(ClassFile.AttributeInfo attribute)
Adds the given
attribute to this method. |
short |
getAccessFlags() |
ClassFile.AnnotationsAttribute.Annotation[] |
getAnnotations(boolean runtimeVisible) |
ClassFile.AttributeInfo[] |
getAttributes() |
ClassFile |
getClassFile() |
String |
getDescriptor() |
String |
getName() |
void |
store(DataOutputStream dos)
Writes this object to a
DataOutputStream, in the format described inJVMS7 4.6. |
public MethodInfo(short accessFlags,
short nameIndex,
short descriptorIndex,
List<ClassFile.AttributeInfo> attributes)
public ClassFile getClassFile()
ClassFile that contains this ClassFile.MethodInfo objectpublic short getAccessFlags()
Mod.public ClassFile.AnnotationsAttribute.Annotation[] getAnnotations(boolean runtimeVisible)
getAnnotations in interface AnnotatableruntimeVisible - TODOpublic String getName()
public String getDescriptor()
public ClassFile.AttributeInfo[] getAttributes()
public void addAttribute(ClassFile.AttributeInfo attribute)
attribute to this method.public void addAnnotationsAttributeEntry(boolean runtimeVisible,
String fieldDescriptor,
Map<Short,ClassFile.AnnotationsAttribute.ElementValue> elementValuePairs)
Annotatablethis object (if that annotation does not yet exist)
and adds an entry to it.addAnnotationsAttributeEntry in interface AnnotatableelementValuePairs - Maps "elemant_name_index" (ClassFile.ConstantUtf8Info) to "element_value", see JVMS8
4.7.16public void store(DataOutputStream dos) throws IOException
DataOutputStream, in the format described inJVMS7 4.6.IOException