org.exolab.javasource

Class JConstructor

public class JConstructor extends JAnnotatedElementHelper

A class for handling source code for a constructor of a JClass

Version: $Revision: 1.4 $ $Date: 2005/05/08 11:24:54 $

Author: Keith Visco

Constructor Summary
protected JConstructor(JClass declaringClass)
Creates a new method with the given name and returnType.
Method Summary
voidaddException(JClass exp)
Adds the given Exception to this JConstructor's throws clause.
voidaddParameter(JParameter parameter)
Adds the given parameter to this Methods list of parameters
JClassgetDeclaringClass()
Returns the class in which this JMember has been declared
JClass[]getExceptions()
Returns the exceptions that this JConstructor lists in it's throws clause.
JModifiersgetModifiers()
Returns the modifiers for this JConstructor
JParameter[]getParameters()
Returns an array of JParameters consisting of the parameters of this Method in declared order
JSourceCodegetSourceCode()
voidprint(JSourceWriter jsw)
voidsetModifiers(JModifiers modifiers)
voidsetSourceCode(String sourceCode)
voidsetSourceCode(JSourceCode sourceCode)
StringtoString()

Constructor Detail

JConstructor

protected 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 Detail

addException

public void addException(JClass exp)
Adds the given Exception to this JConstructor's throws clause.

Parameters: exp the JClass representing the Exception

addParameter

public void addParameter(JParameter parameter)
Adds the given parameter to this Methods list of parameters

Parameters: parameter the parameter to add to the this Methods list of parameters.

Throws: IllegalArgumentException when a parameter already exists for this Method with the same name as the new parameter

getDeclaringClass

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

Returns: the class in which this JMember has been declared

getExceptions

public JClass[] getExceptions()
Returns the exceptions that this JConstructor lists in it's throws clause.

Returns: the exceptions that this JConstructor lists in it's throws clause.

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()
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com