Class ReflectionUtils
java.lang.Object
madkit.reflection.ReflectionUtils
Utilities for finding method references in Agent classes.
- Since:
- 6.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>[]
convertArgToTypes
(Object[] parameters) Converts the primitive types in the array to their corresponding wrapper classes.enumToMethodName
(E e) Converts the name of an enum object to a Java standardized method name.static String
getSignature
(String methodName, Class<?>... types) Converts a signature to its string representation.
-
Method Details
-
enumToMethodName
Converts the name of an enum object to a Java standardized method name. For instance, using this onAgentAction.LAUNCH_AGENT
will returnlaunchAgent
. It is especially used byAgentAction
to createAction
s that reflexively call the methods of an agent or send a message to it. SeeAgent.handleRequestActionMessage(madkit.action.RequestActionMessage)
- Type Parameters:
E
- enum type- Parameters:
e
- the enum object to convert- Returns:
- a string having a Java standardized method name form.
-
getSignature
Converts a signature to its string representation. This is used byMethodFinder
to store the signature of methods in a map.- Parameters:
methodName
- the name of the methodtypes
- the types of the arguments of the method- Returns:
- a string representation of the signature
-
convertArgToTypes
-