jdk/src/share/classes/java/time/temporal/UnsupportedTemporalTypeException.java
author sherman
Wed, 15 May 2013 07:48:57 -0700
changeset 17474 8c100beabcc0
parent 16852 60207b2b4b42
permissions -rw-r--r--
8013730: JSR 310 DateTime API Updates III Summary: Integration of JSR310 Date/Time API update III Reviewed-by: naoto Contributed-by: scolebourne@joda.org, roger.riggs@oracle.com, masayoshi.okutsu@oracle.com, patrick.zhang@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16852
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     1
/*
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     4
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    10
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    15
 * accompanied this code).
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    16
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    20
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    23
 * questions.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    24
 */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    25
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    26
/*
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    27
 * This file is available under and governed by the GNU General Public
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    28
 * License version 2 only, as published by the Free Software Foundation.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    29
 * However, the following notice accompanied the original version of this
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    30
 * file:
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    31
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    32
 * Copyright (c) 2013, Stephen Colebourne & Michael Nascimento Santos
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    33
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    34
 * All rights reserved.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    35
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    36
 * Redistribution and use in source and binary forms, with or without
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    37
 * modification, are permitted provided that the following conditions are met:
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    38
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    39
 *  * Redistributions of source code must retain the above copyright notice,
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    40
 *    this list of conditions and the following disclaimer.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    41
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    42
 *  * Redistributions in binary form must reproduce the above copyright notice,
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    43
 *    this list of conditions and the following disclaimer in the documentation
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    44
 *    and/or other materials provided with the distribution.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    45
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    46
 *  * Neither the name of JSR-310 nor the names of its contributors
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    47
 *    may be used to endorse or promote products derived from this software
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    48
 *    without specific prior written permission.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    49
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    50
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    51
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    52
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    53
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    54
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    55
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    56
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    57
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    58
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    59
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    60
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    61
 */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    62
package java.time.temporal;
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    63
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    64
import java.time.DateTimeException;
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    65
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    66
/**
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    67
 * UnsupportedTemporalTypeException indicates that a ChronoField or ChronoUnit is
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    68
 * not supported for a Temporal class.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    69
 *
17474
8c100beabcc0 8013730: JSR 310 DateTime API Updates III
sherman
parents: 16852
diff changeset
    70
 * @implSpec
16852
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    71
 * This class is intended for use in a single thread.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    72
 *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    73
 * @since 1.8
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    74
 */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    75
public class UnsupportedTemporalTypeException extends DateTimeException {
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    76
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    77
    /**
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    78
     * Serialization version.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    79
     */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    80
    private static final long serialVersionUID = -6158898438688206006L;
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    81
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    82
    /**
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    83
     * Constructs a new UnsupportedTemporalTypeException with the specified message.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    84
     *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    85
     * @param message  the message to use for this exception, may be null
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    86
     */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    87
    public UnsupportedTemporalTypeException(String message) {
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    88
        super(message);
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    89
    }
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    90
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    91
    /**
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    92
     * Constructs a new UnsupportedTemporalTypeException with the specified message and cause.
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    93
     *
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    94
     * @param message  the message to use for this exception, may be null
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    95
     * @param cause  the cause of the exception, may be null
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    96
     */
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    97
    public UnsupportedTemporalTypeException(String message, Throwable cause) {
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    98
        super(message, cause);
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
    99
    }
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
   100
60207b2b4b42 8011172: JSR 310 DateTime API Updates II
sherman
parents:
diff changeset
   101
}