1 package es.inteco.eni.xml;
2
3 import org.xml.sax.SAXParseException;
4
5
6
7
8
9
10
11 public class ValidationXmlResult {
12
13
14
15
16 private boolean validationError;
17
18
19
20 private int lineNumber;
21
22
23
24 private int columnNumber;
25
26
27
28 private Exception exception;
29
30
31
32 private XmlTree xmlTree;
33
34
35
36
37 public ValidationXmlResult(){
38
39 }
40
41
42
43
44
45 public ValidationXmlResult(SAXParseException saxParseException){
46 this.validationError = true;
47 this.lineNumber = saxParseException.getLineNumber();
48 this.columnNumber = saxParseException.getColumnNumber();
49 this.exception = saxParseException;
50 }
51
52
53
54
55 public boolean isValidationError() {
56 return validationError;
57 }
58
59
60
61 public void setValidationError(boolean validationError) {
62 this.validationError = validationError;
63 }
64
65
66
67 public int getLineNumber() {
68 return lineNumber;
69 }
70
71
72
73 public void setLineNumber(int lineNumber) {
74 this.lineNumber = lineNumber;
75 }
76
77
78
79 public int getColumnNumber() {
80 return columnNumber;
81 }
82
83
84
85 public void setColumnNumber(int columnNumber) {
86 this.columnNumber = columnNumber;
87 }
88
89
90
91 public Exception getException() {
92 return exception;
93 }
94
95
96
97 public void setException(Exception exception) {
98 this.exception = exception;
99 }
100
101
102
103
104
105 public String getMessage(){
106 String result = "";
107 if(columnNumber!=0 && lineNumber!=0 && exception!=null){
108 result+="["+ columnNumber + "," + lineNumber+ "] ";
109 }
110 if(exception!=null){
111 result += exception.getMessage();
112 }
113 return result;
114 }
115
116
117
118
119 public XmlTree getXmlTree() {
120 return xmlTree;
121 }
122
123
124
125
126 public void setXmlTree(XmlTree xmlTree) {
127 this.xmlTree = xmlTree;
128 }
129
130 }