|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.jbuilder.runtime.jsp.JspSourceBridge
The JspSourceBridge is used by the debugger to translate JSP file names and line numbers into their Java equivalents and vice versa. The translation is JSP engine-specific; subclasses must implement the particulars for the server they support.
JPDA produces a Java file name with no path, so the fully-qualified class name is also needed to uniquely identify the file. Together, these two values form what is referred to in this class as a "Java path"; e.g. "com/whatever/Jsp1.java". Note that this is not a valid absolute path, which is needed to reference the actual generated Java file for translation.
The forward slash is used for all path separators.
Field Summary | |
protected ServerDescriptor |
descriptor
|
protected JBProject |
project
|
static int |
UNMAPPED_LINE
|
Constructor Summary | |
JspSourceBridge(JBProject jbProject,
ServerDescriptor serverDescriptor)
|
Method Summary | |
protected abstract java.lang.String |
deriveJavaPattern(java.lang.String jspFile)
Returns JSP engine-specific Java class name for a given JSP file. |
protected abstract java.lang.String |
deriveJspFile(java.lang.String className,
java.lang.String javaFile)
Returns JSP file, which is probably somewhere in the project tree, that generated a given Java class in a given Java file. |
void |
foundJspFile(Url jspUrl,
java.lang.String className,
java.lang.String javaFile)
Callback method for debugger when it encounters a Java class in a file that (it thinks) matches a JSP file being debugged (one with a line breakpoint). |
Url |
getJavaFile(java.lang.String className,
java.lang.String javaFile)
Given a Java class name and source file generated for a JSP, returns a URL for the actual location of that file, if it exists. |
int |
getJavaLine(Url jspUrl,
int jspLine)
Given a JSP file and line number in that file, returns the corresponding line number in the generated Java file. |
java.lang.String |
getJavaPattern(Url jspUrl)
Given a URL for a JSP file, returns a pattern to match the fully-qualified generated class name, with as much detail as possible; at a minimum it must include the actual package name. |
Url |
getJspFile(java.lang.String className,
java.lang.String javaFile)
Given a Java class name and source file, returns a URL for the JSP file that generated that Java class, if that class is from a JSP. |
int |
getJspLine(java.lang.String className,
java.lang.String javaFile,
int javaLine)
Given a Java class name, source file, and line number in that file, returns the corresponding line number in the JSP that generated the class. |
int[] |
getJspLines(java.lang.String className,
java.lang.String javaFile,
int[] javaLines)
Given a Java class name, source file, and lines number in that file, returns the corresponding lines number in the JSP that generated the class. |
protected abstract java.lang.String |
locateJavaFile(java.lang.String className,
java.lang.String javaFile)
Returns the actual location of the given generated-for-JSP Java file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNMAPPED_LINE
protected JBProject project
protected ServerDescriptor descriptor
Constructor Detail |
public JspSourceBridge(JBProject jbProject, ServerDescriptor serverDescriptor)
Method Detail |
protected abstract java.lang.String deriveJavaPattern(java.lang.String jspFile)
jspFile
- absolute path of JSP fileprotected abstract java.lang.String deriveJspFile(java.lang.String className, java.lang.String javaFile)
className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)protected abstract java.lang.String locateJavaFile(java.lang.String className, java.lang.String javaFile)
c:/MyJava/myproject/work/localhost_8080/myproject_Jsp1.java
.
Note that the className parameter may not be needed.className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)public java.lang.String getJavaPattern(Url jspUrl)
com.this.that.whatever.*NameOfJspFile*
-- but
such a pattern should differentiate between a JSP file and a similarly
named bean -- e.g. the classes for Jsp1.jsp and Jsp1Bean.java -- if the
JSP engine happens to generate JSPs in the same package as the bean (Tomcat
does not do this).
This pattern is used by the debugger to request notification from JPDA when a class that looks like one for the JSP is prepared.
jspUrl
- Url object that references JSP filepublic void foundJspFile(Url jspUrl, java.lang.String className, java.lang.String javaFile)
Only the first association between a particular Java file and JSP is recorded. Subsequent calls for the same Java file are ignored.
jspUrl
- Url object that references JSP fileclassName
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)getJspFile(java.lang.String, java.lang.String)
public Url getJspFile(java.lang.String className, java.lang.String javaFile)
This method is called by the debugger when it encounters a new class during debugging, after it determined that it is not a plain Java class in the project or one of the project's libraries.
className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)foundJspFile(com.borland.primetime.vfs.Url, java.lang.String, java.lang.String)
public Url getJavaFile(java.lang.String className, java.lang.String javaFile)
className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)public int getJspLine(java.lang.String className, java.lang.String javaFile, int javaLine)
className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)javaLine
- line number in Java filepublic int[] getJspLines(java.lang.String className, java.lang.String javaFile, int[] javaLines)
className
- fully-qualified class name (possibly inner class)javaFile
- name of Java file that contains the class (no path)javaLine
- lines number in Java filepublic int getJavaLine(Url jspUrl, int jspLine)
jspUrl
- Url object that references JSP filejspLine
- line number in JSP file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |