public class JConstructor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private JAnnotations |
annotations |
private JClass |
declaringClass
The Class in this JMember has been declared
|
private JModifiers |
modifiers
The set of modifiers for this JMethod
|
private java.util.Map<java.lang.String,JParameter> |
params
List of parameters for this Constructor
|
private JSourceCode |
sourceCode |
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(java.lang.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(java.lang.String sourceCode) |
java.lang.String |
toString() |
private JModifiers modifiers
private java.util.Map<java.lang.String,JParameter> params
private JClass declaringClass
private JSourceCode sourceCode
private JAnnotations annotations
public JConstructor(JClass declaringClass)
declaringClass
- the declaring class for this constructorpublic void addParameter(JParameter parameter) throws java.lang.IllegalArgumentException
parameter
- the parameter to add to the this Methods
list of parameters.java.lang.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(java.lang.String sourceCode)
public void setSourceCode(JSourceCode sourceCode)
public java.lang.String toString()
toString
in class java.lang.Object
public JAnnotations getAnnotations()
public void appendAnnotation(java.lang.String annotation)
annotation
- the annotation to appendpublic void setAnnotations(JAnnotations annotations)
annotations
- the annotations to set