类 MethodSignature

java.lang.Object
cn.taketoday.bytecode.commons.MethodSignature

public class MethodSignature extends Object
A named method descriptor.

A representation of a method signature, containing the method name, return type, and parameter types.

作者:
Juozas Baliuka, Chris Nokleberg, Eric Bruneton, TODAY
  • 字段详细资料

  • 构造器详细资料

    • MethodSignature

      public MethodSignature(String name, String descriptor)
      Constructs a new MethodSignature.
      参数:
      name - the method's name.
      descriptor - the method's descriptor.
    • MethodSignature

      public MethodSignature(Type returnType, String name, Type... argumentTypes)
      Constructs a new MethodSignature.
      参数:
      name - the method's name.
      returnType - the method's return type.
      argumentTypes - the method's argument types.
      从以下版本开始:
      4.0
  • 方法详细资料

    • from

      public static MethodSignature from(Method method)
      Creates a new MethodSignature.
      参数:
      method - a java.lang.reflect method descriptor
      返回:
      a MethodSignature corresponding to the given Java method declaration.
    • from

      public static MethodSignature from(Constructor<?> constructor)
      Creates a new MethodSignature.
      参数:
      constructor - a java.lang.reflect constructor descriptor
      返回:
      a MethodSignature corresponding to the given Java constructor declaration.
    • from

      public static MethodSignature from(Member member)
      从以下版本开始:
      4.0
    • forConstructor

      public static MethodSignature forConstructor(String parameterTypes)
      参数:
      parameterTypes - a Java parameterTypes name.
      返回:
      Constructor Signature
      从以下版本开始:
      4.0
      另请参阅:
    • forConstructor

      public static MethodSignature forConstructor(Type... parameterTypes)
      参数:
      parameterTypes - a Java parameterTypes.
      返回:
      Constructor Signature
      从以下版本开始:
      4.0
      另请参阅:
    • from

      public static MethodSignature from(String method)
      Returns a MethodSignature corresponding to the given Java method declaration.
      参数:
      method - a Java method declaration, without argument names, of the form "returnType name (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int", "float", "java.util.List", ...). Classes of the java.lang package can be specified by their unqualified name; all other classes names must be fully qualified.
      返回:
      a MethodSignature corresponding to the given Java method declaration.
      抛出:
      IllegalArgumentException - if method could not get parsed.
    • from

      public static MethodSignature from(String method, boolean defaultPackage)
      Returns a MethodSignature corresponding to the given Java method declaration.
      参数:
      method - a Java method declaration, without argument names, of the form "returnType name (argumentType1, ... argumentTypeN)", where the types are in plain Java (e.g. "int", "float", "java.util.List", ...). Classes of the java.lang package may be specified by their unqualified name, depending on the defaultPackage argument; all other classes names must be fully qualified.
      defaultPackage - true if unqualified class names belong to the default package, or false if they correspond to java.lang classes. For instance "Object" means "Object" if this option is true, or "java.lang.Object" otherwise.
      返回:
      a MethodSignature corresponding to the given Java method declaration.
      抛出:
      IllegalArgumentException - if method could not get parsed.
    • getName

      public String getName()
      Returns the name of the method described by this object.
      返回:
      the name of the method described by this object.
    • getDescriptor

      public String getDescriptor()
      Returns the descriptor of the method described by this object.
      返回:
      the descriptor of the method described by this object.
    • getReturnType

      public Type getReturnType()
      Returns the return type of the method described by this object.
      返回:
      the return type of the method described by this object.
    • getArgumentTypes

      public Type[] getArgumentTypes()
      Returns the argument types of the method described by this object.
      返回:
      the argument types of the method described by this object.
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • equals

      public boolean equals(Object other)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object