KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > deployment > plugins > api > OldJSPDebug


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.deployment.plugins.api;
21
22 import java.io.IOException JavaDoc;
23 import java.util.Map JavaDoc;
24 import javax.enterprise.deploy.spi.TargetModuleID JavaDoc;
25
26 /** This interface should be implemented by plugins that want to support JSP
27  * source level debugging, but do not support JSR 45.
28  * The prerequisite for the JSP debugging support (without JSR 45) is the support
29  * for finding a generated servlet, represented by the FindJSPServlet interface.
30  *
31  * @author Petr Jiricka
32  */

33 public interface OldJSPDebug extends FindJSPServlet {
34
35     /** Creates a servlet <-> JSP mapping for a given JSP. May be null if the server is not running
36      * or the page has not been compiled. Also may be null if the server plugin does not support
37      * creation of the line mapping information.
38      * @param module web module in which the JSP is located.
39      * @param jspResourcePath the path of the JSP for which the mapping is requested, e.g.
40      * "pages/login.jsp". Never starts with a '/'.
41      * @return JspSourceMapper for this JSP.
42      */

43     public JspSourceMapper getSourceMapper(TargetModuleID JavaDoc module, String JavaDoc jspResourcePath);
44     
45     /** Provides common interface for JSP <----> Java mappings */
46     public interface JspSourceMapper {
47         
48         /** Converts the JSP file name (from the string int the servlet comments into
49          * the Forte4J resource name)
50          */

51         public interface NameConverter {
52             /** Converts the JSP name (from the string int the servlet comments into
53              * the Forte4J resource name)
54              *@param name - JSP name to convert
55              */

56             String JavaDoc convert(String JavaDoc name) throws IOException JavaDoc;
57         }
58         
59         /**
60          * Get the value of primaryJspFileName.
61          * @return Value of primaryJspFileName.
62          */

63         String JavaDoc getPrimaryJspFileName();
64         
65         /**
66          * Set the value of primaryJspFileName.
67          * @param v Value to assign to primaryJspFileName.
68          */

69         public void setPrimaryJspFileName(String JavaDoc v);
70         
71         /**
72          * Returns the number of entries in this source mapper. This number is 0, if no entries were made.
73          * @return The number of entries in this source mapper. This number is 0, if no entries were made.
74          */

75         int size();
76         
77         /**
78          * Returns whether the JSP page is empty
79          * @return Whether the JSP page is empty
80          */

81         boolean isEmpty();
82         
83         
84         /* *
85          * Converts a position in the JAVA_CODE to a JSP_CODE range.
86          * @param jspFileName JSP file name to get forward mapping for
87          * @param range Range to convert
88
89         // Range javaToJsp(String jspFile, Position position );
90
91         /* *
92          * Convert a range in the JSP_CODE to a JAVA_CODE range.
93          * @param jspFileName JSP file name to get forward mapping for
94          * @param range Range to convert
95          */

96         
97         // Range jspToJava(String jspFile, Range range);
98

99         /**
100          * Returns Java Servlet line number for the given line number of the primary (not "included") JSP file
101          * @param line unmangled (JSP) line number
102          * @return The mangled (Servlet) line number
103          */

104         int mangle(int line);
105         
106         /**
107          * Returns Java Servlet line number for the given line/column number of the primary (not "included") JSP file
108          * @param line unmangled (JSP) line number
109          * @param col unmangled (JSP) column number
110          * @return The mangled (Servlet) line number
111          */

112         int mangle(int line, int col);
113         
114         /**
115          * Returns Java Servlet line number for the given line number of the given JSP
116          * @param jspFile
117          */

118         int mangle(String JavaDoc jspFile, int line);
119         
120         /**
121          * Returns Java Servlet line/column number for the given line number of the given JSP
122          * @param jspFileName Name of the JSP file to map
123          * @param line unmangled (JSP) line number
124          * @param col unmangled (JSP) column number
125          * @return The mangled (Servlet) line number
126          */

127         int mangle(String JavaDoc jspFileName, int line, int col);
128         
129         /**
130          * Returns primary (not "included") JSP file line number for the given line number in the generated Java Servlet
131          * @param line mangled (Servlet) line number
132          * @return The unmangled (JSP) line number
133          */

134         int unmangle(int line);
135         
136         /**
137          * Returns primary (not "included") JSP file line/column number for the given line number
138          * in the generated Java Servlet
139          * @param line mangled (Servlet) line number
140          * @param col mangled (Servlet) column number
141          * @return The unmangled (JSP) line number
142          */

143         int unmangle(int line, int col);
144         
145         /**
146          * Returns JSP file line/column number for the given line number in the generated Java Servlet
147          * @param jspFileName JSP file name
148          * @param line mangled (Servlet) line number
149          * @param col mangled (Servlet) column number
150          * @return The unmangled (JSP) line number
151          */

152         int unmangle(String JavaDoc jspFileName, int line, int col);
153         
154         /**
155          * Returns the type of the generated Servlet line/column
156          * @param line mangled (Servlet) line number
157          * @param col mangled (Servlet) column number
158          * @return The type of the generated Servlet line/column
159          */

160         String JavaDoc getJavaLineType(int line, int col);
161         
162         /**
163          * Returns the JSP file name for the given line/column in the generated Servlet
164          * @param line mangled (Servlet) line number
165          * @param col mangled (Servlet) column number
166          * @return The JSP file name for the given line/column in the generated Servlet
167          */

168         public String JavaDoc getJspFileName(int line, int col) throws IOException JavaDoc;
169         
170         
171         /**
172          * Returns whether the giver Servlet line/column is a part of dynamic (Java) code in the JSP page
173          * @param line mangled (Servlet) line number
174          * @param col mangled (Servlet) column number
175          * @return Whether the giver Servlet line/column is a part of dynamic (Java) code in the JSP page
176          */

177         boolean isJavaCodeInJspPage(int line, int col);
178         
179         /** @return a Map of all JSP file names comprising the generated Java servlet */
180         Map JavaDoc getFileNames();
181         
182         /**
183          * Returns whether the primary JSP page has included files (HTML, JSP etc)
184          *@return Whether the primary JSP page has included files (HTML, JSP etc)
185          */

186         public boolean hasIncludeFiles();
187         
188         /**
189          * Returns whether the given name is a proper JSP file name
190          * @param name given name
191          *@return whether the given name is a proper JSP file name
192          */

193         public boolean isProperJspFileName(String JavaDoc name);
194     }
195     
196 }
197
Popular Tags