1 package net.sf.saxon.trans; 2 3 import net.sf.saxon.om.NamespaceConstant; 4 import net.sf.saxon.value.Value; 5 6 import javax.xml.transform.SourceLocator ; 7 import javax.xml.transform.TransformerException ; 8 9 15 16 public abstract class XPathException extends TransformerException { 17 18 20 private boolean isTypeError = false; 21 String errorCodeNamespace; 22 String errorCode; 23 Value errorObject; 24 private boolean hasBeenReported = false; 25 26 public XPathException(String message) { 27 super(message); 28 } 29 30 public XPathException(Throwable err) { 31 super(err); 32 } 33 34 public XPathException(String message, Throwable err) { 35 super(message, err); 36 } 37 38 public XPathException(String message, SourceLocator loc) { 39 super(message, loc); 40 } 41 42 public XPathException(String message, SourceLocator loc, Throwable err) { 43 super(message, loc, err); 44 } 45 46 49 50 public StaticError makeStatic() { 51 return new StaticError(this); 52 } 53 54 public void setIsTypeError(boolean is) { 55 isTypeError = is; 56 } 57 58 public boolean isTypeError() { 59 return isTypeError; 60 } 61 62 68 69 public void setErrorCode(String code) { 70 if (code != null) { 71 this.errorCode = code; 72 if (errorCodeNamespace == null) { 73 errorCodeNamespace = NamespaceConstant.ERR; 74 } 75 } 76 } 77 78 83 84 public void setErrorCode(String namespace, String code) { 85 this.errorCode = code; 86 this.errorCodeNamespace = namespace; 87 } 88 89 93 94 public String getErrorCodeLocalPart() { 95 return errorCode; 96 } 97 98 102 103 public String getErrorCodeNamespace() { 104 return errorCodeNamespace; 105 } 106 107 public void setErrorObject(Value value) { 108 errorObject = value; 109 } 110 111 public Value getErrorObject() { 112 return errorObject; 113 } 114 115 public void setHasBeenReported() { 116 hasBeenReported = true; 117 } 118 119 public boolean hasBeenReported() { 120 return hasBeenReported; 121 } 122 123 126 127 public static class Circularity extends DynamicError { 128 public Circularity(String message) { 129 super(message); 130 } 131 } 132 133 } 134 135 | Popular Tags |