Source Home >> Java Source 1.6.0 >> javax.xml.parsers.FactoryConfigurationError V 0.09
  • 001/*
  • 002 * The contents of this file are subject to the terms
  • 003 * of the Common Development and Distribution License
  • 004 * (the "License"). You may not use this file except
  • 005 * in compliance with the License.
  • 006 *
  • 007 * You can obtain a copy of the license at
  • 008 * https://jaxp.dev.java.net/CDDLv1.0.html.
  • 009 * See the License for the specific language governing
  • 010 * permissions and limitations under the License.
  • 011 *
  • 012 * When distributing Covered Code, include this CDDL
  • 013 * HEADER in each file and include the License file at
  • 014 * https://jaxp.dev.java.net/CDDLv1.0.html
  • 015 * If applicable add the following below this CDDL HEADER
  • 016 * with the fields enclosed by brackets "[]" replaced with
  • 017 * your own identifying information: Portions Copyright
  • 018 * [year] [name of copyright owner]
  • 019 */
  • 020
  • 021/*
  • 022 * $Id: XMLEntityReader.java,v 1.3 2005/11/03 17:02:21 jeffsuttor Exp $
  • 023 * @(#)FactoryConfigurationError.java 1.20 05/11/17
  • 024 *
  • 025 * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
  • 026 */
  • 027
  • 028package javax.xml.parsers;
  • 029
  • 030/**
  • 031 * Thrown when a problem with configuration with the Parser Factories
  • 032 * exists. This error will typically be thrown when the class of a
  • 033 * parser factory specified in the system properties cannot be found
  • 034 * or instantiated.
  • 035 *
  • 036 * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
  • 037 * @version $Revision: 1.2 $, $Date: 2005/06/10 03:50:29 $
  • 038 */
  • 039
  • 040public class FactoryConfigurationError extends Error {
  • 041
  • 042 /**
  • 043 *<code>Exception</code> that represents the error.
  • 044 */
  • 045 private Exception exception;
  • 046
  • 047 /**
  • 048 * Create a new <code>FactoryConfigurationError</code> with no
  • 049 * detail mesage.
  • 050 */
  • 051
  • 052 public FactoryConfigurationError() {
  • 053 super();
  • 054 this.exception = null;
  • 055 }
  • 056
  • 057 /**
  • 058 * Create a new <code>FactoryConfigurationError</code> with
  • 059 * the <code>String </code> specified as an error message.
  • 060 *
  • 061 * @param msg The error message for the exception.
  • 062 */
  • 063
  • 064 public FactoryConfigurationError(String msg) {
  • 065 super(msg);
  • 066 this.exception = null;
  • 067 }
  • 068
  • 069
  • 070 /**
  • 071 * Create a new <code>FactoryConfigurationError</code> with a
  • 072 * given <code>Exception</code> base cause of the error.
  • 073 *
  • 074 * @param e The exception to be encapsulated in a
  • 075 * FactoryConfigurationError.
  • 076 */
  • 077
  • 078 public FactoryConfigurationError(Exception e) {
  • 079 super(e.toString());
  • 080 this.exception = e;
  • 081 }
  • 082
  • 083 /**
  • 084 * Create a new <code>FactoryConfigurationError</code> with the
  • 085 * given <code>Exception</code> base cause and detail message.
  • 086 *
  • 087 * @param e The exception to be encapsulated in a
  • 088 * FactoryConfigurationError
  • 089 * @param msg The detail message.
  • 090 */
  • 091
  • 092 public FactoryConfigurationError(Exception e, String msg) {
  • 093 super(msg);
  • 094 this.exception = e;
  • 095 }
  • 096
  • 097
  • 098 /**
  • 099 * Return the message (if any) for this error . If there is no
  • 100 * message for the exception and there is an encapsulated
  • 101 * exception then the message of that exception, if it exists will be
  • 102 * returned. Else the name of the encapsulated exception will be
  • 103 * returned.
  • 104 *
  • 105 * @return The error message.
  • 106 */
  • 107
  • 108 public String getMessage () {
  • 109 String message = super.getMessage ();
  • 110
  • 111 if (message == null && exception != null) {
  • 112 return exception.getMessage();
  • 113 }
  • 114
  • 115 return message;
  • 116 }
  • 117
  • 118 /**
  • 119 * Return the actual exception (if any) that caused this exception to
  • 120 * be raised.
  • 121 *
  • 122 * @return The encapsulated exception, or null if there is none.
  • 123 */
  • 124
  • 125 public Exception getException () {
  • 126 return exception;
  • 127 }
  • 128}

文件:FactoryConfigurationError.java
包名:javax.xml.parsers
类名:FactoryConfigurationError
继承:Error
接口: