SWF-1250 Replace extensions of deprecated LabeledEnum with Java 5 enum instead of having a StringToLabeledEnumConverter registered with the ConversionService

This commit is contained in:
Rossen Stoyanchev
2010-06-09 15:39:25 +00:00
parent 3d6d1d1566
commit fa0c1f4222
13 changed files with 57 additions and 102 deletions

View File

@@ -21,7 +21,6 @@ import java.util.Date;
import java.util.Locale;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.enums.LabeledEnum;
/**
* Default, local implementation of a conversion service. Will automatically register <i>from string</i> converters for
@@ -75,7 +74,6 @@ public class DefaultConversionService extends GenericConversionService {
addAlias("bigDecimal", BigDecimal.class);
addAlias("locale", Locale.class);
addAlias("date", Date.class);
addAlias("labeledEnum", LabeledEnum.class);
}
}

View File

@@ -15,8 +15,6 @@
*/
package org.springframework.binding.message;
import org.springframework.core.enums.StaticLabeledEnum;
/**
* Enum exposing supported message severities.
*
@@ -24,30 +22,27 @@ import org.springframework.core.enums.StaticLabeledEnum;
* @author Jeremy Grelle
* @see Message
*/
public class Severity extends StaticLabeledEnum {
public enum Severity {
/**
* The "Informational" severity. Used to indicate a successful operation or result.
*/
public static final Severity INFO = new Severity(0, "Info");
INFO,
/**
* The "Warning" severity. Used to indicate there is a minor problem, or to inform the message receiver of possible
* misuse, or to indicate a problem may arise in the future.
*/
public static final Severity WARNING = new Severity(1, "Warning");
WARNING,
/**
* The "Error" severity. Used to indicate a significant problem like a business rule violation.
*/
public static final Severity ERROR = new Severity(2, "Error");
ERROR,
/**
* The "Fatal" severity. Used to indicate a fatal problem like a system error.
*/
public static final Severity FATAL = new Severity(3, "Fatal");
FATAL
private Severity(int code, String label) {
super(code, label);
}
}