Package jadex.common

Class MethodInfo

java.lang.Object
jadex.common.MethodInfo

public class MethodInfo extends Object
All info for identifying a method.
  • Field Details

    • name

      protected String name
      The method name.
    • parametertypes

      protected ClassInfo[] parametertypes
      The parameter classes.
    • classname

      protected String classname
      Cached class.
    • method

      protected Method method
      Cached method.
    • classloader

      protected ClassLoader classloader
      The classloader with which this info was loaded. Note 1: This must not be the same as method.getClass().getClassLoader() because the latter returns the loader responsible for the class which could be higher in the parent hierarchy. Note 2: The check current_cl==last_cl is not perfect because when invoked with a parent classloader it will reload the class (although not necessary)
  • Constructor Details

    • MethodInfo

      public MethodInfo()
      Create a new method info.
    • MethodInfo

      public MethodInfo(Method m)
      Create a new method info.
    • MethodInfo

      public MethodInfo(String name, Class<?>[] parametertypes)
      Create a new method info.
    • MethodInfo

      public MethodInfo(String name, ClassInfo[] parametertypes, String classname)
      Create a new method info.
  • Method Details

    • getName

      public String getName()
      Get the name.
      Returns:
      the name.
    • setName

      public void setName(String name)
      Set the name.
      Parameters:
      name - The name to set.
    • getParameterTypes

      public Class<?>[] getParameterTypes(ClassLoader cl)
      Get the parametertypes as classes.
      Returns:
      the parametertypes.
    • setParameterTypes

      public void setParameterTypes(Class<?>[] parametertypes)
      Get the parametertypes as classes.
    • getParameterTypeInfos

      public ClassInfo[] getParameterTypeInfos()
      Get the parametertypes.
      Returns:
      the parametertypes.
    • setParameterTypeInfos

      public void setParameterTypeInfos(ClassInfo[] parametertypes)
      Set the parametertypes.
      Parameters:
      parametertypes - The parametertypes to set.
    • getReturnTypeInfo

      public ClassInfo getReturnTypeInfo()
      Get the return type.
      Returns:
      The return type.
    • setReturnTypeInfo

      public void setReturnTypeInfo(ClassInfo returntype)
      Set the return type.
      Parameters:
      returntype - the returntype to set
    • setClassName

      public void setClassName(String classname)
      Sets the class name for retrieving the method.
      Parameters:
      classname - Name of the class.
    • getClassName

      public String getClassName()
      Gets the class name for retrieving the method.
    • getMethod

      public Method getMethod(ClassLoader cl)
    • hashCode

      public int hashCode()
      Get the hashcode.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Test if an object is equal to this.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Get the string representation.
      Overrides:
      toString in class Object
    • getNameWithParameters

      public String getNameWithParameters()
      Get the name with parameters, e.g. method1(String, int) but without return type.