类 Method

java.lang.Object
org.beetl.ow2.asm.commons.Method

public class Method extends Object
A named method descriptor.
作者:
Juozas Baliuka, Chris Nokleberg, Eric Bruneton
  • 构造器详细资料

    • Method

      public Method(String name, String desc)
      Creates a new Method.
      参数:
      name - the method's className.
      desc - the method's descriptor.
    • Method

      public Method(String name, Type returnType, Type[] argumentTypes)
      Creates a new Method.
      参数:
      name - the method's className.
      returnType - the method's return type.
      argumentTypes - the method's argument types.
  • 方法详细资料

    • getMethod

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

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

      public static Method getMethod(String method) throws IllegalArgumentException
      Returns a Method corresponding to the given Java method declaration.
      参数:
      method - a Java method declaration, without argument names, of the form "returnType className (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 className; all other classes names must be fully qualified.
      返回:
      a Method corresponding to the given Java method declaration.
      抛出:
      IllegalArgumentException - if method could not get parsed.
    • getMethod

      public static Method getMethod(String method, boolean defaultPackage) throws IllegalArgumentException
      Returns a Method corresponding to the given Java method declaration.
      参数:
      method - a Java method declaration, without argument names, of the form "returnType className (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 className, 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 Method corresponding to the given Java method declaration.
      抛出:
      IllegalArgumentException - if method could not get parsed.
    • getName

      public String getName()
      Returns the className of the method described by this object.
      返回:
      the className 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 o)
      覆盖:
      equals 在类中 Object
    • hashCode

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