DCAE-D be initial commit
[sdc/dcae-d/dt-be-main.git] / dcaedt_validator / checker / src / main / java / org / onap / sdc / dcae / checker / TargetError.java
1 package org.onap.sdc.dcae.checker;
2
3
4 /**
5  * A target error represents an error in target the resource being checked.
6  * We only represent it as a Throwable because the libraries that perform parsing and syntax validation
7  * represent their errors as such ..
8  */
9 public class TargetError extends Throwable {
10
11         /*
12         public static enum Level {
13                 error,
14                 warning 
15         }
16         */
17
18   private String                location; //we might need an more detailed representation
19                                                                                                                         //here: it could be a YAML document jpath or
20                                                                                                                         //document location (line).
21   private String                target;
22
23   public TargetError(String theTarget, String theLocation, String theMessage, Throwable theCause) {
24                 super(theMessage, theCause);
25     this.target = theTarget;
26                 this.location = theLocation;
27   }
28
29   public TargetError(String theTarget, String theLocation, String theMessage) {
30     this(theTarget, theLocation, theMessage, null);
31   }
32
33         public String getTarget() {
34                 return this.target;
35         }
36
37         public String getLocation() {
38                 return this.location;
39         }
40
41
42 }
43