public class ClassMethod extends Object
| Constructor and Description |
|---|
ClassMethod(InputStream stream,
ConstantPool pool)
Reads in a ClassMethod from a Java class file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute a) |
MethodAccessFlagSet |
getAccessFlags()
Returns the MethodAccessFlagSet for this ClassMethod.
|
List<Attribute> |
getAttributes() |
CodeAttribute |
getCode() |
String |
getDescriptor()
Returns the descriptor for this ClassMethod.
|
int |
getDescriptorIndex() |
Collection<TypeName> |
getExceptions()
Returns the exceptions which have been declared for this ClassMethod.
|
String |
getName()
Returns the name of this ClassMethod.
|
int |
getNameIndex() |
List<TypeName> |
getParameterTypes()
Returns the parameter types for this ClassMethod.
|
TypeName |
getReturnType()
Returns the return type for this ClassMethod.
|
void |
setAccessFlags(MethodAccessFlagSet set) |
void |
setDescriptorIndex(int index) |
void |
setNameIndex(int index) |
String |
toString()
Returns a String that contains debugging information for this ClassMethod.
|
void |
write(DataOutputStream output) |
public ClassMethod(InputStream stream, ConstantPool pool) throws IOException
stream - The InputStream from which this ClassMethod will be read.
The stream must be pointing to the beginning of a valid method definition
as detailed in the JVM specification.pool - The ConstantPool for the class file to which this ClassMethod belongs.IOException - if an error occurs while trying to read the ClassMethod.public void write(DataOutputStream output) throws IOException
IOExceptionpublic CodeAttribute getCode()
public void addAttribute(Attribute a)
public MethodAccessFlagSet getAccessFlags()
public void setAccessFlags(MethodAccessFlagSet set)
public int getNameIndex()
public void setNameIndex(int index)
public int getDescriptorIndex()
public void setDescriptorIndex(int index)
public String getName()
RuntimeException - that should probably instead be ClassFormatError.public String getDescriptor() throws ClassFormatError
ClassFormatError - if the descriptor isn't of the right type.
This should probably be thrown during the parsing stage.public TypeName getReturnType()
public List<TypeName> getParameterTypes()
public Collection<TypeName> getExceptions()
Copyright © 2012. All Rights Reserved.