The following code doesn't work. I got exception when I run these line[Object objPoints = serializer.read(Point.class, file);] In details, the source attachment doesn't contain the source for the Persister.class.
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import java.io.File;
Serializer serializer = new Persister();
File file = new File("1.xml");
Object objPoints = serializer.read(Point.class, file);
Point Class is as follow :
@Root
public class Point {
@Element
private float X;
@Element
private float Y;
}
I references from this link.
Serializerclass?readnotreaandfilewill be passed in without the leading>. Make sure you post your real code, please.