Method (Java SE 26 & JDK 26)
- All Implemented Interfaces:
AnnotatedElement, GenericDeclaration, Member
-
Field Summary
-
Method Summary
booleanCompares this
Methodagainst the specified object.Returns an
AnnotatedTypeobject that represents the use of a type to specify the return type of the method/constructor represented by this Executable.getAnnotation(Class<T> annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null.
Returns annotations that are directly present on this element.
Returns the
Classobject representing the class or interface that declares the method represented by this object.Returns the default value for the annotation member represented by this
Methodinstance.Returns an array of
Classobjects that represent the types of exceptions declared to be thrown by the underlying executable represented by this object.Returns an array of
Typeobjects that represent the exceptions declared to be thrown by this executable object.Returns an array of
Typeobjects that represent the formal parameter types, in declaration order, of the executable represented by this object.Returns a
Typeobject that represents the formal return type of the method represented by thisMethodobject.intReturns the Java language modifiers for the executable represented by this object.
getName()Returns the name of the method represented by this
Methodobject, as aString.Returns an array of arrays of
Annotations that represent the annotations on the formal parameters, in declaration order, of theExecutablerepresented by this object.intReturns the number of formal parameters (whether explicitly declared or implicitly declared or neither) for the executable represented by this object.
Returns an array of
Classobjects that represent the formal parameter types, in declaration order, of the executable represented by this object.Returns a
Classobject that represents the formal return type of the method represented by thisMethodobject.Returns an array of
TypeVariableobjects that represent the type variables declared by the generic declaration represented by thisGenericDeclarationobject, in declaration order.inthashCode()Returns a hashcode for this
Method.Invokes the underlying method represented by this
Methodobject, on the specified object with the specified parameters.booleanisBridge()Returns
trueif this method is a bridge method; returnsfalseotherwise.booleanReturns
trueif this method is a default method; returnsfalseotherwise.booleanReturns
trueif this executable is a synthetic construct; returnsfalseotherwise.booleanReturns
trueif this executable was declared to take a variable number of arguments; returnsfalseotherwise.voidsetAccessible(boolean flag) Set the
accessibleflag for this reflected object to the indicated boolean value.Returns a string describing this
Method, including type parameters.toString()Returns a string describing this
Method.Methods declared in class Executable
accessFlags, getAnnotatedExceptionTypes, getAnnotatedParameterTypes, getAnnotatedReceiverType, getAnnotationsByType, getParametersReturns an unmodifiable set of the access flags for the executable represented by this object, possibly empty.
Returns an array of
AnnotatedTypeobjects that represent the use of types to specify the declared exceptions of the method/constructor represented by this Executable.Returns an array of
AnnotatedTypeobjects that represent the use of types to specify formal parameter types of the method/constructor represented by this Executable.Returns an
AnnotatedTypeobject that represents the use of a type to specify the receiver type of the method/constructor represented by thisExecutableobject.Returns annotations that are associated with this element.
Returns an array of
Parameterobjects representing all the parameters to the underlying executable represented by this object.Methods declared in class AccessibleObject
canAccess, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotationsByType, isAccessible, isAnnotationPresent, setAccessible, trySetAccessiblefinal booleanTest if the caller can access this reflected object.
Returns annotations that are present on this element.
Returns this element's annotation for the specified type if such an annotation is directly present, else null.
Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
booleanbooleanReturns true if an annotation for the specified type is present on this element, else false.
static voidConvenience method to set the
accessibleflag for an array of reflected objects.final booleanSet the
accessibleflag for this reflected object totrueif possible.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Method Details
-
setAccessible
-
getDeclaringClass
-
getName
-
getModifiers
-
getTypeParameters
-
getReturnType
-
getGenericReturnType
-
getParameterTypes
-
getParameterCount
-
getGenericParameterTypes
-
getExceptionTypes
-
getGenericExceptionTypes
-
equals
-
hashCode
-
toString
-
toGenericString
-
invoke
-
isBridge
-
isVarArgs
-
isSynthetic
-
isDefault
-
getDefaultValue
-
getAnnotation
-
getDeclaredAnnotations
-
getParameterAnnotations
-
getAnnotatedReturnType
-