P
Paul Kaiser
I experienced some weirdness and want to find out if it is me or
XMLEncoder.
I have a class, Administrator, that has several properties; one of
them being isid, which is a String. The getter/setters are:
private String isid;
public String getIsid() { return (this.isid); }
public void setIsid(String isid) { this.isid = isid; }
The Administrator objects were getting encoded and decoded just fine.
When I wanted to force the value of isid to all upper case, I changed
the getter/setter to:
private String isid;
public String getIsid() { return (this.isid.toUpperCase()); }
public void setIsid(String isid) { this.isid = isid.toUpperCase(); }
With this change, XMLEncoder stopped encoding the isid property
altogether. After a bit of gnashing, I reverted the getter/setter to
the original and it worked just fine. I don't understand why the
method implementation would cause a change in what XMLEncoder
considers a public property. I thought it would simply look for things
that have public get<VariableName>() and set<VariableName>() methods.
Does anyone have any thoughts?
Thanks,
Paul
XMLEncoder.
I have a class, Administrator, that has several properties; one of
them being isid, which is a String. The getter/setters are:
private String isid;
public String getIsid() { return (this.isid); }
public void setIsid(String isid) { this.isid = isid; }
The Administrator objects were getting encoded and decoded just fine.
When I wanted to force the value of isid to all upper case, I changed
the getter/setter to:
private String isid;
public String getIsid() { return (this.isid.toUpperCase()); }
public void setIsid(String isid) { this.isid = isid.toUpperCase(); }
With this change, XMLEncoder stopped encoding the isid property
altogether. After a bit of gnashing, I reverted the getter/setter to
the original and it worked just fine. I don't understand why the
method implementation would cause a change in what XMLEncoder
considers a public property. I thought it would simply look for things
that have public get<VariableName>() and set<VariableName>() methods.
Does anyone have any thoughts?
Thanks,
Paul