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;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    
019    import java.util.Collection;
020    import java.util.Locale;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class LocaleException extends PortalException {
026    
027            public static final int TYPE_CONTENT = 3;
028    
029            public static final int TYPE_DEFAULT = 4;
030    
031            public static final int TYPE_DISPLAY_SETTINGS = 1;
032    
033            public static final int TYPE_EXPORT_IMPORT = 2;
034    
035            public LocaleException() {
036                    _type = 0;
037            }
038    
039            public LocaleException(int type) {
040                    _type = type;
041            }
042    
043            public LocaleException(int type, String msg) {
044                    super(msg);
045    
046                    _type = type;
047            }
048    
049            public LocaleException(int type, String msg, Throwable cause) {
050                    super(msg, cause);
051    
052                    _type = type;
053            }
054    
055            public LocaleException(int type, Throwable cause) {
056                    super(cause);
057    
058                    _type = type;
059            }
060    
061            public Collection<Locale> getSourceAvailableLocales() {
062                    return _sourceAvailableLocales;
063            }
064    
065            public Collection<Locale> getTargetAvailableLocales() {
066                    return _targetAvailableLocales;
067            }
068    
069            public int getType() {
070                    return _type;
071            }
072    
073            public void setSourceAvailableLocales(
074                    Collection<Locale> sourceAvailableLocales) {
075    
076                    _sourceAvailableLocales = sourceAvailableLocales;
077            }
078    
079            public void setTargetAvailableLocales(
080                    Collection<Locale> targetAvailableLocales) {
081    
082                    _targetAvailableLocales = targetAvailableLocales;
083            }
084    
085            private Collection<Locale> _sourceAvailableLocales;
086            private Collection<Locale> _targetAvailableLocales;
087            private final int _type;
088    
089    }