I am using for marshalling my JAVA object. I wanted to ask the following thing:

 

My object has 10 fields as part of it. Now suppose if I set values of 4 fields and leave rest 6 fields empty. Now I marshal my object.

 

So I think all 10 fields would be there in my XML.4 fields would have values and rest 6 fields would be marshaled as empty fields.

 

My Question: Since I am not sure which all values will be set by my program, so is there any way out that I can just marshal the values which are set and not every fields. I cant mark any field as transient because at times this field would be set and at times it wont be.

 

I don’t want any blank fields in my XML.

 

Any help in this regard would be appreciated,

 

Thanks in advance,

Saurabh

Reply via email to