Package jadex.common
Class MethodInfo
java.lang.Object
jadex.common.MethodInfo
All info for identifying a method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoaderThe classloader with which this info was loaded.protected StringCached class.protected MethodCached method.protected StringThe method name.protected ClassInfo[]The parameter classes. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new method info.MethodInfo(Method m) Create a new method info.MethodInfo(String name, ClassInfo[] parametertypes, String classname) Create a new method info.MethodInfo(String name, Class<?>[] parametertypes) Create a new method info. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if an object is equal to this.Gets the class name for retrieving the method.getMethod(ClassLoader cl) getName()Get the name.Get the name with parameters, e.g.Get the parametertypes.Class<?>[]Get the parametertypes as classes.Get the return type.inthashCode()Get the hashcode.voidsetClassName(String classname) Sets the class name for retrieving the method.voidSet the name.voidsetParameterTypeInfos(ClassInfo[] parametertypes) Set the parametertypes.voidsetParameterTypes(Class<?>[] parametertypes) Get the parametertypes as classes.voidsetReturnTypeInfo(ClassInfo returntype) Set the return type.toString()Get the string representation.
-
Field Details
-
name
The method name. -
parametertypes
The parameter classes. -
classname
Cached class. -
method
Cached method. -
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
Create a new method info. -
MethodInfo
Create a new method info. -
MethodInfo
Create a new method info.
-
-
Method Details
-
getName
Get the name.- Returns:
- the name.
-
setName
Set the name.- Parameters:
name- The name to set.
-
getParameterTypes
Get the parametertypes as classes.- Returns:
- the parametertypes.
-
setParameterTypes
Get the parametertypes as classes. -
getParameterTypeInfos
Get the parametertypes.- Returns:
- the parametertypes.
-
setParameterTypeInfos
Set the parametertypes.- Parameters:
parametertypes- The parametertypes to set.
-
getReturnTypeInfo
Get the return type.- Returns:
- The return type.
-
setReturnTypeInfo
Set the return type.- Parameters:
returntype- the returntype to set
-
setClassName
Sets the class name for retrieving the method.- Parameters:
classname- Name of the class.
-
getClassName
Gets the class name for retrieving the method. -
getMethod
-
hashCode
public int hashCode()Get the hashcode. -
equals
Test if an object is equal to this. -
toString
Get the string representation. -
getNameWithParameters
Get the name with parameters, e.g. method1(String, int) but without return type.
-