blob: 18cd3ca73a143e9d3c842ffcdf2e54ce0b7a5080 (
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
|
/*******************************************************************************
* 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.ui.internal.validation;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.jst.jsf.common.internal.strategy.IIdentifiableStrategy;
/**
* A strategy for overriding the severity of diagnostics.
*/
abstract class SeverityOverrideStrategy implements IIdentifiableStrategy<Diagnostic, Integer, String>
{
private final String _id;
public SeverityOverrideStrategy(final String id)
{
_id = id;
}
public abstract Integer override(Diagnostic diagnostic);
public abstract String getDisplayName();
public Integer getNoResult()
{
return Integer.valueOf(-1);
}
public final Integer perform(Diagnostic diagnostic) throws Exception
{
return override(diagnostic);
}
public final String getId()
{
return _id;
}
}
|