001/**
002 *
003 * Copyright 2019-2020 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    public static class SmackTextParseException extends SmackParsingException {
038        /**
039         *
040         */
041        private static final long serialVersionUID = 1L;
042
043        public SmackTextParseException(ParseException parsingException) {
044            super(parsingException);
045        }
046    }
047
048    public static class SmackUriSyntaxParsingException extends SmackParsingException {
049        /**
050         *
051         */
052        private static final long serialVersionUID = 1L;
053
054        public SmackUriSyntaxParsingException(URISyntaxException uriSyntaxException) {
055            super(uriSyntaxException);
056        }
057    }
058
059    public static class RequiredValueMissingException extends SmackParsingException {
060        /**
061        *
062        */
063       private static final long serialVersionUID = 1L;
064
065       public RequiredValueMissingException(String message) {
066            super(message);
067        }
068
069    }
070
071    public static class RequiredAttributeMissingException extends RequiredValueMissingException {
072        /**
073        *
074        */
075       private static final long serialVersionUID = 1L;
076
077       public RequiredAttributeMissingException(String attributeName) {
078            super("The required attribute '" + attributeName + "' is missing (or has the empty String as value)");
079        }
080
081    }
082}