commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: Fwd: Managing XML Output from Betwixt
Date Thu, 06 Oct 2005 18:05:59 GMT
those of us who use filter will pick up questions much quicker if you
prefix the subject (add [betwixt]). see
http://wiki.apache.org/jakarta-commons/JakartaCommonsEtiquette.

On Mon, 2005-10-03 at 11:46 -0400, Sameer Nanda wrote:
> Well thanks again Russell,
> 
> Whatever you said is true, I can either rename my Class to a lowercase
> authorization (but then I am breaking the naming convention for writing Java
> classes which I dont wanna do) , and I could also run the replaceAll() on
> the XML string generated to replace all <Authorization> to <authorization>
> (but that would be a hack).
> 
> My point here is, it shouldnt have to be like that ....... theres gotta be
> something in Betwixt using which I can do this. I mean this is just one
> example I am talking here, I have to generate much more complex XML
> documents which would involve a lot of Java Bean Objects, which in turn
> would contain a bunch of other Java Beans. Do you know what I mean?

there are two different (complementary) ways to configure betwixt. you
can use strategies
(http://svn.apache.org/repos/asf/jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/)
to influence generic behaviour and dot betwixt files to specify mappings for a particular
class. these strategies are set on the appropriate configuration objects (IntrospectionConfiguration
on XMLIntrospector for introspection time strategies, BindingConfiguration for bind time strategies).

in general, to change the way that betwixt maps java names to xml names,
you need to replace the default NameMapper strategy.
CapitalizeNameMapper probably does what you need.

- robert


---------------------------------------------------------------------
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