001package com.nimbusds.oauth2.sdk;
002
003
004import java.net.URI;
005
006import com.nimbusds.oauth2.sdk.id.ClientID;
007import com.nimbusds.oauth2.sdk.id.State;
008
009
010/**
011 * Parse exception.
012 */
013public class ParseException extends GeneralException {
014
015
016        /**
017         * Creates a new parse exception.
018         *
019         * @param message The exception message. May be {@code null}.
020         */
021        public ParseException(final String message) {
022        
023                this(message, null, null, null, null, null);
024        }
025        
026        
027        /**
028         * Creates a new parse exception.
029         *
030         * @param message The exception message. May be {@code null}.
031         * @param cause   The exception cause, {@code null} if not specified.
032         */
033        public ParseException(final String message, final Throwable cause) {
034        
035                this(message, null, null, null, null, null, cause);
036        }
037
038
039        /**
040         * Creates a new parse exception.
041         *
042         * @param message The exception message. May be {@code null}.
043         * @param error   The associated error, {@code null} if not specified.
044         */
045        public ParseException(final String message, final ErrorObject error) {
046        
047                this(message, error, null, null, null, null);
048        }
049
050
051        /**
052         * Creates a new parse exception.
053         *
054         * @param message The exception message. May be {@code null}.
055         * @param error   The associated error, {@code null} if not specified.
056         * @param cause   The exception cause, {@code null} if not specified.
057         */
058        public ParseException(final String message, 
059                              final ErrorObject error,
060                              final Throwable cause) {
061        
062                this(message, error, null, null, null, null, cause);
063        }
064        
065        
066        /**
067         * Creates a new parse exception.
068         *
069         * @param message     The exception message. May be {@code null}.
070         * @param error       The associated error, {@code null} if not
071         *                    specified.
072         * @param clientID    The associated client identifier. Must not be
073         *                    {@code null}.
074         * @param redirectURI The associated redirection URI. Must not be
075         *                    {@code null}.
076         * @param responseMode The optional associated response mode,
077         *                     {@code null} if not specified.
078         * @param state       The optional associated state parameter, 
079         *                    {@code null} if not specified.
080         */
081        public ParseException(final String message, 
082                              final ErrorObject error,
083                              final ClientID clientID,
084                              final URI redirectURI,
085                              final ResponseMode responseMode,
086                              final State state) {
087
088                this(message, error, clientID, redirectURI, responseMode, state, null);
089        }
090
091
092        /**
093         * Creates a new parse exception.
094         *
095         * @param message      The exception message. May be {@code null}.
096         * @param error        The associated error, {@code null} if not
097         *                     specified.
098         * @param clientID     The associated client identifier. Must not be
099         *                     {@code null}.
100         * @param redirectURI  The associated redirection URI. Must not be
101         *                     {@code null}.
102         * @param responseMode The optional associated response mode,
103         *                     {@code null} if not specified.
104         * @param state        The optional associated state parameter,
105         *                     {@code null} if not specified.
106         * @param cause        The exception cause, {@code null} if not
107         *                     specified.
108         */
109        public ParseException(final String message, 
110                              final ErrorObject error,
111                              final ClientID clientID,
112                              final URI redirectURI,
113                              final ResponseMode responseMode,
114                              final State state,
115                              final Throwable cause) {
116
117                super(message, error, clientID, redirectURI, responseMode, state, cause);
118        }
119}