Package org.apache.jasper.compiler
Class SmapStratum
- java.lang.Object
-
- org.apache.jasper.compiler.SmapStratum
-
public class SmapStratum extends java.lang.Object
Represents the line and file mappings associated with a JSR-045 "stratum".- Author:
- Jayson Falkner, Shawn Bayern
-
-
Constructor Summary
Constructors Constructor Description SmapStratum()
Constructs a new SmapStratum object with the stratum name JSP.SmapStratum(java.lang.String stratumName)
Deprecated.Use the no-arg constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addFile(java.lang.String filename)
Adds record of a new file, by filename.void
addFile(java.lang.String filename, java.lang.String filePath)
Adds record of a new file, by filename and path.void
addLineData(int inputStartLine, java.lang.String inputFileName, int inputLineCount, int outputStartLine, int outputLineIncrement)
Adds complete information about a simple line mapping.java.lang.String
getStratumName()
Deprecated.Unused.java.lang.String
getString()
void
optimizeLineSection()
Combines consecutive LineInfos wherever possiblejava.lang.String
toString()
-
-
-
Constructor Detail
-
SmapStratum
public SmapStratum()
Constructs a new SmapStratum object with the stratum name JSP.
-
SmapStratum
@Deprecated public SmapStratum(java.lang.String stratumName)
Deprecated.Use the no-arg constructorConstructs a new SmapStratum object for the given stratum name (e.g., JSP).- Parameters:
stratumName
- the name of the stratum (e.g., JSP)
-
-
Method Detail
-
addFile
public void addFile(java.lang.String filename)
Adds record of a new file, by filename.- Parameters:
filename
- the filename to add, unqualified by path.
-
addFile
public void addFile(java.lang.String filename, java.lang.String filePath)
Adds record of a new file, by filename and path. The path may be relative to a source compilation path.- Parameters:
filename
- the filename to add, unqualified by pathfilePath
- the path for the filename, potentially relative to a source compilation path
-
optimizeLineSection
public void optimizeLineSection()
Combines consecutive LineInfos wherever possible
-
addLineData
public void addLineData(int inputStartLine, java.lang.String inputFileName, int inputLineCount, int outputStartLine, int outputLineIncrement)
Adds complete information about a simple line mapping. Specify all the fields in this method; the back-end machinery takes care of printing only those that are necessary in the final SMAP. (My view is that fields are optional primarily for spatial efficiency, not for programmer convenience. Could always add utility methods later.)- Parameters:
inputStartLine
- starting line in the source file (SMAPInputStartLine
)inputFileName
- the filepath (or name) from which the input comes (yields SMAPLineFileID
) Use unqualified names carefully, and only when they uniquely identify a file.inputLineCount
- the number of lines in the input to map (SMAPLineFileCount
)outputStartLine
- starting line in the output file (SMAPOutputStartLine
)outputLineIncrement
- number of output lines to map to each input line (SMAPOutputLineIncrement
). Given the fact that the name starts with "output", I continuously have the subconscious urge to call this fieldOutputLineExcrement
.
-
getStratumName
@Deprecated public java.lang.String getStratumName()
Deprecated.Unused. This will be removed in Tomcat 9.0.x- Returns:
- the name of the stratum.
-
getString
public java.lang.String getString()
- Returns:
- the given stratum as a String: a StratumSection, followed by at least one FileSection and at least one LineSection.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-