01: package org.dom4j;
02:
03: import org.dom4j.Element;
04: import org.dom4j.QName;
05: import org.dom4j.tree.DefaultElement;
06:
07: public class LElement extends DefaultElement {
08: private int lineNumber;
09:
10: public LElement(String name) {
11: super (name);
12: }
13:
14: public LElement(QName qname) {
15: super (qname);
16: }
17:
18: public String toString() {
19: return super .toString() + " lineNumber: " + lineNumber;
20: }
21:
22: public Object clone() {
23: LElement answer = (LElement) super .clone();
24:
25: if (answer != this ) {
26: answer.lineNumber = lineNumber;
27: }
28:
29: return answer;
30: }
31:
32: // Implementation methods
33: // -------------------------------------------------------------------------
34:
35: protected Element createElement(String name) {
36: LElement answer = (LElement) getDocumentFactory()
37: .createElement(name);
38: answer.setLineNumber(getLineNumber());
39:
40: return answer;
41: }
42:
43: protected Element createElement(QName qName) {
44: LElement answer = (LElement) getDocumentFactory()
45: .createElement(qName);
46: answer.setLineNumber(getLineNumber());
47:
48: return answer;
49: }
50:
51: /**
52: * @return Returns the lineNumber.
53: */
54: public int getLineNumber() {
55: return lineNumber;
56: }
57:
58: /**
59: * @param lineNumber The lineNumber to set.
60: */
61: public void setLineNumber(int lineNumber) {
62: this.lineNumber = lineNumber;
63: }
64: }
|