com.caucho.java
Class LineMap

java.lang.Object
  extended by com.caucho.java.LineMap
All Implemented Interfaces:
java.io.Serializable

public class LineMap
extends java.lang.Object
implements java.io.Serializable

LineMap maps generated code lines back to the source lines.

Resin uses LineMap to tell the user the line in the JSP or XSL file that is broken, as opposed to the generated Java line.

See Also:
Serialized Form

Nested Class Summary
static class LineMap.Line
           
 
Constructor Summary
LineMap()
          Null-arg constructor for serialization.
LineMap(java.lang.String dstFilename)
           
LineMap(java.lang.String dstFilename, java.lang.String srcFilename)
           
 
Method Summary
 void add(int srcLine, int dstLine)
           
 boolean add(java.lang.String srcFilename, int srcLine, int dstLine)
          Adds a new line map entry.
 boolean add(java.lang.String srcFilename, int srcLine, int dstLine, boolean isPreferLast)
           
 void addLine(int startLine, java.lang.String sourceFile, int repeatCount, int outputLine, int outputIncrement)
          Adds a line from the smap
 java.lang.String convertError(java.lang.String filename, int line, int column, java.lang.String message)
          Converts an error in the generated file to a CompileError based on the source.
 java.lang.String convertLine(java.lang.String filename, int line)
           
 LineMap.Line get(int i)
           
 java.lang.String getDestFilename()
           
 java.lang.String getLastSourceFilename()
           
 LineMap.Line getLine(int line)
           
 java.lang.String getSourceType()
           
 java.util.Iterator<LineMap.Line> iterator()
           
 void printStackTrace(java.lang.Throwable e, java.io.OutputStream os)
          Filter a stack trace, replacing names.
 void printStackTrace(java.lang.Throwable e, java.io.PrintWriter os)
          Filter a stack trace, replacing names.
 void setSourceType(java.lang.String type)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineMap

public LineMap()
Null-arg constructor for serialization.


LineMap

public LineMap(java.lang.String dstFilename,
               java.lang.String srcFilename)

LineMap

public LineMap(java.lang.String dstFilename)
Method Detail

setSourceType

public void setSourceType(java.lang.String type)

getSourceType

public java.lang.String getSourceType()

getDestFilename

public java.lang.String getDestFilename()

getLastSourceFilename

public java.lang.String getLastSourceFilename()

add

public boolean add(java.lang.String srcFilename,
                   int srcLine,
                   int dstLine)
Adds a new line map entry.

LineMap assumes that dstLine increases monotonically.

Parameters:
srcFilename - the source filename, e.g. the included filename
srcLine - the source line, e.g. the line in the included file
dstLine - the line of the generated file.
Returns:
true if a new entry is needed

add

public boolean add(java.lang.String srcFilename,
                   int srcLine,
                   int dstLine,
                   boolean isPreferLast)

addLine

public void addLine(int startLine,
                    java.lang.String sourceFile,
                    int repeatCount,
                    int outputLine,
                    int outputIncrement)
Adds a line from the smap


add

public void add(int srcLine,
                int dstLine)

iterator

public java.util.Iterator<LineMap.Line> iterator()

size

public int size()

get

public LineMap.Line get(int i)

getLine

public LineMap.Line getLine(int line)

convertError

public java.lang.String convertError(java.lang.String filename,
                                     int line,
                                     int column,
                                     java.lang.String message)
Converts an error in the generated file to a CompileError based on the source.


convertLine

public java.lang.String convertLine(java.lang.String filename,
                                    int line)

printStackTrace

public void printStackTrace(java.lang.Throwable e,
                            java.io.OutputStream os)
Filter a stack trace, replacing names.


printStackTrace

public void printStackTrace(java.lang.Throwable e,
                            java.io.PrintWriter os)
Filter a stack trace, replacing names.