public final class JConstructor extends JAnnotatedElementHelper
Modifier | Constructor and Description |
---|---|
protected |
JConstructor(AbstractJClass declaringClass)
Creates a new JConstructor for the provided declaring class.
|
Modifier and Type | Method and Description |
---|---|
void |
addException(JClass exp)
Adds the given Exception to this JConstructor's throws clause.
|
void |
addParameter(JParameter parameter)
Adds the given parameter to this JConstructor's list of parameters.
|
AbstractJClass |
getDeclaringClass()
Returns the class in which this JConstructor has been declared.
|
JClass[] |
getExceptions()
Returns the exceptions that this JConstructor lists in its throws clause.
|
JModifiers |
getModifiers()
Returns the modifiers for this JConstructor.
|
int |
getParameterCount()
Returns the amount of parameters.
|
JParameter[] |
getParameters()
Returns an array of JParameters consisting of the parameters of this
JConstructor in declared order.
|
JSourceCode |
getSourceCode()
Returns the source code for this JConstructor.
|
void |
print(JSourceWriter jsw)
Prints this JConstructor to the provided JSourceWriter.
|
void |
setModifiers(JModifiers modifiers)
Sets the modifiers on this JConstructor.
|
void |
setSourceCode(JSourceCode sourceCode)
Sets the source code for this constructor.
|
void |
setSourceCode(String sourceCode)
Sets the source code for this constructor.
|
String |
toString() |
addAnnotation, getAnnotation, getAnnotations, hasAnnotations, isAnnotationPresent, printAnnotations, removeAnnotation
protected JConstructor(AbstractJClass declaringClass)
declaringClass
- The class this constructor creates.public JClass[] getExceptions()
public void addException(JClass exp)
exp
- The JClass representing the Exception.public JParameter[] getParameters()
public int getParameterCount()
public void addParameter(JParameter parameter)
parameter
- The parameter to add to the this JConstructor's list of
parameters.public AbstractJClass getDeclaringClass()
public JModifiers getModifiers()
public void setModifiers(JModifiers modifiers)
modifiers
- Modifiers to set on this constructor.public JSourceCode getSourceCode()
public void setSourceCode(String sourceCode)
sourceCode
- Source code to apply to this constructor.public void setSourceCode(JSourceCode sourceCode)
sourceCode
- Source code to apply to this constructor.public void print(JSourceWriter jsw)
jsw
- The JSourceWriter to print the constructor to.Copyright © 2016. All rights reserved.