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".
- Jayson Falkner
- Shawn Bayern
static class | SmapStratum.LineInfo - Represents a single LineSection in an SMAP, associated with
a particular stratum.
|
SmapStratum(String stratumName) - Constructs a new SmapStratum object for the given stratum name
(e.g., JSP).
|
void | addFile(String filename) - Adds record of a new file, by filename.
|
void | addFile(String filename, String filePath) - Adds record of a new file, by filename and path.
|
void | addLineData(int inputStartLine, String inputFileName, int inputLineCount, int outputStartLine, int outputLineIncrement) - Adds complete information about a simple line mapping.
|
String | getStratumName() - Returns the name of the stratum.
|
String | getString() - Returns the given stratum as a String: a StratumSection,
followed by at least one FileSection and at least one LineSection.
|
void | optimizeLineSection() - Combines consecutive LineInfos wherever possible
|
String | toString()
|
SmapStratum
public SmapStratum(String stratumName)
Constructs a new SmapStratum object for the given stratum name
(e.g., JSP).
stratumName
- the name of the stratum (e.g., JSP)
addFile
public void addFile(String filename)
Adds record of a new file, by filename.
filename
- the filename to add, unqualified by path.
addFile
public void addFile(String filename,
String filePath)
Adds record of a new file, by filename and path. The path
may be relative to a source compilation path.
filename
- the filename to add, unqualified by pathfilePath
- the path for the filename, potentially relative
to a source compilation path
addLineData
public void addLineData(int inputStartLine,
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.)
inputStartLine
- starting line in the source file
(SMAP InputStartLine)inputFileName
- the filepath (or name) from which the input comes
(yields SMAP LineFileID) Use unqualified names
carefully, and only when they uniquely identify a file.inputLineCount
- the number of lines in the input to map
(SMAP LineFileCount)outputStartLine
- starting line in the output file
(SMAP OutputStartLine)outputLineIncrement
- number of output lines to map to each
input line (SMAP OutputLineIncrement). Given the
fact that the name starts with "output", I continuously have
the subconscious urge to call this field
OutputLineExcrement.
getStratumName
public String getStratumName()
Returns the name of the stratum.
getString
public String getString()
Returns the given stratum as a String: a StratumSection,
followed by at least one FileSection and at least one LineSection.
optimizeLineSection
public void optimizeLineSection()
Combines consecutive LineInfos wherever possible
toString
public String toString()
Copyright ?? 2000-2004 Apache Software Foundation. All Rights Reserved.