public class JavaMethod extends JMethod
| Constructor and Description |
|---|
JavaMethod() |
JavaMethod(JavaClassLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute attr)
Adds an attribute.
|
void |
concatenate(JavaMethod tail)
Concatenates the method.
|
CodeAttribute |
createCode()
Create the code attribute.
|
CodeWriterAttribute |
createCodeWriter() |
JavaMethod |
export(JavaClass source,
JavaClass target)
exports the method.
|
int |
getAccessFlags()
Gets the access flags
|
Attribute |
getAttribute(java.lang.String name)
Returns the attribute.
|
java.util.ArrayList<Attribute> |
getAttributes()
Returns the attribute.
|
JavaClassLoader |
getClassLoader()
Returns the class loader.
|
CodeAttribute |
getCode()
Returns the code attribute.
|
JAnnotation[] |
getDeclaredAnnotations()
Returns the declared annotations.
|
JClass |
getDeclaringClass()
Returns the declaring class.
|
java.lang.String |
getDescriptor()
Gets the descriptor.
|
JClass[] |
getExceptionTypes()
Returns the exception types.
|
JType |
getGenericReturnType()
Returns the return type.
|
int |
getLine()
Returns the line number.
|
java.lang.String |
getName()
Gets the name.
|
JClass[] |
getParameterTypes()
Returns the parameter types.
|
JClass |
getReturnType()
Returns the return types.
|
boolean |
isAbstract()
Returns true for an abstract method
|
boolean |
isFinal()
Returns true for a final method
|
boolean |
isPrivate()
Returns true for a private method
|
boolean |
isProtected()
Returns true for a protected method
|
boolean |
isPublic()
Returns true for a public method
|
boolean |
isStatic()
Returns true for a static method
|
Attribute |
removeAttribute(java.lang.String name)
Removes an attribute.
|
void |
setAccessFlags(int flags)
Sets the access flags
|
void |
setDescriptor(java.lang.String descriptor)
Sets the descriptor.
|
void |
setExceptionTypes(JClass[] exceptions)
Sets the exception types
|
void |
setJavaClass(JavaClass jClass)
Sets the JavaClass.
|
void |
setName(java.lang.String name)
Sets the name.
|
void |
setWrite(boolean isWrite) |
java.lang.String |
toString() |
void |
write(ByteCodeWriter out)
Writes the field to the output.
|
equals, getFullNamegetAnnotation, getAnnotation, isAnnotationPresent, isAnnotationPresentpublic JavaMethod(JavaClassLoader loader)
public JavaMethod()
public void setJavaClass(JavaClass jClass)
public void setWrite(boolean isWrite)
public void setName(java.lang.String name)
public int getLine()
getLine in class JAccessibleObjectpublic JavaClassLoader getClassLoader()
public void setAccessFlags(int flags)
public int getAccessFlags()
public boolean isFinal()
public boolean isPublic()
public boolean isProtected()
isProtected in class JMethodpublic boolean isPrivate()
public boolean isAbstract()
isAbstract in class JMethodpublic boolean isStatic()
public void setDescriptor(java.lang.String descriptor)
public java.lang.String getDescriptor()
public JClass getDeclaringClass()
getDeclaringClass in class JMethodpublic JClass getReturnType()
getReturnType in class JMethodpublic JType getGenericReturnType()
getGenericReturnType in class JMethodpublic JClass[] getParameterTypes()
getParameterTypes in class JMethodpublic void setExceptionTypes(JClass[] exceptions)
public JClass[] getExceptionTypes()
getExceptionTypes in class JMethodpublic void addAttribute(Attribute attr)
public CodeWriterAttribute createCodeWriter()
public Attribute removeAttribute(java.lang.String name)
public java.util.ArrayList<Attribute> getAttributes()
public Attribute getAttribute(java.lang.String name)
public JAnnotation[] getDeclaredAnnotations()
getDeclaredAnnotations in class JMethodpublic CodeAttribute getCode()
public CodeAttribute createCode()
public void write(ByteCodeWriter out) throws java.io.IOException
java.io.IOExceptionpublic JavaMethod export(JavaClass source, JavaClass target)
public void concatenate(JavaMethod tail)