1 56 57 package org.jdom.input; 58 59 import org.jdom.*; 60 import org.xml.sax.*; 61 62 69 public class JDOMParseException extends JDOMException { 70 71 private static final String CVS_ID = 72 "@(#) $RCSfile: JDOMParseException.java,v $ $Revision: 1.7 $ $Date: 2004/02/17 02:29:24 $ $Name: $"; 73 74 78 private final Document partialDocument; 79 80 90 public JDOMParseException(String message, Throwable cause) { 91 this(message, cause, null); 92 } 93 94 107 public JDOMParseException(String message, Throwable cause, 108 Document partialDocument) { 109 super(message, cause); 110 this.partialDocument = partialDocument; 111 } 112 113 119 public Document getPartialDocument() { 120 return partialDocument; 121 } 122 123 130 public String getPublicId() { 131 return (getCause() instanceof SAXParseException)? 132 ((SAXParseException)getCause()).getPublicId(): null; 133 } 134 135 142 public String getSystemId() { 143 return (getCause() instanceof SAXParseException)? 144 ((SAXParseException)getCause()).getSystemId(): null; 145 } 146 147 156 public int getLineNumber() { 157 return (getCause() instanceof SAXParseException)? 158 ((SAXParseException)getCause()).getLineNumber(): -1; 159 } 160 161 170 public int getColumnNumber() { 171 return (getCause() instanceof SAXParseException)? 172 ((SAXParseException)getCause()).getColumnNumber(): -1; 173 } 174 } 175 176 | Popular Tags |