001/**
002 *
003 * Copyright 2019-2021 Florian Schmaus
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smack.parsing;
018
019import java.net.URISyntaxException;
020import java.text.ParseException;
021
022public class SmackParsingException extends Exception {
023
024    /**
025     *
026     */
027    private static final long serialVersionUID = 1L;
028
029    protected SmackParsingException(Exception exception) {
030        super(exception);
031    }
032
033    public SmackParsingException(String message) {
034        super(message);
035    }
036
037    /**
038     * Deprecated, do not import.
039     * @deprecated do not import.
040     */
041    @Deprecated
042    // TODO: Remove in Smack 4.6.
043    public static class SmackTextParseException extends SmackParsingException {
044        /**
045         *
046         */
047        private static final long serialVersionUID = 1L;
048
049        /**
050         * Deprecated, do not use.
051         * @param parsingException the exception.
052         * @deprecated do not use, simply throw ParseException.
053         */
054        @Deprecated
055        public SmackTextParseException(ParseException parsingException) {
056            super(parsingException);
057        }
058    }
059
060    public static class SmackUriSyntaxParsingException extends SmackParsingException {
061        /**
062         *
063         */
064        private static final long serialVersionUID = 1L;
065
066        public SmackUriSyntaxParsingException(URISyntaxException uriSyntaxException) {
067            super(uriSyntaxException);
068        }
069    }
070
071    public static class RequiredValueMissingException extends SmackParsingException {
072        /**
073        *
074        */
075       private static final long serialVersionUID = 1L;
076
077       public RequiredValueMissingException(String message) {
078            super(message);
079        }
080
081    }
082
083    public static class RequiredAttributeMissingException extends RequiredValueMissingException {
084        /**
085        *
086        */
087       private static final long serialVersionUID = 1L;
088
089       public RequiredAttributeMissingException(String attributeName) {
090            super("The required attribute '" + attributeName + "' is missing (or has the empty String as value)");
091        }
092
093    }
094}