Here you can find the source of getClassesFromPaths(String[] classpaths)
Parameter | Description |
---|---|
classpaths | The classpaths for the Class object array |
private static Class<?>[] getClassesFromPaths(String[] classpaths)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**/*w w w . j a v a2 s . co m*/ * Retrieves the Class object representations of the given String array * * @param classpaths * The classpaths for the Class object array **/ private static Class<?>[] getClassesFromPaths(String[] classpaths) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String classPath : classpaths) { try { classes.add(Class.forName(classPath)); } catch (ClassNotFoundException e) { // Discard Silently.... Let the signature test fail. } } return classes.toArray(new Class<?>[classes.size()]); } }