01: package org.hibernate;
02:
03: /**
04: * Thrown when a mapping is found to be invalid.
05: * Similar to MappingException, but this contains more info about the path and type of mapping (e.g. file, resource or url)
06: *
07: * @author Max Rydahl Andersen
08: *
09: */
10: public class InvalidMappingException extends MappingException {
11:
12: private final String path;
13: private final String type;
14:
15: public InvalidMappingException(String customMessage, String type,
16: String path, Throwable cause) {
17: super (customMessage, cause);
18: this .type = type;
19: this .path = path;
20: }
21:
22: public InvalidMappingException(String customMessage, String type,
23: String path) {
24: super (customMessage);
25: this .type = type;
26: this .path = path;
27: }
28:
29: public InvalidMappingException(String type, String path) {
30: this ("Could not parse mapping document from " + type
31: + (path == null ? "" : " " + path), type, path);
32: }
33:
34: public InvalidMappingException(String type, String path,
35: Throwable cause) {
36: this ("Could not parse mapping document from " + type
37: + (path == null ? "" : " " + path), type, path, cause);
38: }
39:
40: public String getType() {
41: return type;
42: }
43:
44: public String getPath() {
45: return path;
46: }
47: }
|