You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by David payam <ot...@yahoo.ca> on 2002/11/27 20:53:05 UTC
serialization/deserialization help!
hi:
I have a class definition like this:
----------------------------------------------
public class TaskBroker{
public class Task {
public int taskType = 111;
public String taskName = "tttt";
public int taskCost = 121;
final int CO = 0;
final int NC = 1;
public int GetCost(){
return taskCost;
}
public boolean IsCooperativeWork(){
return taskType==CO;
}
public boolean IsNotCooperativeWork(){
return taskType==NC;
}
Task ( int tasktype)
{ taskType = tasktype;}
}
public class Person {
public String personName = "www";
public int personMoney = 9999;
public String toString()
{
return getStringVal("", this);
}
public String getStringVal(String indent, Person
topLevel)
{
String ret = "\n" + indent + "Person:\n";
ret += indent + " Name [" + personName
+ "]\n";
ret += indent + " Money ["+
personMoney+"]\n";
return ret;
}
}
TaskBroker()
{
System.out.println("1111");
}
}
----------------------------------------------
I have read the encoding sample and can serialize
the class Task and Person separately.
but I don't know how to serialize the composite
class - TaskBroker.
So I have to follow the encoding sample to create
serialize/deserialize class for it?
Anyone can give me an serializtion example for the
composite class?
Thanks a lot!
David
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca