Java Class Load getClassesFromPaths(String[] classpaths)

Here you can find the source of getClassesFromPaths(String[] classpaths)

Description

Retrieves the Class object representations of the given String array

License

Open Source License

Parameter

Parameter Description
classpaths The classpaths for the Class object array

Declaration

private static Class<?>[] getClassesFromPaths(String[] classpaths) 

Method Source Code

//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()]);
    }
}

Related

  1. getClassDescriptor(Class type)
  2. getClasses(Class infoClass)
  3. getClasses(Class t)
  4. getClasses(Object... objects)
  5. getClasses(String input)
  6. getClassesOfType(T[] l, Class type)
  7. getClassesTree(Class clazz)
  8. getClassForDomain(String domain)
  9. getClassFQNString(Class clazz, StringBuilder sb)