MCPcopy Create free account
hub / github.com/apache/tomcat / Mark

Class Mark

java/org/apache/jasper/compiler/Mark.java:27–157  ·  view source on GitHub ↗

Mark represents a point in the JSP input.

Source from the content-addressed store, hash-verified

25 * Mark represents a point in the JSP input.
26 */
27public final class Mark {
28
29 // position within current stream
30 int cursor, line, col;
31
32 // current stream
33 char[] stream = null;
34
35 // name of the current file
36 private String fileName;
37
38 private JspCompilationContext ctxt;
39
40 /**
41 * Constructor
42 *
43 * @param reader JspReader this mark belongs to
44 * @param inStream current stream for this mark
45 * @param name JSP file name
46 */
47 Mark(JspReader reader, char[] inStream, String name) {
48 this.ctxt = reader.getJspCompilationContext();
49 this.stream = inStream;
50 this.cursor = 0;
51 this.line = 1;
52 this.col = 1;
53 this.fileName = name;
54 }
55
56
57 /**
58 * Constructor
59 */
60 Mark(Mark other) {
61 init(other, false);
62 }
63
64 void update(int cursor, int line, int col) {
65 this.cursor = cursor;
66 this.line = line;
67 this.col = col;
68 }
69
70 void init(Mark other, boolean singleFile) {
71 this.cursor = other.cursor;
72 this.line = other.line;
73 this.col = other.col;
74
75 if (!singleFile) {
76 this.ctxt = other.ctxt;
77 this.stream = other.stream;
78 this.fileName = other.fileName;
79 }
80 }
81
82
83 /**
84 * Constructor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected