org.codehaus.modello.generator.java.javasource

Class JConstructor


public class JConstructor
extends java.lang.Object

A class for handling source code for a constructor of a JClass
Version:
$Revision: 510 $ $Date: 2005-12-09 05:03:20 +0000 (Fri, 09 Dec 2005) $
Author:
Keith Visco

Constructor Summary

JConstructor(JClass declaringClass)
Creates a new method with the given name and returnType.

Method Summary

void
addParameter(JParameter parameter)
Adds the given parameter to this Methods list of parameters
JClass
getDeclaringClass()
Returns the class in which this JMember has been declared
JModifiers
getModifiers()
Returns the modifiers for this JConstructor
JParameter[]
getParameters()
Returns an array of JParameters consisting of the parameters of this Method in declared order
JSourceCode
getSourceCode()
void
print(JSourceWriter jsw)
void
setModifiers(JModifiers modifiers)
void
setSourceCode(String sourceCode)
void
setSourceCode(JSourceCode sourceCode)
String
toString()

Constructor Details

JConstructor

public JConstructor(JClass declaringClass)
Creates a new method with the given name and returnType. For "void" return types, simply pass in null as the returnType

Method Details

addParameter

public void addParameter(JParameter parameter)
            throws IllegalArgumentException
Adds the given parameter to this Methods list of parameters
Parameters:
parameter - the parameter to add to the this Methods list of parameters.

getDeclaringClass

public JClass getDeclaringClass()
Returns the class in which this JMember has been declared
Returns:
the class in which this JMember has been declared

getModifiers

public JModifiers getModifiers()
Returns the modifiers for this JConstructor
Returns:
the modifiers for this JConstructor

getParameters

public JParameter[] getParameters()
Returns an array of JParameters consisting of the parameters of this Method in declared order
Returns:
a JParameter array consisting of the parameters of this Method in declared order

getSourceCode

public JSourceCode getSourceCode()

print

public void print(JSourceWriter jsw)

setModifiers

public void setModifiers(JModifiers modifiers)

setSourceCode

public void setSourceCode(String sourceCode)

setSourceCode

public void setSourceCode(JSourceCode sourceCode)

toString

public String toString()