1 /*
2 * This file is part of Pease Plate Template Engine.
3 *
4 * Pease Plate Template Engine is free software: you can redistribute
5 * it and/or modify it under the terms of the GNU Lesser General
6 * Public License as published by the Free Software Foundation,
7 * either version 3 of the License, or any later version.
8 *
9 * Pease Plate Template Engine is distributed in the hope that it
10 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
11 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Pease Plate Template Engine. If not, see
16 * <http://www.gnu.org/licenses/>.
17 *
18 * Copyright (c) 2008 Manfred HANTSCHEL
19 */
20 package org.peaseplate.chunk;
21
22 import org.peaseplate.locator.TemplateLocator;
23
24 /**
25 * The abstract implementation of a chunk. It stores the
26 * line and column numbers and the next chunk.
27 *
28 * @author Manfred HANTSCHEL
29 */
30 public abstract class AbstractChunk implements Chunk {
31
32 private final TemplateLocator locator;
33 private final int line;
34 private final int column;
35
36 /**
37 * Creates the chunk using the specified line and column numbers.
38 * @param locator the locator
39 * @param line the line
40 * @param column the column
41 */
42 public AbstractChunk(TemplateLocator locator, int line, int column) {
43 super();
44
45 this.locator = locator;
46 this.line = line;
47 this.column = column;
48 }
49
50 /**
51 * @see org.peaseplate.chunk.Chunk#getLocator()
52 */
53 public TemplateLocator getLocator() {
54 return locator;
55 }
56
57 /**
58 * @see org.peaseplate.chunk.Chunk#getLine()
59 */
60 public int getLine() {
61 return line;
62 }
63
64 /**
65 * @see org.peaseplate.chunk.Chunk#getColumn()
66 */
67 public int getColumn() {
68 return column;
69 }
70
71 }