| java.lang.Object jaxx.compiler.JavaMethod
JavaMethod | public class JavaMethod (Code) | | 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 | |
public | JavaMethod(int modifiers, String returnType, String name) Constructs a new no-argument JavaMethod which throws no checked exceptions. | public | JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments) Constructs a new JavaMethod which throws no checked exceptions. | public | JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments, String[] exceptions) Constructs a new JavaMethod . | public | JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments, String[] exceptions, String bodyCode) Constructs a new JavaMethod containing the specified body code. |
Method Summary | |
public void | appendBodyCode(String extraCode) Appends additional code to the method's body. | public JavaArgument[] | getArguments() Returns a list of the method's arguments. | public String | getBodyCode() Returns the Java source code for the method's body. | public String[] | getExceptions() Returns a list of exceptions the method can throw. | public int | getModifiers() Returns a bit mask describing the modifier keywords which should appear as part of this method's
declaration. | public String | getName() Returns the method's name. | public String | getReturnType() Returns the method's return type, as it would be represented in Java source code. | public String | toString() Returns the Java source code for this method. |
JavaMethod | public JavaMethod(int modifiers, String returnType, String name)(Code) | | Constructs a new no-argument JavaMethod which throws no checked exceptions. The
modifiers parameter is a bit mask of the constants from
java.lang.reflect.Modifier ,
and the returnType of the method should be represented as it 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 declaration Parameters: returnType - the return type of the method as it would appear in Java source code Parameters: name - the method's name See Also: JavaMethod.appendBodyCode |
JavaMethod | public JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments)(Code) | | Constructs a new JavaMethod which throws no checked exceptions. The modifiers
parameter is a bit mask of the constants from
java.lang.reflect.Modifier , and the
returnType of the method should be represented as it 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 declaration Parameters: returnType - the return type of the method as it would appear in Java source code Parameters: name - the method's name Parameters: arguments - the method's arguments See Also: JavaMethod.appendBodyCode |
JavaMethod | public JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments, String[] exceptions)(Code) | | Constructs a new JavaMethod . The modifiers parameter is a bit mask of the
constants from
java.lang.reflect.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 declaration Parameters: returnType - the return type of the method as it would appear in Java source code Parameters: name - the method's name Parameters: arguments - the method's arguments Parameters: exceptions - a list of exceptions the methods can throw, as they would be represented in Java source code See Also: JavaMethod.appendBodyCode |
JavaMethod | public JavaMethod(int modifiers, String returnType, String name, JavaArgument[] arguments, String[] exceptions, String bodyCode)(Code) | | Constructs a new JavaMethod containing the specified body code. The modifiers parameter
is a bit mask of the constants from
java.lang.reflect.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 declaration Parameters: returnType - the return type of the method as it would appear in Java source code Parameters: name - the method's name Parameters: arguments - the method's arguments Parameters: exceptions - a list of exceptions the methods can throw, as they would be represented in Java source code Parameters: bodyCode - Java source code which should appear in the method body |
appendBodyCode | public void appendBodyCode(String extraCode)(Code) | | Appends additional code to the method's body.
Parameters: extraCode - Java source code to append to the method's body |
getArguments | public JavaArgument[] getArguments()(Code) | | Returns a list of the method's arguments.
the method's arguments |
getBodyCode | public String getBodyCode()(Code) | | Returns the Java source code for the method's body.
the method's body code |
getExceptions | public String[] getExceptions()(Code) | | Returns a list of exceptions the method can throw.
the method's exceptions |
getModifiers | public int getModifiers()(Code) | | Returns a bit mask describing the modifier keywords which should appear as part of this method's
declaration. See java.lang.reflect.Modifier for more information on decoding this
field.
the modifier bit mask |
getName | public String getName()(Code) | | Returns the method's name.
the method's name |
getReturnType | public String getReturnType()(Code) | | Returns the method's return type, as it would be represented in Java source code.
the method's return type |
toString | public String toString()(Code) | | Returns the Java source code for this method.
the Java source code for this method |
|
|