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, 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, 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 state       The optional associated state parameter, 
077         *                    {@code null} if not specified.
078         */
079        public ParseException(final String message, 
080                              final ErrorObject error,
081                              final ClientID clientID,
082                              final URI redirectURI,
083                              final State state) {
084
085                this(message, error, clientID, redirectURI, state, null);
086        }
087
088
089        /**
090         * Creates a new parse exception.
091         *
092         * @param message     The exception message. May be {@code null}.
093         * @param error       The associated error, {@code null} if not
094         *                    specified.
095         * @param clientID    The associated client identifier. Must not be
096         *                    {@code null}.
097         * @param redirectURI The associated redirection URI. Must not be
098         *                    {@code null}.
099         * @param state       The optional associated state parameter, 
100         *                    {@code null} if not specified.
101         * @param cause       The exception cause, {@code null} if not
102         *                    specified.
103         */
104        public ParseException(final String message, 
105                              final ErrorObject error,
106                              final ClientID clientID,
107                              final URI redirectURI,
108                              final State state,
109                              final Throwable cause) {
110
111                super(message, error, clientID, redirectURI, state, cause);
112        }
113}