Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.3
-
Fix Version/s: 1.x Maintenance
-
Component/s: Converters
-
Labels:None
-
JDK version and platform:jdk 1.5 / 1.6
Description
The class EnumSingleValueConverter could be changed to read enum im lower case format:
@XStreamAlias("protocol")
class Protocol{
@XStreamAsAttribute
TYPE type;
}
enum TYPE {
ASCII,BINARY;
}
Xml format:
<protocol type="ascii"/>
I think a change is simple and very useful,needs only a toUpperCase and toLowerCase on convert method.
The values are case sensitive, it is no problem to define
enum TYPE { ASCII, ascii; }
However, starting with XStream 1.3.1 you can register custom converters for enums and support such a functionality on your own, if you need it. Have a look at the EnumCustomConverterTest that actually has such an implementation.