Package org.jboss.jdeparser
Class AbstractJMethodDef
java.lang.Object
org.jboss.jdeparser.BasicJCommentable
org.jboss.jdeparser.AbstractJDocCommentable
org.jboss.jdeparser.BasicJAnnotatable
org.jboss.jdeparser.AbstractJGeneric
org.jboss.jdeparser.AbstractJMethodDef
- All Implemented Interfaces:
ClassContent
,JAnnotatable
,JCommentable
,JDocCommentable
,JGenericDef
,JMethodDef
,Writable
- Direct Known Subclasses:
ConstructorJMethodDef
,MethodJMethodDef
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList
<AbstractJType> private BasicJBlock
private final AbstractJClassDef
private int
private ArrayList
<ImplJParamDeclaration> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_default()
A default method body for a JDK 8+ interface method.A default value for an annotation method.Get a@throws
doc comment block.Get a@throws
doc comment block.Get a@throws
doc comment block.private ImplJParamDeclaration
add
(ImplJParamDeclaration item) body()
Get the method body.(package private) AbstractJClassDef
clazz()
(package private) int
Add a parameter to this method.Add a parameter to this method.Add a parameter to this method.Add a parameter to this method.Add a parameter to this method.Add a parameter to this method.params()
Get the list of parameters defined thus far.Get the@return
doc comment block.varargParam
(int mods, Class<?> type, String name) Add a vararg parameter to this method.varargParam
(int mods, String type, String name) Add a vararg parameter to this method.varargParam
(int mods, JType type, String name) Add a vararg parameter to this method.varargParam
(Class<?> type, String name) Add a vararg parameter to this method.varargParam
(String type, String name) Add a vararg parameter to this method.varargParam
(JType type, String name) Add a vararg parameter to this method.void
write
(SourceFileWriter writer) (package private) boolean
(package private) void
writePostfix
(SourceFileWriter writer) Methods inherited from class org.jboss.jdeparser.AbstractJGeneric
typeParam, typeParams, typeParamsToArgs, writeTypeParams
Methods inherited from class org.jboss.jdeparser.BasicJAnnotatable
annotate, annotate, annotate, writeAnnotations
Methods inherited from class org.jboss.jdeparser.AbstractJDocCommentable
deprecated, docComment, writeDocComments
Methods inherited from class org.jboss.jdeparser.BasicJCommentable
blockComment, lineComment, writeComments
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
-
Field Details
-
clazz
-
mods
private int mods -
params
-
_throws
-
body
-
-
Constructor Details
-
AbstractJMethodDef
AbstractJMethodDef(AbstractJClassDef clazz, int mods)
-
-
Method Details
-
_default
Description copied from interface:JMethodDef
A default method body for a JDK 8+ interface method.- Specified by:
_default
in interfaceJMethodDef
- Returns:
- the method body
-
_default
Description copied from interface:JMethodDef
A default value for an annotation method.- Specified by:
_default
in interfaceJMethodDef
- Parameters:
expr
- the value- Returns:
- this method definition
-
body
Description copied from interface:JMethodDef
Get the method body.- Specified by:
body
in interfaceJMethodDef
- Returns:
- the method body
-
returnsDoc
Description copied from interface:JMethodDef
Get the@return
doc comment block.- Specified by:
returnsDoc
in interfaceJMethodDef
- Returns:
- the comment block
-
add
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
param
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Parameters:
type
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
params
Description copied from interface:JMethodDef
Get the list of parameters defined thus far.- Specified by:
params
in interfaceJMethodDef
- Returns:
- the parameter list
-
_throws
Description copied from interface:JMethodDef
Get a@throws
doc comment block.- Specified by:
_throws
in interfaceJMethodDef
- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
_throws
Description copied from interface:JMethodDef
Get a@throws
doc comment block.- Specified by:
_throws
in interfaceJMethodDef
- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
_throws
Description copied from interface:JMethodDef
Get a@throws
doc comment block.- Specified by:
_throws
in interfaceJMethodDef
- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
getModifiers
int getModifiers() -
writeBody
boolean writeBody() -
write
- Specified by:
write
in interfaceWritable
- Throws:
IOException
-
writePostfix
- Throws:
IOException
-
clazz
AbstractJClassDef clazz()
-