Package org.jboss.jdeparser
Class MethodJMethodDef
- java.lang.Object
-
- All Implemented Interfaces:
ClassContent,JAnnotatable,JClassItem,JCommentable,JDocCommentable,JGenericDef,JMethodDef,Writable
- Direct Known Subclasses:
AnnotationJMethodDef
class MethodJMethodDef extends AbstractJMethodDef implements JClassItem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jdeparser.JClassItem
JClassItem.Kind
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate JTypereturnType-
Fields inherited from interface org.jboss.jdeparser.JClassItem
SMART_NAME_SORT
-
-
Constructor Summary
Constructors Constructor Description MethodJMethodDef(AbstractJClassDef clazz, int mods, JType returnType, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JClassItem.KindgetItemKind()Get the kind of item.intgetModifiers()Get the modifiers of this item.java.lang.StringgetName()Get the name of this element, if there is one.(package private) JTypegetReturnType()booleanhasAllModifiers(int mods)Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.booleanhasAnyModifier(int mods)Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.voidwrite(SourceFileWriter writer)-
Methods inherited from class org.jboss.jdeparser.AbstractJMethodDef
_default, _default, _throws, _throws, _throws, body, clazz, param, param, param, param, param, param, params, returnsDoc, varargParam, varargParam, varargParam, varargParam, varargParam, varargParam, writeBody, writePostfix
-
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
-
returnType
private final JType returnType
-
name
private final java.lang.String name
-
-
Constructor Detail
-
MethodJMethodDef
MethodJMethodDef(AbstractJClassDef clazz, int mods, JType returnType, java.lang.String name)
-
-
Method Detail
-
getReturnType
JType getReturnType()
-
write
public void write(SourceFileWriter writer) throws java.io.IOException
- Specified by:
writein interfaceWritable- Overrides:
writein classAbstractJMethodDef- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
Description copied from interface:JClassItemGet the name of this element, if there is one.- Specified by:
getNamein interfaceJClassItem- Returns:
- the name, or
nullif there is none
-
getModifiers
public int getModifiers()
Description copied from interface:JClassItemGet the modifiers of this item.- Specified by:
getModifiersin interfaceJClassItem- Overrides:
getModifiersin classAbstractJMethodDef- Returns:
- the modifiers
- See Also:
JMod
-
getItemKind
public JClassItem.Kind getItemKind()
Description copied from interface:JClassItemGet the kind of item.- Specified by:
getItemKindin interfaceJClassItem- Returns:
- the item kind
-
hasAllModifiers
public boolean hasAllModifiers(int mods)
Description copied from interface:JClassItemDetermine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.- Specified by:
hasAllModifiersin interfaceJClassItem- Parameters:
mods- the modifier(s)- Returns:
trueif all of the modifiers are present,falseotherwise
-
hasAnyModifier
public boolean hasAnyModifier(int mods)
Description copied from interface:JClassItemDetermine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.- Specified by:
hasAnyModifierin interfaceJClassItem- Parameters:
mods- the modifier(s)- Returns:
trueif any if the modifiers are present,falseotherwise
-
-