org.jvnet.hk2.component.classmodel
Class ClassPath

java.lang.Object
  extended by org.jvnet.hk2.component.classmodel.ClassPath

public abstract class ClassPath
extends java.lang.Object

Helper for creating classpath approximating SE behavior.

Since:
3.1
Author:
Jerome Dochez, Jeff Trent

Field Summary
 java.util.LinkedHashSet<java.lang.String> classPathEntries
           
 java.util.LinkedHashSet<java.lang.String> expandedClassPathEntries
           
 
Constructor Summary
protected ClassPath(boolean allowTestClassPath)
           
  ClassPath(java.util.Collection<java.io.File> classPath)
           
  ClassPath(java.lang.String classPath)
           
 
Method Summary
static ClassPath create(Habitat h, boolean allowTestClassPath)
          Creates a ClassPathHelper instance.
static ClassPath create(Habitat h, java.util.Collection<java.io.File> classPath)
           
static ClassPath create(Habitat h, java.lang.String classPath)
           
 boolean equals(java.lang.Object another)
           
 java.util.Set<java.lang.String> getEntries()
          Find all jars referenced directly and indirectly via a classpath specification typically drawn from java.class.path or surefire.test.class.path System properties.
 java.util.Set<java.io.File> getFileEntries()
           
 java.net.URL[] getRawURLs()
           
 int hashCode()
           
protected  void initialize(java.lang.String classPath)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

classPathEntries

public final java.util.LinkedHashSet<java.lang.String> classPathEntries

expandedClassPathEntries

public final java.util.LinkedHashSet<java.lang.String> expandedClassPathEntries
Constructor Detail

ClassPath

protected ClassPath(boolean allowTestClassPath)

ClassPath

public ClassPath(java.lang.String classPath)

ClassPath

public ClassPath(java.util.Collection<java.io.File> classPath)
Method Detail

create

public static ClassPath create(Habitat h,
                               boolean allowTestClassPath)
Creates a ClassPathHelper instance.

Parameters:
h - reserved for future use
allowTestClassPath - true if surefire.test.class.path is considered
Returns:
the ClassPathHelper

create

public static ClassPath create(Habitat h,
                               java.lang.String classPath)

create

public static ClassPath create(Habitat h,
                               java.util.Collection<java.io.File> classPath)

initialize

protected void initialize(java.lang.String classPath)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object another)
Overrides:
equals in class java.lang.Object

getEntries

public java.util.Set<java.lang.String> getEntries()
Find all jars referenced directly and indirectly via a classpath specification typically drawn from java.class.path or surefire.test.class.path System properties. This will attempt to expand all manifest classpath entries.

Returns:
the set of entries in the classpath

getFileEntries

public java.util.Set<java.io.File> getFileEntries()
See Also:
getEntries()

getRawURLs

public java.net.URL[] getRawURLs()
                          throws java.io.IOException
Returns:
the original classpath as specified (i.e., without transitive manifest dependencies)
Throws:
java.io.IOException


Copyright © 2011 Oracle Corporation. All Rights Reserved.