001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.exception;
016    
017    import java.util.Collection;
018    import java.util.Locale;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class LocaleException extends PortalException {
024    
025            public static final int TYPE_CONTENT = 3;
026    
027            public static final int TYPE_DEFAULT = 4;
028    
029            public static final int TYPE_DISPLAY_SETTINGS = 1;
030    
031            public static final int TYPE_EXPORT_IMPORT = 2;
032    
033            public LocaleException() {
034                    _type = 0;
035            }
036    
037            public LocaleException(int type) {
038                    _type = type;
039            }
040    
041            public LocaleException(int type, String msg) {
042                    super(msg);
043    
044                    _type = type;
045            }
046    
047            public LocaleException(int type, String msg, Throwable cause) {
048                    super(msg, cause);
049    
050                    _type = type;
051            }
052    
053            public LocaleException(int type, Throwable cause) {
054                    super(cause);
055    
056                    _type = type;
057            }
058    
059            public Collection<Locale> getSourceAvailableLocales() {
060                    return _sourceAvailableLocales;
061            }
062    
063            public Collection<Locale> getTargetAvailableLocales() {
064                    return _targetAvailableLocales;
065            }
066    
067            public int getType() {
068                    return _type;
069            }
070    
071            public void setSourceAvailableLocales(
072                    Collection<Locale> sourceAvailableLocales) {
073    
074                    _sourceAvailableLocales = sourceAvailableLocales;
075            }
076    
077            public void setTargetAvailableLocales(
078                    Collection<Locale> targetAvailableLocales) {
079    
080                    _targetAvailableLocales = targetAvailableLocales;
081            }
082    
083            private Collection<Locale> _sourceAvailableLocales;
084            private Collection<Locale> _targetAvailableLocales;
085            private final int _type;
086    
087    }