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.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                    _type = 0;
038            }
039    
040            public LocaleException(int type) {
041                    _type = type;
042            }
043    
044            public LocaleException(int type, String msg) {
045                    super(msg);
046    
047                    _type = type;
048            }
049    
050            public LocaleException(int type, String msg, Throwable cause) {
051                    super(msg, cause);
052    
053                    _type = type;
054            }
055    
056            public LocaleException(int type, Throwable cause) {
057                    super(cause);
058    
059                    _type = type;
060            }
061    
062            public Locale[] getSourceAvailableLocales() {
063                    return _sourceAvailableLocales;
064            }
065    
066            public Locale[] getTargetAvailableLocales() {
067                    return _targetAvailableLocales;
068            }
069    
070            public int getType() {
071                    return _type;
072            }
073    
074            public void setSourceAvailableLocales(Locale[] sourceAvailableLocales) {
075                    _sourceAvailableLocales = sourceAvailableLocales;
076            }
077    
078            public void setTargetAvailableLocales(Locale[] targetAvailableLocales) {
079                    _targetAvailableLocales = targetAvailableLocales;
080            }
081    
082            private Locale[] _sourceAvailableLocales;
083            private Locale[] _targetAvailableLocales;
084            private final int _type;
085    
086    }