public interface MethodInfo extends DeclarationInfo
DeclarationInfo.Kind
Modifier and Type | Method and Description |
---|---|
default MethodInfo |
asMethod()
Returns this declaration as a method.
|
ClassInfo |
declaringClass()
Returns the class that declares this method.
|
boolean |
isAbstract()
Returns whether this method is abstract.
|
boolean |
isConstructor()
Returns whether this method is, in fact, a constructor.
|
boolean |
isFinal()
Returns whether this method is
final . |
boolean |
isStatic()
Returns whether this method is
static . |
default DeclarationInfo.Kind |
kind()
Returns the kind of this declaration.
|
int |
modifiers()
Returns the modifiers of this method as an
int . |
java.lang.String |
name()
Returns the name of this method.
|
java.util.List<ParameterInfo> |
parameters()
Returns a list of parameters declared or implicitly declared on this method.
|
Type |
receiverType()
Returns the type of the receiver parameter declared by this method.
|
Type |
returnType()
Returns the return type of this method.
|
java.util.List<Type> |
throwsTypes()
Returns a list of exception types that are declared to be thrown by this method.
|
java.util.List<TypeVariable> |
typeParameters()
Returns a list of type parameters declared on this method.
|
asClass, asDeclaration, asField, asPackage, asParameter, asRecordComponent, asType, isClass, isDeclaration, isField, isMethod, isPackage, isParameter, isRecordComponent, isType
annotation, annotations, annotations, hasAnnotation, hasAnnotation, repeatableAnnotation
java.lang.String name()
null
java.util.List<ParameterInfo> parameters()
null
Type returnType()
null
Type receiverType()
null
if this method cannot declare a receiver parameter; that is, if this method
is static
or is a constructor of a top-level class or a static
nested class.
If this method may declare a receiver parameter but does not, returns a Type
with no annotations.null
if this method cannot declare a receiver parameterjava.util.List<Type> throwsTypes()
null
java.util.List<TypeVariable> typeParameters()
null
boolean isConstructor()
boolean isStatic()
static
.static
.boolean isAbstract()
A static
method is never abstract.
An instance method declared on a plain class or an enum is abstract if declared abstract
.
An instance method declared on an interface is abstract unless declared default
.
An instance method declared on an annotation type is always abstract.
An instance method declared on a record type is never abstract.
abstract
.boolean isFinal()
final
.final
.int modifiers()
int
.
Use Modifier
to inspect the value.ClassInfo declaringClass()
null
default DeclarationInfo.Kind kind()
DeclarationInfo
kind
in interface DeclarationInfo
default MethodInfo asMethod()
DeclarationInfo
asMethod
in interface DeclarationInfo
null