Thanks for answering,
Can you elaborate more on the issues you pointed
out.
From this I understand is that if I have some simple
dataTypes in the HashMap for eg. int as key and String as value, would it work
?
and when you said "write your own", I do not understand
what do I have to write. Would the following code work ? I doubt it ?
Please guide me in my approach. All I want right now is to convert my hashmap
into 2 arrays, one with the keys and other with the values
public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { if (!(value instanceof HashMap)) throw new IOException("Can't serialize a " + value.getClass().getName() + " with a DataSerializer."); HashMap map = (HashMap)value; context.startElement(name, attributes); context.serialize(new QName("", MAP), null, map); context.endElement(); } Thank
You Once again,
Pritesh
--
All Computers wait at the same speed
!!
From: Michael Oliver [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 11:46 AM To: [EMAIL PROTECTED] Subject: RE: serializer for hashmap The problem is not so much the serialization of the Hashmap or Hashtable as it is the objects within them.
The JavaBean Encode and Decode will create XML to/from a JavaBean with a getter and setter for a Hashmap or Hashtable, but if there is an object stored in the Hashmap or Hashtable that is not serializable also with the JavaBean Encode/Decode methods then you are scrod and you must write your own.
Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [EMAIL PROTECTED] -----Original
Message-----
hello everyone,
has anyone successfully written a custome serializer for hashmap object so that it could be understood by .net ?? I mean, I was seeing the encoding example provided but that is only for some basic Object types I think, correct me if I am wrong.
Please help me with this.,
Pritesh
-- All Computers wait at the same speed !!
|
- serializer for hashmap Pritesh Damani
- RE: serializer for hashmap Michael Oliver
- RE: serializer for hashmap Pritesh Damani
- RE: serializer for hashmap Patrick Martin