Class MethodInfo

java.lang.Object
com.comphenix.protocol.reflect.MethodInfo
All Implemented Interfaces:
AnnotatedElement, GenericDeclaration, Member

public abstract class MethodInfo extends Object implements GenericDeclaration, Member
Represents a method or a constructor.
  • Constructor Details

    • MethodInfo

      public MethodInfo()
  • Method Details

    • fromMethod

      public static MethodInfo fromMethod(Method method)
      Wraps a method as a MethodInfo object.
      Parameters:
      method - - the method to wrap.
      Returns:
      The wrapped method.
    • fromMethods

      public static Collection<MethodInfo> fromMethods(Method[] methods)
      Construct a list of method infos from a given array of methods.
      Parameters:
      methods - - array of methods.
      Returns:
      Method info list.
    • fromMethods

      public static List<MethodInfo> fromMethods(Collection<Method> methods)
      Construct a list of method infos from a given collection of methods.
      Parameters:
      methods - - list of methods.
      Returns:
      Method info list.
    • fromConstructor

      public static MethodInfo fromConstructor(Constructor<?> constructor)
      Wraps a constructor as a method information object.
      Parameters:
      constructor - - the constructor to wrap.
      Returns:
      A wrapped constructor.
    • fromConstructors

      public static Collection<MethodInfo> fromConstructors(Constructor<?>[] constructors)
      Construct a list of method infos from a given array of constructors.
      Parameters:
      constructors - - array of constructors.
      Returns:
      Method info list.
    • fromConstructors

      public static List<MethodInfo> fromConstructors(Collection<Constructor<?>> constructors)
      Construct a list of method infos from a given collection of constructors.
      Parameters:
      constructors - - list of constructors.
      Returns:
      Method info list.
    • toString

      public String toString()
      Returns a string describing this method or constructor
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.
      See Also:
    • toGenericString

      public abstract String toGenericString()
      Returns a string describing this method or constructor, including type parameters.
      Returns:
      A string describing this Method, include type parameters
      See Also:
    • getExceptionTypes

      public abstract Class<?>[] 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

      public abstract Class<?> getReturnType()
      Returns a Class object that represents the formal return type of the method or constructor represented by this MethodInfo object.

      This is always Void for constructors.

      Returns:
      The return value, or Void if a constructor.
      See Also:
    • getParameterTypes

      public abstract Class<?>[] 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.