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 private static final long serialVersionUID = 5717029305138222869L; 034 035 036 /** 037 * Creates a new parse exception. 038 * 039 * @param message The exception message. May be {@code null}. 040 */ 041 public ParseException(final String message) { 042 043 this(message, null, null, null, null, null); 044 } 045 046 047 /** 048 * Creates a new parse exception. 049 * 050 * @param message The exception message. May be {@code null}. 051 * @param cause The exception cause, {@code null} if not specified. 052 */ 053 public ParseException(final String message, final Throwable cause) { 054 055 this(message, null, null, null, null, null, cause); 056 } 057 058 059 /** 060 * Creates a new parse exception. 061 * 062 * @param message The exception message. May be {@code null}. 063 * @param error The associated error, {@code null} if not specified. 064 */ 065 public ParseException(final String message, final ErrorObject error) { 066 067 this(message, error, null, null, null, null); 068 } 069 070 071 /** 072 * Creates a new parse exception. 073 * 074 * @param message The exception message. May be {@code null}. 075 * @param error The associated error, {@code null} if not specified. 076 * @param cause The exception cause, {@code null} if not specified. 077 */ 078 public ParseException(final String message, 079 final ErrorObject error, 080 final Throwable cause) { 081 082 this(message, error, null, null, null, null, cause); 083 } 084 085 086 /** 087 * Creates a new parse exception. 088 * 089 * @param message The exception message. May be {@code null}. 090 * @param error The associated error, {@code null} if not 091 * specified. 092 * @param clientID The associated client identifier. Must not be 093 * {@code null}. 094 * @param redirectURI The associated redirection URI. Must not be 095 * {@code null}. 096 * @param responseMode The optional associated response mode, 097 * {@code null} if not specified. 098 * @param state The optional associated state parameter, 099 * {@code null} if not specified. 100 */ 101 public ParseException(final String message, 102 final ErrorObject error, 103 final ClientID clientID, 104 final URI redirectURI, 105 final ResponseMode responseMode, 106 final State state) { 107 108 this(message, error, clientID, redirectURI, responseMode, state, null); 109 } 110 111 112 /** 113 * Creates a new parse exception. 114 * 115 * @param message The exception message. May be {@code null}. 116 * @param error The associated error, {@code null} if not 117 * specified. 118 * @param clientID The associated client identifier. Must not be 119 * {@code null}. 120 * @param redirectURI The associated redirection URI. Must not be 121 * {@code null}. 122 * @param responseMode The optional associated response mode, 123 * {@code null} if not specified. 124 * @param state The optional associated state parameter, 125 * {@code null} if not specified. 126 * @param cause The exception cause, {@code null} if not 127 * specified. 128 */ 129 public ParseException(final String message, 130 final ErrorObject error, 131 final ClientID clientID, 132 final URI redirectURI, 133 final ResponseMode responseMode, 134 final State state, 135 final Throwable cause) { 136 137 super(message, error, clientID, redirectURI, responseMode, state, cause); 138 } 139}