intial source from http://www.sf.net/projects/wdte
[phpeclipse.git] / net.sourceforge.phpeclipse.xml.core / src / net / sourceforge / phpeclipse / xml / core / internal / parser / DefaultProblem.java
1 /*
2  * Copyright (c) 2003-2004 Christopher Lenz and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     Christopher Lenz - initial API and implementation
10  * 
11  * $Id: DefaultProblem.java,v 1.1 2004-09-02 18:26:55 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.xml.core.internal.parser;
15
16 import net.sourceforge.phpeclipse.xml.core.parser.IProblem;
17
18 public class DefaultProblem implements IProblem {
19
20         // Instance Variables ------------------------------------------------------
21
22         private String message;
23         private int sourceStart;
24         private int sourceEnd;
25         private int sourceLineNumber;
26         private boolean error;
27
28         // Constructors ------------------------------------------------------------
29
30         public DefaultProblem(String message, int sourceStart, int sourceEnd,
31                         int sourceLineNumber, boolean error) {
32                 this.message = message;
33                 this.sourceStart = sourceStart;
34                 this.sourceEnd = sourceEnd;
35                 this.sourceLineNumber = sourceLineNumber;
36                 this.error = error;
37         }
38
39         // IProblem Implementation -------------------------------------------------
40
41         /*
42          * @see IProblem#getMessage()
43          */
44         public String getMessage() {
45                 return message;
46         }
47
48         /*
49          * @see IProblem#getSourceStart()
50          */
51         public int getSourceStart() {
52                 return sourceStart;
53         }
54
55         /*
56          * @see IProblem#getSourceEnd()
57          */
58         public int getSourceEnd() {
59                 return sourceEnd;
60         }
61
62         /*
63          * @see IProblem#getSourceLineNumber()
64          */
65         public int getSourceLineNumber() {
66                 return sourceLineNumber;
67         }
68
69         /*
70          * @see IProblem#isError()
71          */
72         public boolean isError() {
73                 return error;
74         }
75
76         /*
77          * @see IProblem#isWarning()
78          */
79         public boolean isWarning() {
80                 return !error;
81         }
82
83 }