Changing the wrapper class to its primitive type.

ENTERPRISE JAVA
Invoke Servlet Methods From Java Apps

David Tayouri
Listing 4. Changing the wrapper class to its primitive type.


if (paramTypes[i] ==
  Class.forName("java.lang.Boolean"))
	  paramTypes[i] = Boolean.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Short"))
	  paramTypes[i] = Short.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Integer"))
	  paramTypes[i] = Integer.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Long"))
	  paramTypes[i] = Long.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Float"))
	  paramTypes[i] = Float.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Double"))
	  paramTypes[i] = Double.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Byte"))
	  paramTypes[i] = Byte.TYPE;
else if (paramTypes[i] ==
  Class.forName("java.lang.Character"))
	  paramTypes[i] = Character.TYPE;

Featured

Upcoming Events

AppTrends

Sign up for our newsletter.

I agree to this site's Privacy Policy.