public class JConstructor extends Object
Constructor and Description |
---|
JConstructor(JClass declaringClass)
Creates a new method with the given name and returnType.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(JParameter parameter)
Adds the given parameter to this Methods list of parameters
|
void |
appendAnnotation(String annotation) |
JAnnotations |
getAnnotations() |
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 |
setAnnotations(JAnnotations annotations) |
void |
setModifiers(JModifiers modifiers) |
void |
setSourceCode(JSourceCode sourceCode) |
void |
setSourceCode(String sourceCode) |
String |
toString() |
public JConstructor(JClass declaringClass)
declaringClass
- the declaring class for this constructorpublic void addParameter(JParameter parameter) throws IllegalArgumentException
parameter
- the parameter to add to the this Methods
list of parameters.IllegalArgumentException
- when a parameter already
exists for this Method with the same name as the new parameterpublic JClass getDeclaringClass()
public JModifiers getModifiers()
public JParameter[] getParameters()
public JSourceCode getSourceCode()
public void print(JSourceWriter jsw)
public void setModifiers(JModifiers modifiers)
public void setSourceCode(String sourceCode)
public void setSourceCode(JSourceCode sourceCode)
public JAnnotations getAnnotations()
public void appendAnnotation(String annotation)
annotation
- the annotation to appendpublic void setAnnotations(JAnnotations annotations)
annotations
- the annotations to setCopyright © 2001–2024 Codehaus Plexus. All rights reserved.