|
|||||||||
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 |
classnameSources
Table of SourceSource objects, keyed by the classname. |
protected Session |
owningSession
Session that owns us. |
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. |
protected java.lang.String |
classnameToFilename(java.lang.String classname)
Turn the package name into a file path using simple character subsitution. |
java.lang.String[] |
getClassPath()
Returns the array of classpath directories, if any. |
java.lang.String |
getClassPathAsString()
Returns the classpath as a String. |
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. |
SourceSource |
mapClass(com.sun.jdi.ReferenceType clazz)
Searches for the .class file of the given class and returns a SourceSource representing that .class file. |
SourceSource |
mapSource(com.sun.jdi.ReferenceType clazz)
Return a SourceSource corresponding to the given class. |
SourceSource |
mapSource(java.lang.String classname)
Return a SourceSource corresponding to the fully-qualified class name. |
protected SourceSource |
mapSource0(java.lang.String path,
java.lang.String filename)
Look for the file in the given class or sourcepath entry. |
protected SourceSource |
mapSourceLow(java.lang.String filename,
java.lang.String classname)
Looks for a matching entry in either the classpath or sourcepath. |
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.util.Hashtable classnameSources
Constructor Detail |
public PathManager()
Method Detail |
public void activate(Session session)
activate
in class DefaultManager
session
- Session being activated.protected java.lang.String classnameToFilename(java.lang.String classname)
classname
- fully-qualified name of the class, possibly
including an inner-class specification.public java.lang.String[] getClassPath()
public java.lang.String getClassPathAsString()
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 SourceSource mapClass(com.sun.jdi.ReferenceType clazz)
clazz
- class for which to find class file.public SourceSource mapSource(java.lang.String classname) throws java.io.IOException
classname
- fully-qualified class name.java.io.IOException
- Thrown if an I/O error occurred.public SourceSource mapSource(com.sun.jdi.ReferenceType clazz) throws java.io.IOException
clazz
- class for which to find source file.java.io.IOException
- Thrown if an I/O error occurred.protected SourceSource mapSourceLow(java.lang.String filename, java.lang.String classname)
filename
- name of file to look for.classname
- name of class for caching result.protected SourceSource mapSource0(java.lang.String path, java.lang.String filename)
path
- source or classpath entry.filename
- name of file to look for.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 |