001 /*
002 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.xml.bind;
027
028 /**
029 * This exception indicates that an error was encountered while getting or
030 * setting a property.
031 *
032 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
033 * @version $Revision: 1.2 $ $Date: 2004/06/14 21:23:04 $
034 * @see JAXBContext
035 * @see Validator
036 * @see Unmarshaller
037 * @since JAXB1.0
038 */
039 public class PropertyException extends JAXBException {
040
041 /**
042 * Construct a PropertyException with the specified detail message. The
043 * errorCode and linkedException will default to null.
044 *
045 * @param message a description of the exception
046 */
047 public PropertyException(String message) {
048 super (message);
049 }
050
051 /**
052 * Construct a PropertyException with the specified detail message and
053 * vendor specific errorCode. The linkedException will default to null.
054 *
055 * @param message a description of the exception
056 * @param errorCode a string specifying the vendor specific error code
057 */
058 public PropertyException(String message, String errorCode) {
059 super (message, errorCode);
060 }
061
062 /**
063 * Construct a PropertyException with a linkedException. The detail
064 * message and vendor specific errorCode will default to null.
065 *
066 * @param exception the linked exception
067 */
068 public PropertyException(Throwable exception) {
069 super (exception);
070 }
071
072 /**
073 * Construct a PropertyException with the specified detail message and
074 * linkedException. The errorCode will default to null.
075 *
076 * @param message a description of the exception
077 * @param exception the linked exception
078 */
079 public PropertyException(String message, Throwable exception) {
080 super (message, exception);
081 }
082
083 /**
084 * Construct a PropertyException with the specified detail message, vendor
085 * specific errorCode, and linkedException.
086 *
087 * @param message a description of the exception
088 * @param errorCode a string specifying the vendor specific error code
089 * @param exception the linked exception
090 */
091 public PropertyException(String message, String errorCode,
092 Throwable exception) {
093 super (message, errorCode, exception);
094 }
095
096 /**
097 * Construct a PropertyException whose message field is set based on the
098 * name of the property and value.toString().
099 *
100 * @param name the name of the property related to this exception
101 * @param value the value of the property related to this exception
102 */
103 public PropertyException(String name, Object value) {
104 super(Messages.format(Messages.NAME_VALUE, name, value
105 .toString()));
106 }
107
108 }
|