Class JParameter
- java.lang.Object
-
- org.codehaus.modello.plugin.java.javasource.JParameter
-
public class JParameter extends Object
Represents a parameter to a JMethod.- Version:
- $Revision$ $Date$
- Author:
- Keith Visco
-
-
Constructor Summary
Constructors Constructor Description JParameter(JType type, String name)Creates a new JParameter with the given type, and name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendAnnotation(String annotation)JAnnotationsgetAnnotations()StringgetName()Returns the name of the parameterJTypegetType()Returns the parameter typevoidsetAnnotations(JAnnotations annotations)voidsetName(String name)Sets the name of this parametervoidsetType(JType type)Sets the type of this parameterStringtoString()Returns the String representation of this JParameter.
-
-
-
Constructor Detail
-
JParameter
public JParameter(JType type, String name) throws IllegalArgumentException
Creates a new JParameter with the given type, and name- Parameters:
type- the type to associate with this JParametername- the name of the JParameter- Throws:
IllegalArgumentException
-
-
Method Detail
-
getName
public String getName()
Returns the name of the parameter- Returns:
- the name of the parameter
-
getType
public JType getType()
Returns the parameter type- Returns:
- the parameter type
-
setName
public void setName(String name)
Sets the name of this parameter- Parameters:
name- the new name of the parameter
-
setType
public void setType(JType type) throws IllegalArgumentException
Sets the type of this parameter- Parameters:
type- the new type of this parameter- Throws:
IllegalArgumentException
-
toString
public String toString()
Returns the String representation of this JParameter. The String returns will consist of the String representation of the parameter type, followed by the name of the parameter
-
getAnnotations
public JAnnotations getAnnotations()
- Returns:
- the annotations
-
appendAnnotation
public void appendAnnotation(String annotation)
- Parameters:
annotation- the annotation to append
-
setAnnotations
public void setAnnotations(JAnnotations annotations)
- Parameters:
annotations- the annotations to set
-
-