|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bluemarsh.jswat.DefaultManager | +--com.bluemarsh.jswat.PathManager
Class PathManager is responsible for managing the classpath and sourcepath. It uses a given classpath and sourcepath, along with class names and package names to find source files for requested classes. If both a classpath and sourcepath are provided, the path manager will search both to find a source file, searching the sourcepath first.
Field Summary | |
protected java.util.Hashtable |
classnameFiles
Table of File objects, keyed by the classname. |
protected java.lang.String[] |
classpathArray
List of classpath directories where we might find source code. |
protected Session |
owningSession
Session that owns us. |
protected java.lang.String[] |
sourcepathArray
List of directories where we might find source code. |
Fields inherited from class com.bluemarsh.jswat.DefaultManager |
swat |
Constructor Summary | |
PathManager()
Constructs a PathManager object. |
Method Summary | |
void |
activate(Session session)
Called when the Session is about to begin an active debugging session. |
java.lang.String[] |
getClassPath()
Returns the array of classpath directories, if any. |
java.lang.String |
getClassPathAsString()
Returns the classpath as a String. |
protected java.util.List |
getClassPathFromVM()
Gets the classpath from the running VM. |
java.lang.String[] |
getSourcePath()
Returns the array of sourcepath directories, if any. |
java.lang.String |
getSourcePathAsString()
Returns the sourcepath as a String. |
void |
init(Session session)
Called after the Session has instantiated this mananger. |
java.lang.String |
mapClassName(java.io.File source)
Return the fully-qualified classname corresponding to the given source file. |
protected java.lang.String |
mapClassNameLow(java.lang.String[] pathlist,
java.lang.String fpath)
Looks through the given path list, comparing each entry with the given fpath. |
java.io.File |
mapSourceFile(com.sun.jdi.ReferenceType clazz)
Return a File corresponding to the given class. |
java.io.File |
mapSourceFile(java.lang.String classname)
Return a File corresponding to the fully-qualified class name. |
protected java.io.File |
mapSourceFileLow(java.lang.String filename,
java.lang.String classname)
Looks for a matching entry in either the class path or source path. |
void |
setClassPath(java.util.List list)
Sets the classpath this source manager uses. |
void |
setClassPath(java.lang.String classpath)
Sets the classpath this source manager uses. |
void |
setSourcePath(java.lang.String sourcepath)
Sets the sourcepath this source manager uses. |
Methods inherited from class com.bluemarsh.jswat.DefaultManager |
close, deactivate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Session owningSession
protected java.lang.String[] classpathArray
protected java.lang.String[] sourcepathArray
protected java.util.Hashtable classnameFiles
Constructor Detail |
public PathManager()
Method Detail |
public void activate(Session session)
activate
in class DefaultManager
session
- Session being activated.public java.lang.String[] getClassPath()
public java.lang.String getClassPathAsString()
protected java.util.List getClassPathFromVM()
PathSearchingVirtualMachine
. Otherwise, it
returns the classpath of the VM running JSwat.public java.lang.String[] getSourcePath()
public java.lang.String getSourcePathAsString()
public void init(Session session)
Session.getManager()
.init
in class DefaultManager
session
- Session initializing this manager.public java.lang.String mapClassName(java.io.File source)
source
- source file containing class.protected java.lang.String mapClassNameLow(java.lang.String[] pathlist, java.lang.String fpath) throws java.io.IOException
pathlist
- List of paths.fpath
- File path to look for.java.io.IOException
- Thrown if File.getCanonicalPath() has a problem.public java.io.File mapSourceFile(java.lang.String classname) throws java.io.IOException
classname
- fully-qualified class name.java.io.IOException
- Thrown if File.getCanonicalPath() has a problem.public java.io.File mapSourceFile(com.sun.jdi.ReferenceType clazz) throws java.io.IOException
clazz
- class for which to find source file.java.io.IOException
- Thrown if File.getCanonicalPath() has a problem.protected java.io.File mapSourceFileLow(java.lang.String filename, java.lang.String classname)
filename
- name of file to look for.classname
- name of class for caching result.public void setClassPath(java.lang.String classpath)
classpath
- Classpath for VM.public void setClassPath(java.util.List list)
list
- List of String classpath entries.public void setSourcePath(java.lang.String sourcepath)
sourcepath
- Sourcepath for VM.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |