jaxx.compiler.java
Class JavaMethod

java.lang.Object
  extended by jaxx.compiler.java.JavaElement
      extended by jaxx.compiler.java.JavaMethod
All Implemented Interfaces:
Comparable<JavaMethod>

public class JavaMethod
extends JavaElement
implements 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.


Nested Class Summary
static class JavaMethod.MethodOrder
           
 
Field Summary
 
Fields inherited from class jaxx.compiler.java.JavaElement
JavaElementComparator
 
Method Summary
 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 setReturnType(String returnType)
           
 
Methods inherited from class jaxx.compiler.java.JavaElement
addAnnotation, getAnnotations, getModifiers, getModifiersText, getName, hasAnnotations, setModifiers, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReturnType

public 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 String[] getExceptions()
Returns a list of exceptions the method can throw.

Returns:
the method's exceptions

isOverride

public boolean isOverride()

getBody

public String getBody()

compareTo

public int compareTo(JavaMethod o)
Specified by:
compareTo in interface Comparable<JavaMethod>

setReturnType

public void setReturnType(String returnType)

getSortedMethods

public static EnumMap<JavaMethod.MethodOrder,List<JavaMethod>> getSortedMethods(List<JavaMethod> methods)

getMethodOrderScope

public static EnumSet<JavaMethod.MethodOrder> getMethodOrderScope(EnumSet<JavaMethod.MethodOrder> allConstants,
                                                                  int scope)


Copyright © 2008-2011 CodeLutin. All Rights Reserved.