public class JavaMethod extends JavaElement implements Comparable<JavaMethod>
JavaMethods are created
and added to a JavaFile, which can then output Java source code. In addition to normal methods, a
JavaMethod can represent a constructor -- constructors should be named after their containing
classes and have a return type of null.| Modifier and Type | Class and Description |
|---|---|
static class |
JavaMethod.MethodOrder |
JavaElementComparator| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(JavaMethod o) |
JavaArgument[] |
getArguments()
Returns a list of the method's arguments.
|
String |
getBody() |
String[] |
getExceptions()
Returns a list of exceptions the method can throw.
|
static EnumSet<JavaMethod.MethodOrder> |
getMethodOrderScope(EnumSet<JavaMethod.MethodOrder> allConstants,
int scope) |
String |
getReturnType()
Returns the method's return type, as it would be represented
in Java source code.
|
static EnumMap<JavaMethod.MethodOrder,List<JavaMethod>> |
getSortedMethods(List<JavaMethod> methods) |
boolean |
isOverride() |
void |
setBody(String body) |
void |
setReturnType(String returnType) |
addAnnotation, getAnnotations, getModifiers, getModifiersText, getName, hasAnnotations, isAbstract, setModifiers, setNamepublic String getReturnType()
public JavaArgument[] getArguments()
public String[] getExceptions()
public boolean isOverride()
public String getBody()
public void setBody(String body)
public int compareTo(JavaMethod o)
compareTo in interface Comparable<JavaMethod>public void setReturnType(String returnType)
public static EnumMap<JavaMethod.MethodOrder,List<JavaMethod>> getSortedMethods(List<JavaMethod> methods)
public static EnumSet<JavaMethod.MethodOrder> getMethodOrderScope(EnumSet<JavaMethod.MethodOrder> allConstants, int scope)
Copyright © 2008–2019 Ultreia.io. All rights reserved.