Package org.apache.cxf.common.util
Class ClasspathScanner
java.lang.Object
org.apache.cxf.common.util.ClasspathScanner
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
ClasspathScannerprotected 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 package
- annotations- annotations to discover
- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
- IOException- class metadata is not readable
- ClassNotFoundException- 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 packages
- annotations- annotations to discover
- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
- IOException- class metadata is not readable
- ClassNotFoundException- class not found
 
- 
findClassespublic 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 packages
- annotations- annotations to discover
- Returns:
- all discovered classes grouped by annotations they belong too
- Throws:
- IOException- class metadata is not readable
- ClassNotFoundException- class not found
 
- 
findClassespublic static Map<Class<? extends Annotation>,Collection<Class<?>>> findClasses(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException - Throws:
- IOException
- ClassNotFoundException
 
- 
findClassesInternalprotected Map<Class<? extends Annotation>,Collection<Class<?>>> findClassesInternal(Collection<String> basePackages, List<Class<? extends Annotation>> annotations, ClassLoader loader) throws IOException, ClassNotFoundException - Throws:
- IOException
- ClassNotFoundException
 
- 
findResourcesScans list of base packages for all resources with the given extension.- Parameters:
- basePackage- base package
- extension- the extension matching resources needs to have
- Returns:
- list of all discovered resource URLs
- Throws:
- IOException- resource is not accessible
 
- 
findResourcespublic 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 package
- extension- the extension matching resources needs to have
- Returns:
- list of all discovered resource URLs
- Throws:
- IOException- resource is not accessible
 
- 
findResourcespublic 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 packages
- extension- the extension matching resources needs to have
- Returns:
- list of all discovered resource URLs
- Throws:
- IOException- resource is not accessible
 
- 
findResourcespublic static List<URL> findResources(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException - Throws:
- IOException
 
- 
parsePackages
- 
findResourcesInternalprotected List<URL> findResourcesInternal(Collection<String> basePackages, String extension, ClassLoader loader) throws IOException - Throws:
- IOException
 
 
-