org.exolab.javasource

Class JConstructor

public final class JConstructor extends JAnnotatedElementHelper

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

Version: $Revision: 6324 $ $Date: 2005-05-08 05:24:54 -0600 (Sun, 08 May 2005) $

Author: Keith Visco

Constructor Summary
protected JConstructor(JClass declaringClass)
Creates a new JConstructor for the provided declaring class.
Method Summary
voidaddException(JClass exp)
Adds the given Exception to this JConstructor's throws clause.
voidaddParameter(JParameter parameter)
Adds the given parameter to this JConstructor's list of parameters.
JClassgetDeclaringClass()
Returns the class in which this JConstructor has been declared.
JClass[]getExceptions()
Returns the exceptions that this JConstructor lists in its throws clause.
JModifiersgetModifiers()
Returns the modifiers for this JConstructor.
JParameter[]getParameters()
Returns an array of JParameters consisting of the parameters of this JConstructor in declared order.
JSourceCodegetSourceCode()
Returns the source code for this JConstructor.
voidprint(JSourceWriter jsw)
Prints this JConstructor to the provided JSourceWriter.
voidsetModifiers(JModifiers modifiers)
Sets the modifiers on this JConstructor.
voidsetSourceCode(String sourceCode)
Sets the source code for this constructor.
voidsetSourceCode(JSourceCode sourceCode)
Sets the source code for this constructor.
StringtoString()
Return the string representation of this constructor.

Constructor Detail

JConstructor

protected JConstructor(JClass declaringClass)
Creates a new JConstructor for the provided declaring class.

Parameters: declaringClass the class this constructor creates

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 JConstructor's list of parameters.

Parameters: parameter the parameter to add to the this JConstructor's list of parameters.

getDeclaringClass

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

Returns: the class in which this JConstructor has been declared.

getExceptions

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

Returns: the exceptions that this JConstructor lists in its 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 JConstructor in declared order.

Returns: a JParameter array consisting of the parameters of this JConstructor in declared order.

getSourceCode

public JSourceCode getSourceCode()
Returns the source code for this JConstructor.

Returns: the source code.

print

public void print(JSourceWriter jsw)
Prints this JConstructor to the provided JSourceWriter.

Parameters: jsw the JSourceWriter to print the constructor to

setModifiers

public void setModifiers(JModifiers modifiers)
Sets the modifiers on this JConstructor.

Parameters: modifiers modifiers to set on this constructor

setSourceCode

public void setSourceCode(String sourceCode)
Sets the source code for this constructor.

Parameters: sourceCode source code to apply to this constructor

setSourceCode

public void setSourceCode(JSourceCode sourceCode)
Sets the source code for this constructor.

Parameters: sourceCode source code to apply to this constructor

toString

public String toString()
Return the string representation of this constructor.

See Also: java.lang.Object#toString() {@inheritDoc }

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com