Class JConstructor
java.lang.Object
org.codehaus.modello.plugin.java.javasource.JConstructor
A class for handling source code for a constructor of a JClass
- Version:
- $Revision$ $Date$
- Author:
- Keith Visco
-
Constructor Summary
ConstructorDescriptionJConstructor
(JClass declaringClass) Creates a new method with the given name and returnType. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(JParameter parameter) Adds the given parameter to this Methods list of parametersvoid
appendAnnotation
(String annotation) Returns the class in which this JMember has been declaredReturns the modifiers for this JConstructorReturns an array of JParameters consisting of the parameters of this Method in declared ordervoid
print
(JSourceWriter jsw) void
setAnnotations
(JAnnotations annotations) void
setModifiers
(JModifiers modifiers) void
setSourceCode
(String sourceCode) void
setSourceCode
(JSourceCode sourceCode) toString()
-
Constructor Details
-
JConstructor
Creates a new method with the given name and returnType. For "void" return types, simply pass in null as the returnType- Parameters:
declaringClass
- the declaring class for this constructor
-
-
Method Details
-
addParameter
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
Returns the class in which this JMember has been declared- Returns:
- the class in which this JMember has been declared
-
getModifiers
Returns the modifiers for this JConstructor- Returns:
- the modifiers for this JConstructor
-
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
-
print
-
setModifiers
-
setSourceCode
-
setSourceCode
-
toString
-
getAnnotations
- Returns:
- the annotations
-
appendAnnotation
- Parameters:
annotation
- the annotation to append
-
setAnnotations
- Parameters:
annotations
- the annotations to set
-