commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject [lang] Extension to ClassUtils
Date Thu, 02 Aug 2007 19:40:49 GMT

for some tasks related to reflection and method invocation I need the 
counter part of the ClassUtils.primitiveToWrapper() method:

  * Returns the corresponding primitive type if cls is a wrapper
  * class and null otherwise.
Class wrapperToPrimitive(Class cls)

If this is considered a useful extension to ClassUtils, I can provide a 
patch and unit tests.

My use case is that I need to invoke a method, and I only have the name 
and an array of parameter values (not the exact parameter types). So I 
have to check based on the types of the current parameters if a method 
signature is compatible. If the signature contains primitive types, the 
current parameter values will be wrapper types; these have to be unboxed.

Does this make sense?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message