public abstract class EnumConverter<E extends java.lang.Enum<E>> extends java.lang.Object implements ValueConverter<E>
Enums.| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<E> |
clazz |
private java.lang.String |
delimiters |
| Modifier | Constructor and Description |
|---|---|
protected |
EnumConverter(java.lang.Class<E> clazz)
This constructor must be called by subclasses, providing the enum class as the parameter.
|
| Modifier and Type | Method and Description |
|---|---|
E |
convert(java.lang.String value)
Converts the given string value into a Java type.
|
private java.lang.String |
message(java.lang.String value) |
void |
setDelimiters(java.lang.String delimiters)
Sets the delimiters for the message string.
|
java.lang.String |
valuePattern()
Gives a string that describes the pattern of the values this converter expects, if any.
|
java.lang.Class<E> |
valueType()
Gives the class of the type of values this converter converts to.
|
protected EnumConverter(java.lang.Class<E> clazz)
clazz - enum classpublic E convert(java.lang.String value)
ValueConverterconvert in interface ValueConverter<E extends java.lang.Enum<E>>value - the string to convertpublic java.lang.Class<E> valueType()
ValueConvertervalueType in interface ValueConverter<E extends java.lang.Enum<E>>public void setDelimiters(java.lang.String delimiters)
delimiters - delimiters for message string. Default is [,]public java.lang.String valuePattern()
ValueConverterdate format string.valuePattern in interface ValueConverter<E extends java.lang.Enum<E>>null if there's nothing interesting hereprivate java.lang.String message(java.lang.String value)