User Objects in SVG Read-Write

I have user objects that inherit from the standard nodes and links in JGo. When I try to read and write them they do not persist across the process. I havetried a test in one of the objects to just get a couple of values and the read process does not understand the saved type. How do I get the SVGReadDoc method to understand a user object? Here are the 2 methods I overrode in my objects.
public void SVGWriteObject(DomDoc svgDoc, DomElement jGoElementGroup) {
// Add UserIconicNode element
DomElement jgoUserIconicNode = svgDoc.createJGoClassElement(“com.integic.epower.ui.web.mapb uilder.StartTaskNode”, jGoElementGroup);
if ((this.getCurrentTask() != null) && (this.getCurrentTask() instanceof Task)) {
// Save your UserObject data here, or call method on UserObject to do so.
String s = (String)getCurrentTask().getDescription();
jgoUserIconicNode.setAttribute(“description”, s);
jgoUserIconicNode.setAttribute(“id”, Integer.toString(getCurrentTask().getId()));
// Have superclass add to the JGoObject group
super.SVGWriteObject(svgDoc, jGoElementGroup);
public DomNode SVGReadObject(DomDoc svgDoc, JGoDocument jGoDoc, DomElement svgElement, DomElement jGoChildElement) {
if (jGoChildElement != null) {
// This is a UserIconicNode element
// Read your UserObject data here, or call method on UserObject to do so.
getCurrentTask().setDescription(jGoChildElement.getAttribute (“description”));
getCurrentTask().setId(Integer.parseInt(jGoChildElement.getA ttribute(“id”)));
super.SVGReadObject(svgDoc, jGoDoc, svgElement,
return svgElement.getNextSibling();


I’m surprised! Your code looks fine. Of course, you’re not saving or creating a UserObject, but the saving and restoring of the attributes on your StartTaskNode should work.
When you look at the generated XML for your StartTaskNode do you see the “id” and “description” attributes written out properly?
You might want to separate out the getting of the attributes and the setId() and setDescription() methods just to make sure you understand where the problem is happening.

Hi Donald,

do you obfuscate your source code? You need to make sure that the class file name (package) still exists after obfuscation.

Kind regards,