Converts an array of Class names to Class types. @param s The array of class names @return An array of Class instance where the element at index i in the result is an instance of the class with the name at index i in the input @throws ClassNotFoundException If a class of a given name
(String[] s)
| 105 | * @throws ClassNotFoundException If a class of a given name cannot be found |
| 106 | */ |
| 107 | public static Class<?>[] toTypeArray(String[] s) throws ClassNotFoundException { |
| 108 | if (s == null) { |
| 109 | return null; |
| 110 | } |
| 111 | Class<?>[] c = new Class[s.length]; |
| 112 | for (int i = 0; i < s.length; i++) { |
| 113 | c[i] = forName(s[i]); |
| 114 | } |
| 115 | return c; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Converts an array of Class types to Class names. |
no test coverage detected