001 /*
002 * $Id: PropertyException.java,v 1.4 2002/11/11 19:07:05 ryans Exp $
003 *
004 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
005 *
006 * This software is the proprietary information of Sun Microsystems, Inc.
007 * Use is subject to license terms.
008 *
009 */
010
011 package javax.xml.bind;
012
013
014
015 /**
016 * This exception indicates that an error was encountered while getting or
017 * setting a property.
018 *
019 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
020 * @version $Revision: 1.4 $ $Date: 2002/11/11 19:07:05 $
021 * @see JAXBContext
022 * @see Validator
023 * @see Unmarshaller
024 * @since JAXB1.0
025 */
026 public class PropertyException extends JAXBException {
027
028 /**
029 * Construct a PropertyException with the specified detail message. The
030 * errorCode and linkedException will default to null.
031 *
032 * @param message a description of the exception
033 */
034 public PropertyException(String message) {
035 super(message);
036 }
037
038 /**
039 * Construct a PropertyException with the specified detail message and
040 * vendor specific errorCode. The linkedException will default to null.
041 *
042 * @param message a description of the exception
043 * @param errorCode a string specifying the vendor specific error code
044 */
045 public PropertyException(String message, String errorCode) {
046 super(message, errorCode);
047 }
048
049 /**
050 * Construct a PropertyException with a linkedException. The detail
051 * message and vendor specific errorCode will default to null.
052 *
053 * @param exception the linked exception
054 */
055 public PropertyException(Throwable exception) {
056 super(exception);
057 }
058
059 /**
060 * Construct a PropertyException with the specified detail message and
061 * linkedException. The errorCode will default to null.
062 *
063 * @param message a description of the exception
064 * @param exception the linked exception
065 */
066 public PropertyException(String message, Throwable exception) {
067 super(message, exception);
068 }
069
070 /**
071 * Construct a PropertyException with the specified detail message, vendor
072 * specific errorCode, and linkedException.
073 *
074 * @param message a description of the exception
075 * @param errorCode a string specifying the vendor specific error code
076 * @param exception the linked exception
077 */
078 public PropertyException(
079 String message,
080 String errorCode,
081 Throwable exception) {
082 super(message, errorCode, exception);
083 }
084
085 /**
086 * Construct a PropertyException whose message field is set based on the
087 * name of the property and value.toString().
088 *
089 * @param name the name of the property related to this exception
090 * @param value the value of the property related to this exception
091 */
092 public PropertyException(String name, Object value) {
093 super( Messages.format( Messages.NAME_VALUE,
094 name,
095 value.toString() ) );
096 }
097
098
099 }