blob: 673e76db627f2e3a57f4099a33d9102a308cd3f2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/*******************************************************************************
* Copyright (c) 2004, 2008 John Krasnay and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* John Krasnay - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.xml.vex.ui.internal.config;
/**
* Represents a problem found when parsing a configuration resource.
*/
public class BuildProblem {
public static final int SEVERITY_ERROR = 1;
public static final int SEVERITY_WARNING = 2;
/**
* Class constructor.
*/
public BuildProblem() {
}
/**
* Class constructor.
*
* @param severity
* Severity of the problem: SEVERITY_WARNING or SEVERITY_ERROR
* @param resourcePath
* Path of the resource being built, relative to its plugin or
* project.
* @param message
* Description of the problem.
* @param lineNumber
* Line number on which the problem occurred, or -1 if unknown.
*/
public BuildProblem(int severity, String resourcePath, String message,
int lineNumber) {
this.severity = severity;
this.resourcePath = resourcePath;
this.message = message;
this.lineNumber = lineNumber;
}
/**
* Returns the line number on which the error occurred, or -1 if no line
* number can be identified.
*/
public int getLineNumber() {
return lineNumber;
}
/**
* Returns the message describing the problem.
*/
public String getMessage() {
return message;
}
/**
* Returns the path of the resource relative to the project root.
*/
public String getResourcePath() {
return resourcePath;
}
/**
* Returns the severity of the problem, either SEVERITY_ERROR or
* SEVERITY_WARNING.
*/
public int getSeverity() {
return severity;
}
/**
* Sets the line number of the problem.
*
* @param lineNumber
* Line number on which the problem occurred.
*/
public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}
/**
* Sets the message describing the problem.
*
* @param message
* Message describing the problem.
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Sets the path of the resource that had the problem.
*
* @param resourcePath
* Path of the resource, relative to the project root.
*/
public void setResourcePath(String resourcePath) {
this.resourcePath = resourcePath;
}
/**
* Sets the severity of the problem.
*
* @param severity
* Severity of the problem. Should be one of SEVERITY_ERROR or
* SEVERITY_WARNING.
*/
public void setSeverity(int severity) {
this.severity = severity;
}
// ==================================================== PRIVATE
private String resourcePath;
private int severity;
private String message;
private int lineNumber;
}
|