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@throws
doc comment block.JComment
_throws(java.lang.String type)
Get a@throws
doc comment block.JComment
_throws(JType type)
Get a@throws
doc comment block.JBlock
body()
Get the method body.JParamDeclaration
param(int mods, java.lang.Class<?> type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
param(int mods, java.lang.String type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
param(int mods, JType type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
param(java.lang.Class<?> type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
param(java.lang.String type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
param(JType type, java.lang.String name)
Add a parameter to this method.JParamDeclaration[]
params()
Get the list of parameters defined thus far.JComment
returnsDoc()
Get the@return
doc comment block.JParamDeclaration
varargParam(int mods, java.lang.Class<?> type, java.lang.String name)
Add a vararg parameter to this method.JParamDeclaration
varargParam(int mods, java.lang.String type, java.lang.String name)
Add a vararg parameter to this method.JParamDeclaration
varargParam(int mods, JType type, java.lang.String name)
Add a vararg parameter to this method.JParamDeclaration
varargParam(java.lang.Class<?> type, java.lang.String name)
Add a vararg parameter to this method.JParamDeclaration
varargParam(java.lang.String type, java.lang.String name)
Add a vararg parameter to this method.JParamDeclaration
varargParam(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@return
doc 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@throws
doc comment block.- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
_throws
JComment _throws(JType type)
Get a@throws
doc 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@throws
doc comment block.- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
-