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