Skip to main content

Blog Archive for malenkov during August 2006

This is a sequel of my first article about Enums encoding. As you may know, Type-Safe Enums were proposed by Joshua Bloch in Effective Java, but they are not supported by XMLEncoder. This article describes how to encode them into XML properly. Let's create a simple Type-Safe Enum with static method to test encoding into XML: import java.beans.XMLEncoder;import java.io.ByteArrayOutputStream;...
As you may know, Enums were introduced in Tiger, but they are not supported by XMLEncoder. This article describes how to encode them into XML properly. Let's create a simple Enum with static method to test encoding into XML: import java.beans.XMLEncoder;import java.io.ByteArrayOutputStream;public enum TestEnum {    LEFT, RIGHT;    public static void main( String...