Constructors Summary |
---|
Mark(JspReader reader, char[] inStream, int fileid, String name, String inBaseDir, String inEncoding)Constructor
this.reader = reader;
this.ctxt = reader.getJspCompilationContext();
this.stream = inStream;
this.cursor = 0;
this.line = 1;
this.col = 1;
this.fileid = fileid;
this.fileName = name;
this.baseDir = inBaseDir;
this.encoding = inEncoding;
this.includeStack = new Stack();
|
Mark(Mark other)Constructor
this.reader = other.reader;
this.ctxt = other.reader.getJspCompilationContext();
this.stream = other.stream;
this.fileid = other.fileid;
this.fileName = other.fileName;
this.cursor = other.cursor;
this.line = other.line;
this.col = other.col;
this.baseDir = other.baseDir;
this.encoding = other.encoding;
// clone includeStack without cloning contents
includeStack = new Stack();
for ( int i=0; i < other.includeStack.size(); i++ ) {
includeStack.addElement( other.includeStack.elementAt(i) );
}
|
Mark(org.apache.jasper.JspCompilationContext ctxt, String filename, int line, int col)Constructor
this.reader = null;
this.ctxt = ctxt;
this.stream = null;
this.cursor = 0;
this.line = line;
this.col = col;
this.fileid = -1;
this.fileName = filename;
this.baseDir = "le-basedir";
this.encoding = "le-endocing";
this.includeStack = null;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object other)
if (other instanceof Mark) {
Mark m = (Mark) other;
return this.reader == m.reader && this.fileid == m.fileid
&& this.cursor == m.cursor && this.line == m.line
&& this.col == m.col;
}
return false;
|
public int | getColumnNumber()
return col;
|
public java.lang.String | getFile()
return this.fileName;
|
public int | getLineNumber()
return line;
|
public java.lang.String | getPublicId()
return null;
|
public java.lang.String | getSystemId()
return getFile();
|
public java.net.URL | getURL()Gets the URL of the resource with which this Mark is associated
return ctxt.getResource(getFile());
|
public boolean | isGreater(org.apache.jasper.compiler.Mark other)
boolean greater = false;
if (this.line > other.line) {
greater = true;
} else if (this.line == other.line && this.col > other.col) {
greater = true;
}
return greater;
|
public org.apache.jasper.compiler.Mark | popStream()/* Restores this mark's state to a previously stored stream.
// make sure we have something to pop
if ( includeStack.size() <= 0 ) {
return null;
}
// get previous state in stack
IncludeState state = (IncludeState) includeStack.pop( );
// set new variables
cursor = state.cursor;
line = state.line;
col = state.col;
fileid = state.fileid;
fileName = state.fileName;
baseDir = state.baseDir;
stream = state.stream;
return this;
|
public void | pushStream(char[] inStream, int inFileid, java.lang.String name, java.lang.String inBaseDir, java.lang.String inEncoding)Sets this mark's state to a new stream.
It will store the current stream in it's includeStack.
// store current state in stack
includeStack.push(new IncludeState(cursor, line, col, fileid, fileName, baseDir,
encoding, stream) );
// set new variables
cursor = 0;
line = 1;
col = 1;
fileid = inFileid;
fileName = name;
baseDir = inBaseDir;
encoding = inEncoding;
stream = inStream;
|
public java.lang.String | toShortString()
return "("+line+","+col+")";
|
public java.lang.String | toString()
return getFile()+"("+line+","+col+")";
|