001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }