Hello,

I have two getters which return data from the same field but in slightly
different ways, for example,

private List<String> list;

with

List<String> getStringsInReverse() {
}
List<String> getStrings() {
}

I want to marhsall only one of these. Castor seems to be using the getters
(the field is actually private), so I'll get both the list of strings and
the list of strings in reverse in the XML. Can can I prevent one of these
getters being used, so it'll marshall only the strings to XML?

I've tried, <bind-xml transient="true" /> but becuase this is for a
field(?), it gives the following error;


Caused by: java.lang.IllegalArgumentException: list is not a valid
FieldMappingCollectionType
        at
org.exolab.castor.mapping.xml.types.FieldMappingCollectionType.valueOf(FieldMappingCollectionType.java:254)
        at
org.exolab.castor.xml.XMLMappingLoader.createFieldDesc(XMLMappingLoader.java:629)
        at
org.exolab.castor.mapping.loader.AbstractMappingLoader.createFieldDescriptors(AbstractMappingLoader.java:415)
        at
org.exolab.castor.xml.XMLMappingLoader.createClassDescriptor(XMLMappingLoader.java:237)
        at
org.exolab.castor.mapping.loader.AbstractMappingLoader.createClassDescriptors(AbstractMappingLoader.java:262)
        at
org.exolab.castor.xml.XMLMappingLoader.loadMapping(XMLMappingLoader.java:156)
        at
org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:162)
        at
org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmarshaller.java:128)
        at org.exolab.castor.xml.Marshaller.setMapping(Marshaller.java:556)


-- 
View this message in context: 
http://www.nabble.com/-XML--Stopping-getters-being-called-to-marhsall-to-XML-tp17049576p17049576.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to