jaxx.compiler.java
Class JavaMethod
java.lang.Object
jaxx.compiler.java.JavaElement
jaxx.compiler.java.JavaMethod
- All Implemented Interfaces:
- java.lang.Comparable<JavaMethod>
public class JavaMethod
- extends JavaElement
- implements java.lang.Comparable<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.
|
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaMethod
public 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. 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.
- Parameters:
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
getReturnType
public java.lang.String getReturnType()
- Returns the method's return type, as it would be represented in Java source code.
- Returns:
- the method's return type
getArguments
public JavaArgument[] getArguments()
- Returns a list of the method's arguments.
- Returns:
- the method's arguments
getExceptions
public java.lang.String[] getExceptions()
- Returns a list of exceptions the method can throw.
- Returns:
- the method's exceptions
isOverride
public boolean isOverride()
getBody
public java.lang.String getBody()
compareTo
public int compareTo(JavaMethod o)
- Specified by:
compareTo in interface java.lang.Comparable<JavaMethod>
getSortedMethods
public static java.util.EnumMap<JavaMethod.MethodOrder,java.util.List<JavaMethod>> getSortedMethods(java.util.List<JavaMethod> methods)
getMethodOrderScope
public static java.util.EnumSet<JavaMethod.MethodOrder> getMethodOrderScope(java.util.EnumSet<JavaMethod.MethodOrder> allConstants,
int scope)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.