|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.compiler.java.JavaElement
jaxx.compiler.java.JavaMethod
public class JavaMethod
Represents a method in a Java source file being generated for output. 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.
| Nested Class Summary | |
|---|---|
static class |
JavaMethod.MethodOrder
|
| Constructor Summary | |
|---|---|
JavaMethod(int modifiers,
java.lang.String returnType,
java.lang.String name,
JavaArgument[] arguments,
java.lang.String[] exceptions,
java.lang.String bodyCode,
boolean override)
Constructs a new JavaMethod containing the specified body code. |
|
| Method Summary | |
|---|---|
int |
compareTo(JavaMethod o)
|
JavaArgument[] |
getArguments()
Returns a list of the method's arguments. |
java.lang.String |
getBody()
|
java.lang.String[] |
getExceptions()
Returns a list of exceptions the method can throw. |
static java.util.EnumSet<JavaMethod.MethodOrder> |
getMethodOrderScope(java.util.EnumSet<JavaMethod.MethodOrder> allConstants,
int scope)
|
java.lang.String |
getReturnType()
Returns the method's return type, as it would be represented in Java source code. |
static java.util.EnumMap<JavaMethod.MethodOrder,java.util.List<JavaMethod>> |
getSortedMethods(java.util.List<JavaMethod> methods)
|
boolean |
isOverride()
|
void |
setOverride(boolean override)
|
| Methods inherited from class jaxx.compiler.java.JavaElement |
|---|
getModifiers, getModifiersText, getName, setModifiers, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaMethod(int modifiers,
java.lang.String returnType,
java.lang.String name,
JavaArgument[] arguments,
java.lang.String[] exceptions,
java.lang.String bodyCode,
boolean override)
JavaMethod containing the specified body code. The modifiers parameter
is a bit mask of the constants from Modifier, and the returnType and
exceptions of the method should be represented as they would appear in Java source code (null
for a constructor). The method body is initially empty.
modifiers - the modifier keywords that should appear as part of the method's declarationreturnType - the return type of the method as it would appear in Java source codename - the method's namearguments - the method's argumentsexceptions - a list of exceptions the methods can throw, as they would be represented in Java source codebodyCode - Java source code which should appear in the method bodyoverride - flag with true value when the method overrides (or implements) a super class method| Method Detail |
|---|
public java.lang.String getReturnType()
public JavaArgument[] getArguments()
public java.lang.String[] getExceptions()
public boolean isOverride()
public void setOverride(boolean override)
public java.lang.String getBody()
public int compareTo(JavaMethod o)
compareTo in interface java.lang.Comparable<JavaMethod>public static java.util.EnumMap<JavaMethod.MethodOrder,java.util.List<JavaMethod>> getSortedMethods(java.util.List<JavaMethod> methods)
public static java.util.EnumSet<JavaMethod.MethodOrder> getMethodOrderScope(java.util.EnumSet<JavaMethod.MethodOrder> allConstants,
int scope)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||