ca.quine.jcommons.sourcegen
Class MethodSource

java.lang.Object
  |
  +--ca.quine.jcommons.sourcegen.MethodSource

public class MethodSource
extends Object


Constructor Summary
MethodSource(boolean isConstructor, String methodName, String returnType)
           
 
Method Summary
 void addParameter(Parameter parameter)
           
 ArrayList getCodeLines()
           
 CommentSource getComment()
           
 ArrayList getExceptions()
           
 int getModifiers()
           
 String getName()
           
 Iterator getParameterIterator()
           
 String getReturnType()
           
 ArrayList makeFormattableListForSignature(FormattingRules rules)
          Creates an ArrayList of Strings for the method signature, each of which is an indivisible token to be formatted on one or more lines.
 void output(FormattingRules formatRules, StringBuffer buffer)
           
 void setCodeLines(ArrayList codeLines)
          Sets an ArrayList of lines of code that will become the method body; tabs for internal indenting will be converted to spaces if space indenting is on.
 void setComment(CommentSource comment)
           
 void setException(String exception)
           
 void setExceptions(ArrayList exceptions)
           
 void setModifiers(int modifiers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodSource

public MethodSource(boolean isConstructor,
                    String methodName,
                    String returnType)
Method Detail

getComment

public CommentSource getComment()

setComment

public void setComment(CommentSource comment)

getName

public String getName()

getModifiers

public int getModifiers()

setModifiers

public void setModifiers(int modifiers)

getReturnType

public String getReturnType()

getCodeLines

public ArrayList getCodeLines()

setCodeLines

public void setCodeLines(ArrayList codeLines)
Sets an ArrayList of lines of code that will become the method body; tabs for internal indenting will be converted to spaces if space indenting is on. The method's indent level is added automatically to each line. If tab indenting is on, the spacing will be left exactly as-is (with the method's level of indenting added with tabs). Use of tabs (even if space indenting is in use) for internal indenting is strongly encouraged, since no changes will be needed later if the indenting is switched to tabs, or if the number of spaces used for an indent changes.

Parameters:
codeLines -

makeFormattableListForSignature

public ArrayList makeFormattableListForSignature(FormattingRules rules)
Creates an ArrayList of Strings for the method signature, each of which is an indivisible token to be formatted on one or more lines. This method is public mostly for the test cases.

Returns:
a list of String objects (including trailing commas) that (when formatted) form the method signature.

output

public void output(FormattingRules formatRules,
                   StringBuffer buffer)

addParameter

public void addParameter(Parameter parameter)

getParameterIterator

public Iterator getParameterIterator()

getExceptions

public ArrayList getExceptions()

setExceptions

public void setExceptions(ArrayList exceptions)

setException

public void setException(String exception)