ch.jm.osgi.util.bundle 1.0.0

ch.jm.osgi.util.bundle
Class DependencyAnalyzer

java.lang.Object
  extended by ch.jm.osgi.util.bundle.DependencyAnalyzer

public class DependencyAnalyzer
extends java.lang.Object

This class analyzes dependencies of a set of classes.


Constructor Summary
DependencyAnalyzer()
           
 
Method Summary
 java.util.Set<java.lang.String> getLocalPackages()
          Returns the set of own package names, i.e.
 java.util.Set<java.lang.String> getUsedPackages()
          Retrieves the combined set of accumulated used/external packages.
 java.util.Set<java.lang.String> getUsedPackages(java.lang.String packageName)
          Retrieves the accumulated used/external packages for a given package.
 void scanClasses(java.io.File classesDir)
          Scans a directory containing compiled class files.
 void scanClassPath(java.util.Collection<java.io.File> classPath)
          Scans the given classpath.
 void scanJAR(java.io.File jar)
          Scans a JAR file.
 void scanJarEntry(java.util.jar.JarFile jar, java.util.jar.JarEntry e)
          Scans a particular entry in a JAR file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyAnalyzer

public DependencyAnalyzer()
Method Detail

scanClassPath

public void scanClassPath(java.util.Collection<java.io.File> classPath)
                   throws java.io.IOException
Scans the given classpath. The File instances passed in can be directories containing ".class" files or JAR files.

Parameters:
classPath - the classpath to scan
Throws:
java.io.IOException - if an I/O error occurs

scanJarEntry

public void scanJarEntry(java.util.jar.JarFile jar,
                         java.util.jar.JarEntry e)
                  throws java.io.IOException
Scans a particular entry in a JAR file.

Parameters:
jar - the JAR file
e - the entry to scan
Throws:
java.io.IOException - if an I/O error occurs

scanJAR

public void scanJAR(java.io.File jar)
             throws java.io.IOException
Scans a JAR file.

Parameters:
jar - the JAR file to scan
Throws:
java.io.IOException - if an I/O error occurs

scanClasses

public void scanClasses(java.io.File classesDir)
                 throws java.io.IOException
Scans a directory containing compiled class files.

Parameters:
classesDir - the directory
Throws:
java.io.IOException - if an I/O error occurs

getUsedPackages

public java.util.Set<java.lang.String> getUsedPackages(java.lang.String packageName)
Retrieves the accumulated used/external packages for a given package.

Parameters:
packageName - the package name
Returns:
the set of references external packages

getUsedPackages

public java.util.Set<java.lang.String> getUsedPackages()
Retrieves the combined set of accumulated used/external packages.

Returns:
the used packages

getLocalPackages

public java.util.Set<java.lang.String> getLocalPackages()
Returns the set of own package names, i.e. the packages of the classes that have been scanned.

Returns:
the own package names

ch.jm.osgi.util.bundle 1.0.0

Copyright 2009-2010 Jeremias M?rki. All Rights Reserved.