|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.devkit.model.code.GeneratedMethod
public class GeneratedMethod
Java method.
| Method Summary | ||
|---|---|---|
GeneratedMethod |
_throws(Class<? extends Throwable> exception)
|
|
GeneratedMethod |
_throws(TypeReference exception)
Add an exception to the list of exceptions that this method may throw. |
|
GeneratedAnnotationUse |
annotate(Class<? extends Annotation> clazz)
Adds an annotation to this variable. |
|
GeneratedAnnotationUse |
annotate(TypeReference clazz)
Adds an annotation to this variable. |
|
|
annotate2(Class<W> clazz)
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations. |
|
Collection<GeneratedAnnotationUse> |
annotations()
Read-only live view of all annotations on this Annotable |
|
GeneratedBlock |
body()
Get the block that makes up body of this method |
|
void |
declare(Formatter f)
|
|
void |
declareDefaultValue(GeneratedExpression value)
Specify the default value for this annotation member |
|
TypeVariable |
generify(String name)
Adds a new type variable to this declaration. |
|
TypeVariable |
generify(String name,
Class<?> bound)
Adds a new type variable to this declaration with a bound. |
|
TypeVariable |
generify(String name,
TypeReference bound)
Adds a new type variable to this declaration with a bound. |
|
Modifiers |
getMods()
Deprecated. use mods() |
|
boolean |
hasSignature(Type[] argTypes)
Returns true if the method has the specified signature. |
|
boolean |
hasVarArgs()
Check if there are any varargs declared for this method signature. |
|
GeneratedJavaDocComment |
javadoc()
Creates, if necessary, and returns the class javadoc for this DefinedClass |
|
GeneratedVariable[] |
listParams()
Returns all the parameters in an array. |
|
Type[] |
listParamTypes()
Returns all the parameter types in an array. |
|
GeneratedVariable |
listVarParam()
Returns the variable parameter |
|
Type |
listVarParamType()
Returns the varags parameter type. |
|
Modifiers |
mods()
|
|
String |
name()
|
|
void |
name(String n)
Changes the name of the method. |
|
protected CodeModel |
owner()
|
|
GeneratedVariable |
param(Class<?> type,
String name)
|
|
GeneratedVariable |
param(int mods,
Class<?> type,
String name)
|
|
GeneratedVariable |
param(int mods,
Type type,
String name)
Add the specified variable to the list of parameters for this method signature. |
|
GeneratedVariable |
param(Type type,
String name)
|
|
List<GeneratedVariable> |
params()
Returns the list of variable of this method. |
|
Type |
type()
Returns the return type. |
|
void |
type(Type t)
Overrides the return type. |
|
TypeVariable[] |
typeParams()
Iterates all the type parameters of this class/interface. |
|
GeneratedVariable |
varParam(Class<?> type,
String name)
|
|
GeneratedVariable |
varParam(Type type,
String name)
Add the specified variable argument to the list of parameters for this method signature. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public GeneratedMethod _throws(TypeReference exception)
exception - Name of an exception that this method may throwpublic GeneratedMethod _throws(Class<? extends Throwable> exception)
public List<GeneratedVariable> params()
public GeneratedVariable param(int mods,
Type type,
String name)
type - Type of the parameter being addedname - Name of the parameter being added
public GeneratedVariable param(Type type,
String name)
public GeneratedVariable param(int mods,
Class<?> type,
String name)
public GeneratedVariable param(Class<?> type,
String name)
public GeneratedVariable varParam(Class<?> type,
String name)
varParam(Type, String)
public GeneratedVariable varParam(Type type,
String name)
type - Type of the parameter being added.name - Name of the parameter being added
IllegalStateException - If this method is called twice.
varargs in J2SE 1.5 can appear only once in the
method signature.public GeneratedAnnotationUse annotate(TypeReference clazz)
annotate in interface Annotableclazz - The annotation class to annotate the field withpublic GeneratedAnnotationUse annotate(Class<? extends Annotation> clazz)
annotate in interface Annotableclazz - The annotation class to annotate the field withpublic <W extends AnnotationWriter> W annotate2(Class<W> clazz)
Annotable
annotate2 in interface Annotablepublic Collection<GeneratedAnnotationUse> annotations()
AnnotableAnnotable
annotations in interface Annotablepublic boolean hasVarArgs()
public String name()
public void name(String n)
public Type type()
public void type(Type t)
public Type[] listParamTypes()
public Type listVarParamType()
public GeneratedVariable[] listParams()
public GeneratedVariable listVarParam()
public boolean hasSignature(Type[] argTypes)
public GeneratedBlock body()
public void declareDefaultValue(GeneratedExpression value)
value - Default value for the annotation memberpublic GeneratedJavaDocComment javadoc()
javadoc in interface Documentablepublic void declare(Formatter f)
declare in interface Declarationpublic Modifiers mods()
public Modifiers getMods()
mods()
protected CodeModel owner()
public TypeVariable generify(String name)
Generifiable
generify in interface Generifiable
public TypeVariable generify(String name,
Class<?> bound)
Generifiable
generify in interface Generifiable
public TypeVariable generify(String name,
TypeReference bound)
Generifiable
generify in interface Generifiablepublic TypeVariable[] typeParams()
Generifiable
typeParams in interface Generifiable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||