Package org.apache.cxf.common.util
Class ClasspathScanner
java.lang.Object
org.apache.cxf.common.util.ClasspathScanner
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Class<? extends Annotation>,
Collection<Class<?>>> findClasses
(String basePackage, Class<? extends Annotation>... annotations) Scans list of base packages for all classes marked with specific annotations.static Map<Class<? extends Annotation>,
Collection<Class<?>>> findClasses
(Collection<String> basePackages, Class<? extends Annotation>... annotations) Scans list of base packages for all classes marked with specific annotations.static Map<Class<? extends Annotation>,
Collection<Class<?>>> findClasses
(Collection<String> basePackages, List<Class<? extends Annotation>> annotations) Scans list of base packages for all classes marked with specific annotations.static Map<Class<? extends Annotation>,
Collection<Class<?>>> findClasses
(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) protected Map<Class<? extends Annotation>,
Collection<Class<?>>> findClassesInternal
(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) findResources
(String basePackage, String extension) Scans list of base packages for all resources with the given extension.findResources
(String basePackage, String extension, ClassLoader loader) Scans list of base packages for all resources with the given extension.findResources
(Collection<String> basePackages, String extension) Scans list of base packages for all resources with the given extension.findResources
(Collection<String> basePackages, String extension, ClassLoader loader) findResourcesInternal
(Collection<String> basePackages, String extension, ClassLoader loader) parsePackages
(String packagesAsCsv)
-
Field Details
-
ALL_FILES
- See Also:
-
ALL_CLASS_FILES
- See Also:
-
WILDCARD
- See Also:
-
CLASSPATH_URL_SCHEME
- See Also:
-
-
Constructor Details
-
ClasspathScanner
protected ClasspathScanner()
-
-
Method Details
-
findClasses
@SafeVarargs public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(String basePackage, Class<? extends Annotation>... annotations) throws IOException, ClassNotFoundException Scans list of base packages for all classes marked with specific annotations.- Parameters:
basePackage
- base packageannotations
- annotations to discover- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
IOException
- class metadata is not readableClassNotFoundException
- class not found
-
findClasses
@SafeVarargs public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, Class<? extends Annotation>... annotations) throws IOException, ClassNotFoundException Scans list of base packages for all classes marked with specific annotations.- Parameters:
basePackages
- list of base packagesannotations
- annotations to discover- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
IOException
- class metadata is not readableClassNotFoundException
- class not found
-
findClasses
public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, List<Class<? extends Annotation>> annotations) throws IOException, ClassNotFoundException Scans list of base packages for all classes marked with specific annotations.- Parameters:
basePackages
- list of base packagesannotations
- annotations to discover- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
IOException
- class metadata is not readableClassNotFoundException
- class not found
-
findClasses
public static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
findClassesInternal
protected Map<Class<? extends Annotation>,Collection<Class<?>>> findClassesInternal(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
findResources
Scans list of base packages for all resources with the given extension.- Parameters:
basePackage
- base packageextension
- the extension matching resources needs to have- Returns:
- list of all discovered resource URLs
- Throws:
IOException
- resource is not accessible
-
findResources
public static List<URL> findResources(String basePackage, String extension, ClassLoader loader) throws IOException Scans list of base packages for all resources with the given extension.- Parameters:
basePackage
- base packageextension
- the extension matching resources needs to have- Returns:
- list of all discovered resource URLs
- Throws:
IOException
- resource is not accessible
-
findResources
public static List<URL> findResources(Collection<String> basePackages, String extension) throws IOException Scans list of base packages for all resources with the given extension.- Parameters:
basePackages
- list of base packagesextension
- the extension matching resources needs to have- Returns:
- list of all discovered resource URLs
- Throws:
IOException
- resource is not accessible
-
findResources
public static List<URL> findResources(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException - Throws:
IOException
-
parsePackages
-
findResourcesInternal
protected List<URL> findResourcesInternal(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException - Throws:
IOException
-