commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Aust <christ...@wilde-welt.de>
Subject Re: [betwixt] How can I make betwixt accept any attribute "id" as an element id?
Date Mon, 10 Jan 2005 15:50:29 GMT
Jason Wood schrieb:
> Well, I know you can do the following to remove the betwixt id ...
> 
> beanWriter.getBindingConfiguration().setMapIDs(false);
> 
> Then if you want to make the getId() value of your bean an attribute ...
> 
> beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitive
> s(false);
> 
> or if you don't want to make all primitive values attribute as the above
> will do ... in a .betwixt file write ...
> 
> <?xml version='1.0' encoding='UTF-8' ?>
> <info>
> <element name='YourElementName'>
>   <attribute name='id' property='Id'/>
>   <addDefaults/>
> </element>
> </info>
> 
> There ways to do this by code but, not familar with that approach.

It works now, thanks. That property='Id' had to be lowercase 'id' to 
work for me, otherwise the NPE. Best regards,

-  Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message