001/*
002 * oauth2-oidc-sdk
003 *
004 * Copyright 2012-2016, Connect2id Ltd and contributors.
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
007 * this file except in compliance with the License. You may obtain a copy of the
008 * License at
009 *
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software distributed
013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
015 * specific language governing permissions and limitations under the License.
016 */
017
018package com.nimbusds.oauth2.sdk;
019
020
021import java.net.URI;
022
023import com.nimbusds.oauth2.sdk.id.ClientID;
024import com.nimbusds.oauth2.sdk.id.State;
025
026
027/**
028 * Parse exception.
029 */
030public class ParseException extends GeneralException {
031
032
033        /**
034         * Creates a new parse exception.
035         *
036         * @param message The exception message. May be {@code null}.
037         */
038        public ParseException(final String message) {
039        
040                this(message, null, null, null, null, null);
041        }
042        
043        
044        /**
045         * Creates a new parse exception.
046         *
047         * @param message The exception message. May be {@code null}.
048         * @param cause   The exception cause, {@code null} if not specified.
049         */
050        public ParseException(final String message, final Throwable cause) {
051        
052                this(message, null, null, null, null, null, cause);
053        }
054
055
056        /**
057         * Creates a new parse exception.
058         *
059         * @param message The exception message. May be {@code null}.
060         * @param error   The associated error, {@code null} if not specified.
061         */
062        public ParseException(final String message, final ErrorObject error) {
063        
064                this(message, error, null, null, null, null);
065        }
066
067
068        /**
069         * Creates a new parse exception.
070         *
071         * @param message The exception message. May be {@code null}.
072         * @param error   The associated error, {@code null} if not specified.
073         * @param cause   The exception cause, {@code null} if not specified.
074         */
075        public ParseException(final String message, 
076                              final ErrorObject error,
077                              final Throwable cause) {
078        
079                this(message, error, null, null, null, null, cause);
080        }
081        
082        
083        /**
084         * Creates a new parse exception.
085         *
086         * @param message     The exception message. May be {@code null}.
087         * @param error       The associated error, {@code null} if not
088         *                    specified.
089         * @param clientID    The associated client identifier. Must not be
090         *                    {@code null}.
091         * @param redirectURI The associated redirection URI. Must not be
092         *                    {@code null}.
093         * @param responseMode The optional associated response mode,
094         *                     {@code null} if not specified.
095         * @param state       The optional associated state parameter, 
096         *                    {@code null} if not specified.
097         */
098        public ParseException(final String message, 
099                              final ErrorObject error,
100                              final ClientID clientID,
101                              final URI redirectURI,
102                              final ResponseMode responseMode,
103                              final State state) {
104
105                this(message, error, clientID, redirectURI, responseMode, state, null);
106        }
107
108
109        /**
110         * Creates a new parse exception.
111         *
112         * @param message      The exception message. May be {@code null}.
113         * @param error        The associated error, {@code null} if not
114         *                     specified.
115         * @param clientID     The associated client identifier. Must not be
116         *                     {@code null}.
117         * @param redirectURI  The associated redirection URI. Must not be
118         *                     {@code null}.
119         * @param responseMode The optional associated response mode,
120         *                     {@code null} if not specified.
121         * @param state        The optional associated state parameter,
122         *                     {@code null} if not specified.
123         * @param cause        The exception cause, {@code null} if not
124         *                     specified.
125         */
126        public ParseException(final String message, 
127                              final ErrorObject error,
128                              final ClientID clientID,
129                              final URI redirectURI,
130                              final ResponseMode responseMode,
131                              final State state,
132                              final Throwable cause) {
133
134                super(message, error, clientID, redirectURI, responseMode, state, cause);
135        }
136}