Skip to main content
summaryrefslogtreecommitdiffstats
blob: b3d2e25e9bf95b02b4a8dcb7982e250ead71e3ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*******************************************************************************
 * Copyright (c) 2001, 2008 Oracle Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Oracle Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.jsf.common.internal.types;

import org.eclipse.emf.common.util.Diagnostic;

/**
 * Preference info for type comparator diagnostics
 * 
 * @author cbateman
 *
 */
public class TypeComparatorPreferences
{

    /**
     * @param diagnosticId
     * @return the default severity of a diagnostic
     */
    public int getDefaultSeverity(final int diagnosticId)
    {
        switch (diagnosticId)
        {
            case TypeComparatorDiagnosticFactory.METHOD_EXPRESSION_EXPECTED_ID:
                return Diagnostic.ERROR;
            case TypeComparatorDiagnosticFactory.INCOMPATIBLE_TYPES_ID:
                return Diagnostic.INFO;
            case TypeComparatorDiagnosticFactory.VALUE_EXPRESSION_EXPECTED_ID:
                return Diagnostic.ERROR;
            case TypeComparatorDiagnosticFactory.INCOMPATIBLE_METHOD_TYPES_ID:
                return Diagnostic.WARNING; /* Bug 243674 */
            case TypeComparatorDiagnosticFactory.PROPERTY_NOT_READABLE_ID:
                return Diagnostic.WARNING;
            case TypeComparatorDiagnosticFactory.PROPERTY_NOT_WRITABLE_ID:
                return Diagnostic.WARNING;
            default:
                throw new IllegalArgumentException("Diagnostic Id: "+ diagnosticId +" is out of range"); //$NON-NLS-1$ //$NON-NLS-2$

        }
    }

}

Back to the top