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 JExprdefaultVal-
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@throwsdoc comment block.JBlockbody()Get the method body.JParamDeclarationparam(int mods, JType type, java.lang.String name)Add a parameter to this method.JParamDeclarationvarargParam(int mods, JType type, java.lang.String name)Add a vararg parameter to this method.(package private) booleanwriteBody()(package private) voidwritePostfix(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:JMethodDefGet the method body.- Specified by:
bodyin interfaceJMethodDef- Overrides:
bodyin classAbstractJMethodDef- Returns:
- the method body
-
param
public JParamDeclaration param(int mods, JType type, java.lang.String name)
Description copied from interface:JMethodDefAdd a parameter to this method.- Specified by:
paramin interfaceJMethodDef- Overrides:
paramin 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:JMethodDefAdd a vararg parameter to this method.- Specified by:
varargParamin interfaceJMethodDef- Overrides:
varargParamin 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:JMethodDefGet a@throwsdoc comment block.- Specified by:
_throwsin interfaceJMethodDef- Overrides:
_throwsin classAbstractJMethodDef- Parameters:
type- the exception type- Returns:
- the doc comment block
-
_default
public JMethodDef _default(JExpr defaultVal)
Description copied from interface:JMethodDefA default value for an annotation method.- Specified by:
_defaultin interfaceJMethodDef- Overrides:
_defaultin classAbstractJMethodDef- Parameters:
defaultVal- the value- Returns:
- this method definition
-
writeBody
boolean writeBody()
- Overrides:
writeBodyin classAbstractJMethodDef
-
writePostfix
void writePostfix(SourceFileWriter writer) throws java.io.IOException
- Overrides:
writePostfixin classAbstractJMethodDef- Throws:
java.io.IOException
-
-