So it seems like you don't want to expose the Vector to Castor, but want Castor to use the Iterator during marshalling, correct ?
If that's the case, can you please have a look at http://castor.org/xml-mapping.html#3.4-The-%3Cfield%3E-element in general, and at the sub-section entitled 'Exceptions concerning collection fields:' in particular. There it should tell you that you can use methods that return 'java.util.Iterator' as a getter method as long as the method name starts with an 'iterate' prefix and you specify the method name through the <field>'s get-method attribute. I hope this helps Werner sourav chatterjee wrote: > The class looks like, > public class QuoteReq { > ..... > Vector equipmentTypes; > ..... > public Iterator getEqTypes() { > return equipmentTypes.ListIterator(); > } > } > > mapping.xml entries, > <?xml version="1.0" encoding="UTF-8" ?> > <mapping> > <description>Mapping file</description> > <class cst:name="com.quote.QuoteReq"> > <description>Default mapping for class com.quote.QuoteReq</description> > <map-to cst:xml="quote-req" /> > ..... > ..... > <field cst:name="EqTypes" cst:type="java.lang.String" > cst:collection="vector"> > <bind-xml name="equipment-types" /> > </field> > ..... > ..... > </class> > </mapping> > > Thanks, > Humming > > ----- Original Message ---- > From: Werner Guttmann <[EMAIL PROTECTED]> > To: [email protected] > Sent: Tuesday, 31 October, 2006 2:08:49 PM > Subject: Re: [castor-user] Marshalling problem when get method returns > ListIterator over Collection attribute > > > Can you please show us the sources for the (relevant parts of the) class > in question and the mapping file ? > > Werner > > sourav chatterjee wrote: >> Hi, >> >> I am facing problem with Castor while marshalling a Java object. The >> object I am going to marshal has a private attribute of type Vector >> and the getter method for this attribute returns a ListIterator over >> the Vector. So Castor is not able to clearly define the type of the >> attribute. In fact, it defines the type as >> ‘java.util.AbstractList$ListItr’ which is an invalid Java type. >> >> Has anybody faced this issue? Please give me some inputs to solve >> this. I expect it may be some mapping file attribute. But I don’t >> want to change the existing class, which might be the last option. >> >> Thanks, Humming >> >> >> __________________________________________________________ Yahoo! >> India Answers: Share what you know. Learn something new >> http://in.answers.yahoo.com/ >> >> --------------------------------------------------------------------- >> To unsubscribe from this list please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > > > __________________________________________________________ > Yahoo! India Answers: Share what you know. Learn something new > http://in.answers.yahoo.com/ > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

