class AnnotationJMethodDef extends MethodJMethodDef
JClassItem.Kind
Modifier and Type | Field and Description |
---|---|
private JExpr |
defaultVal |
SMART_NAME_SORT
Constructor and Description |
---|
AnnotationJMethodDef(AbstractJClassDef enclosingClass,
int mods,
JType returnType,
java.lang.String name) |
Modifier and Type | Method and 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) |
getItemKind, getModifiers, getName, getReturnType, hasAllModifiers, hasAnyModifier, write
_default, _throws, _throws, clazz, param, param, param, param, param, params, returnsDoc, varargParam, varargParam, varargParam, varargParam, varargParam
typeParam, typeParams, typeParamsToArgs, writeTypeParams
annotate, annotate, annotate, writeAnnotations
deprecated, docComment, writeDocComments
blockComment, lineComment, writeComments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
typeParam, typeParams
annotate, annotate, annotate
deprecated, docComment
blockComment, lineComment
private JExpr defaultVal
AnnotationJMethodDef(AbstractJClassDef enclosingClass, int mods, JType returnType, java.lang.String name)
public JBlock body()
JMethodDef
body
in interface JMethodDef
body
in class AbstractJMethodDef
public JParamDeclaration param(int mods, JType type, java.lang.String name)
JMethodDef
param
in interface JMethodDef
param
in class AbstractJMethodDef
mods
- the parameter modifierstype
- the parameter typename
- the parameter namepublic JParamDeclaration varargParam(int mods, JType type, java.lang.String name)
JMethodDef
varargParam
in interface JMethodDef
varargParam
in class AbstractJMethodDef
mods
- the parameter modifierstype
- the parameter typename
- the parameter namepublic JComment _throws(JType type)
JMethodDef
@throws
doc comment block._throws
in interface JMethodDef
_throws
in class AbstractJMethodDef
type
- the exception typepublic JMethodDef _default(JExpr defaultVal)
JMethodDef
_default
in interface JMethodDef
_default
in class AbstractJMethodDef
defaultVal
- the valueboolean writeBody()
writeBody
in class AbstractJMethodDef
void writePostfix(SourceFileWriter writer) throws java.io.IOException
writePostfix
in class AbstractJMethodDef
java.io.IOException