Package org.jboss.jdeparser
Interface JMethodDef
-
- All Superinterfaces:
JAnnotatable,JCommentable,JDocCommentable,JGenericDef
- All Known Implementing Classes:
AbstractJMethodDef,AnnotationJMethodDef,ConstructorJMethodDef,MethodJMethodDef
public interface JMethodDef extends JGenericDef, JAnnotatable, JDocCommentable
A method or constructor definition.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JBlock_default()A default method body for a JDK 8+ interface method.JMethodDef_default(JExpr expr)A default value for an annotation method.JComment_throws(java.lang.Class<? extends java.lang.Throwable> type)Get a@throwsdoc comment block.JComment_throws(java.lang.String type)Get a@throwsdoc comment block.JComment_throws(JType type)Get a@throwsdoc comment block.JBlockbody()Get the method body.JParamDeclarationparam(int mods, java.lang.Class<?> type, java.lang.String name)Add a parameter to this method.JParamDeclarationparam(int mods, java.lang.String type, java.lang.String name)Add a parameter to this method.JParamDeclarationparam(int mods, JType type, java.lang.String name)Add a parameter to this method.JParamDeclarationparam(java.lang.Class<?> type, java.lang.String name)Add a parameter to this method.JParamDeclarationparam(java.lang.String type, java.lang.String name)Add a parameter to this method.JParamDeclarationparam(JType type, java.lang.String name)Add a parameter to this method.JParamDeclaration[]params()Get the list of parameters defined thus far.JCommentreturnsDoc()Get the@returndoc comment block.JParamDeclarationvarargParam(int mods, java.lang.Class<?> type, java.lang.String name)Add a vararg parameter to this method.JParamDeclarationvarargParam(int mods, java.lang.String type, java.lang.String name)Add a vararg parameter to this method.JParamDeclarationvarargParam(int mods, JType type, java.lang.String name)Add a vararg parameter to this method.JParamDeclarationvarargParam(java.lang.Class<?> type, java.lang.String name)Add a vararg parameter to this method.JParamDeclarationvarargParam(java.lang.String type, java.lang.String name)Add a vararg parameter to this method.JParamDeclarationvarargParam(JType type, java.lang.String name)Add a vararg parameter to this method.-
Methods inherited from interface org.jboss.jdeparser.JAnnotatable
annotate, annotate, annotate
-
Methods inherited from interface org.jboss.jdeparser.JCommentable
blockComment, lineComment
-
Methods inherited from interface org.jboss.jdeparser.JDocCommentable
deprecated, docComment
-
Methods inherited from interface org.jboss.jdeparser.JGenericDef
typeParam, typeParams
-
-
-
-
Method Detail
-
_default
JBlock _default()
A default method body for a JDK 8+ interface method.- Returns:
- the method body
-
_default
JMethodDef _default(JExpr expr)
A default value for an annotation method.- Parameters:
expr- the value- Returns:
- this method definition
-
body
JBlock body()
Get the method body.- Returns:
- the method body
-
returnsDoc
JComment returnsDoc()
Get the@returndoc comment block.- Returns:
- the comment block
-
param
JParamDeclaration param(int mods, JType type, java.lang.String name)
Add a parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
param
JParamDeclaration param(JType type, java.lang.String name)
Add a parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
param
JParamDeclaration param(int mods, java.lang.String type, java.lang.String name)
Add a parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
param
JParamDeclaration param(java.lang.String type, java.lang.String name)
Add a parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
param
JParamDeclaration param(int mods, java.lang.Class<?> type, java.lang.String name)
Add a parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
param
JParamDeclaration param(java.lang.Class<?> type, java.lang.String name)
Add a parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(int mods, JType type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(JType type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(int mods, java.lang.String type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(java.lang.String type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(int mods, java.lang.Class<?> type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
mods- the parameter modifierstype- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
varargParam
JParamDeclaration varargParam(java.lang.Class<?> type, java.lang.String name)
Add a vararg parameter to this method.- Parameters:
type- the parameter typename- the parameter name- Returns:
- the parameter declaration
-
params
JParamDeclaration[] params()
Get the list of parameters defined thus far.- Returns:
- the parameter list
-
_throws
JComment _throws(java.lang.String type)
Get a@throwsdoc comment block.- Parameters:
type- the exception type- Returns:
- the doc comment block
-
_throws
JComment _throws(JType type)
Get a@throwsdoc comment block.- Parameters:
type- the exception type- Returns:
- the doc comment block
-
_throws
JComment _throws(java.lang.Class<? extends java.lang.Throwable> type)
Get a@throwsdoc comment block.- Parameters:
type- the exception type- Returns:
- the doc comment block
-
-