Package com.comphenix.protocol.reflect
Class MethodInfo
java.lang.Object
com.comphenix.protocol.reflect.MethodInfo
- All Implemented Interfaces:
AnnotatedElement,GenericDeclaration,Member
Represents a method or a constructor.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodInfofromConstructor(Constructor<?> constructor) Wraps a constructor as a method information object.static Collection<MethodInfo> fromConstructors(Constructor<?>[] constructors) Construct a list of method infos from a given array of constructors.static List<MethodInfo> fromConstructors(Collection<Constructor<?>> constructors) Construct a list of method infos from a given collection of constructors.static MethodInfofromMethod(Method method) Wraps a method as a MethodInfo object.static Collection<MethodInfo> fromMethods(Method[] methods) Construct a list of method infos from a given array of methods.static List<MethodInfo> fromMethods(Collection<Method> methods) Construct a list of method infos from a given collection of methods.abstract Class<?>[]Returns an array of Class objects that represent the types of the exceptions declared to be thrown by the underlying method or constructor represented by this MethodInfo object.abstract Class<?>[]Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method or constructor represented by this MethodInfo object.abstract Class<?> Returns a Class object that represents the formal return type of the method or constructor represented by this MethodInfo object.abstract booleanDetermine if this is a constructor or not.abstract StringReturns a string describing this method or constructor, including type parameters.toString()Returns a string describing this method or constructorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotation, getAnnotations, getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredAnnotationsByType, isAnnotationPresentMethods inherited from interface java.lang.reflect.GenericDeclaration
getTypeParametersMethods inherited from interface java.lang.reflect.Member
accessFlags, getDeclaringClass, getModifiers, getName, isSynthetic
-
Constructor Details
-
MethodInfo
public MethodInfo()
-
-
Method Details
-
fromMethod
Wraps a method as a MethodInfo object.- Parameters:
method- - the method to wrap.- Returns:
- The wrapped method.
-
fromMethods
Construct a list of method infos from a given array of methods.- Parameters:
methods- - array of methods.- Returns:
- Method info list.
-
fromMethods
Construct a list of method infos from a given collection of methods.- Parameters:
methods- - list of methods.- Returns:
- Method info list.
-
fromConstructor
Wraps a constructor as a method information object.- Parameters:
constructor- - the constructor to wrap.- Returns:
- A wrapped constructor.
-
fromConstructors
Construct a list of method infos from a given array of constructors.- Parameters:
constructors- - array of constructors.- Returns:
- Method info list.
-
fromConstructors
Construct a list of method infos from a given collection of constructors.- Parameters:
constructors- - list of constructors.- Returns:
- Method info list.
-
toString
Returns a string describing this method or constructor -
toGenericString
Returns a string describing this method or constructor, including type parameters.- Returns:
- A string describing this Method, include type parameters
- See Also:
-
getExceptionTypes
Returns an array of Class objects that represent the types of the exceptions declared to be thrown by the underlying method or constructor represented by this MethodInfo object.- Returns:
- The exception types declared as being thrown by the method or constructor this object represents.
- See Also:
-
getReturnType
Returns a Class object that represents the formal return type of the method or constructor represented by this MethodInfo object.This is always
Voidfor constructors.- Returns:
- The return value, or Void if a constructor.
- See Also:
-
getParameterTypes
Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method or constructor represented by this MethodInfo object.- Returns:
- The parameter types for the method or constructor this object represents.
- See Also:
-
isConstructor
public abstract boolean isConstructor()Determine if this is a constructor or not.- Returns:
- TRUE if this represents a constructor, FALSE otherwise.
-