2 * Copyright (c) 2001-2004 World Wide Web Consortium,
3 * (Massachusetts Institute of Technology, Institut National de
4 * Recherche en Informatique et en Automatique, Keio University). All
5 * Rights Reserved. This program is distributed under the W3C's Software
6 * Intellectual Property License. This program is distributed in the
7 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
14 package org.w3c.domts;
18 * This exception represents a mismatch between the
19 * requirements of the test (for example, entity preserving)
20 * and the capabilities of the parser under test.
23 public class DOMTestIncompatibleException
25 private final String msg;
27 private DOMTestIncompatibleException(String msg) {
32 * Constructor from a ParserConfigurationException
33 * or reflection exception
35 public DOMTestIncompatibleException(Throwable ex,
36 DocumentBuilderSetting setting) {
41 if (setting != null) {
42 msg = setting.toString();
45 msg = super.toString();
50 public static DOMTestIncompatibleException incompatibleFeature(String feature,
52 StringBuffer buf = new StringBuffer(
53 "Implementation does not support feature \"");
55 buf.append("\" version=\"");
58 return new DOMTestIncompatibleException(buf.toString());
61 public static DOMTestIncompatibleException incompatibleLoad(String href,
63 StringBuffer buf = new StringBuffer(
64 "Document is incompatible with content type, \"");
66 buf.append("\" not available for =\"");
67 buf.append(contentType);
69 return new DOMTestIncompatibleException(buf.toString());
72 public String toString() {