Package org.jboss.jdeparser
Class AnnotationJMethodDef
- java.lang.Object
-
- All Implemented Interfaces:
ClassContent
,JAnnotatable
,JClassItem
,JCommentable
,JDocCommentable
,JGenericDef
,JMethodDef
,Writable
class AnnotationJMethodDef extends MethodJMethodDef
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JClassItem
JClassItem.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private JExpr
defaultVal
-
Fields inherited from interface org.jboss.jdeparser.JClassItem
SMART_NAME_SORT
-
-
Constructor Summary
Constructors Constructor Description AnnotationJMethodDef(AbstractJClassDef enclosingClass, int mods, JType returnType, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JMethodDef
_default(JExpr defaultVal)
A default value for an annotation method.JComment
_throws(JType type)
Get a@throws
doc comment block.JBlock
body()
Get the method body.JParamDeclaration
param(int mods, JType type, java.lang.String name)
Add a parameter to this method.JParamDeclaration
varargParam(int mods, JType type, java.lang.String name)
Add a vararg parameter to this method.(package private) boolean
writeBody()
(package private) void
writePostfix(SourceFileWriter writer)
-
Methods inherited from class org.jboss.jdeparser.MethodJMethodDef
getItemKind, getModifiers, getName, getReturnType, hasAllModifiers, hasAnyModifier, write
-
Methods inherited from class org.jboss.jdeparser.AbstractJMethodDef
_default, _throws, _throws, clazz, param, param, param, param, param, params, returnsDoc, varargParam, varargParam, varargParam, varargParam, varargParam
-
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 Detail
-
defaultVal
private JExpr defaultVal
-
-
Constructor Detail
-
AnnotationJMethodDef
AnnotationJMethodDef(AbstractJClassDef enclosingClass, int mods, JType returnType, java.lang.String name)
-
-
Method Detail
-
body
public JBlock body()
Description copied from interface:JMethodDef
Get the method body.- Specified by:
body
in interfaceJMethodDef
- Overrides:
body
in classAbstractJMethodDef
- Returns:
- the method body
-
param
public JParamDeclaration param(int mods, JType type, java.lang.String name)
Description copied from interface:JMethodDef
Add a parameter to this method.- Specified by:
param
in interfaceJMethodDef
- Overrides:
param
in classAbstractJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
varargParam
public JParamDeclaration varargParam(int mods, JType type, java.lang.String name)
Description copied from interface:JMethodDef
Add a vararg parameter to this method.- Specified by:
varargParam
in interfaceJMethodDef
- Overrides:
varargParam
in classAbstractJMethodDef
- Parameters:
mods
- the parameter modifierstype
- the parameter typename
- the parameter name- Returns:
- the parameter declaration
-
_throws
public JComment _throws(JType type)
Description copied from interface:JMethodDef
Get a@throws
doc comment block.- Specified by:
_throws
in interfaceJMethodDef
- Overrides:
_throws
in classAbstractJMethodDef
- Parameters:
type
- the exception type- Returns:
- the doc comment block
-
_default
public JMethodDef _default(JExpr defaultVal)
Description copied from interface:JMethodDef
A default value for an annotation method.- Specified by:
_default
in interfaceJMethodDef
- Overrides:
_default
in classAbstractJMethodDef
- Parameters:
defaultVal
- the value- Returns:
- this method definition
-
writeBody
boolean writeBody()
- Overrides:
writeBody
in classAbstractJMethodDef
-
writePostfix
void writePostfix(SourceFileWriter writer) throws java.io.IOException
- Overrides:
writePostfix
in classAbstractJMethodDef
- Throws:
java.io.IOException
-
-