Package jadex.common
Class MethodInfo
java.lang.Object
jadex.common.MethodInfo
All info for identifying a method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoader
The classloader with which this info was loaded.protected String
Cached class.protected Method
Cached method.protected String
The 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 TypeMethodDescriptionboolean
Test 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.int
hashCode()
Get the hashcode.void
setClassName
(String classname) Sets the class name for retrieving the method.void
Set the name.void
setParameterTypeInfos
(ClassInfo[] parametertypes) Set the parametertypes.void
setParameterTypes
(Class<?>[] parametertypes) Get the parametertypes as classes.void
setReturnTypeInfo
(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.
-