Get the Java types of the arguments. @param args object array of argument values. @return class array of argument types.
( Object[] args )
| 136 | * @param args object array of argument values. |
| 137 | * @return class array of argument types. */ |
| 138 | public static Class<?>[] getTypes( Object[] args ) |
| 139 | { |
| 140 | if ( args == null ) |
| 141 | return new Class[0]; |
| 142 | |
| 143 | Class<?>[] types = new Class[ args.length ]; |
| 144 | |
| 145 | for( int i=0; i<args.length; i++ ) |
| 146 | { |
| 147 | if ( args[i] == null ) |
| 148 | types[i] = null; |
| 149 | else |
| 150 | if ( args[i] instanceof Primitive ) |
| 151 | types[i] = ((Primitive)args[i]).getType(); |
| 152 | else |
| 153 | types[i] = args[i].getClass(); |
| 154 | } |
| 155 | |
| 156 | return types; |
| 157 | } |
| 158 | |
| 159 | /** Find the type of an object. |
| 160 | * @param arg the object to query. |
no test coverage detected