Hi Martin I've implemented your numerous patches - many thanks!
The only minor change I made was to use 2 spaces as the default pretty-print indentation, which was what it was meant to be all along (though thanks to your patches it now actually works!). I've updated the website to reflect these changes. Keep up the great work Martin! James ----- Original Message ----- From: "Martin van den Bemt" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 1:05 AM Subject: [PATCH] BETWIXT A lot of fixes... > Hi everyone, > > Fixed/Changed the following things : > > - Indention > The indention didn't work the way it supposed to. If you set the > indention level to eg 2 spaces, it would add 4 spaces. > Since the defaultbehaviour of prettyPrint() was 4 spaces, I made sure > that it still works that way. > If I know call setIndent(" "); it will actually use 2 spaces.. > - wrapCollectionsInElement > This wasn't implemented at all. The default behaviour was to wrap them > in collections and I kept it that way (even though the default was not > to). It now correctly parses xml files in the format (when setting this > option to false): > <element> > <subelement/> > <subelement/> > </element> > The default behaviour of this will be : > <element> > <subelements> > <subelement/> > <subelement/> > </subelements> > <element> > I needed to add an extra getter/setter to the ElementDescriptor to get > this done correctly and without changing to much code. > - setNameMapper > Deprecated this in favour if setElementNameMapper and > setAttributeNameMapper. If you just set setElementNameMapper, the > setAttributeNameMapper will use the same NameMapper that is used in > setElemementNameMapper. This is the way it worked, and we need to keep > backward compatible. The original nameMapper works as the > ElementNameMapper. > > - DefaultPluralStemmer > Was a bit freely implemented when multiple matches were found. > Say the property to get was "y" and the valaues in the map are "y", > "yes", "yesno", it could return eg yesno, when you actually want y. > I added a "best match" policy, which will always return the equals, when > it is found or the closest match. (the match with the minimum length). > Don't know if in real life this can actually happen, but in the testcase > it can ;). It does a log.warn to actually say that we are using a > certain match. > > Tests : > > - The tests currently in cvs are all passing, without change. > - Tested maven from cvs with the new jar and it works (I will also > supply a patch for maven when this is committed). > - Didn't test the current scarab (John, just your NameMapper call is > giving a deprecated message on compile) > - Adjusted the maven testcase in betwixt to use the ElementNameMapper. > - Added testcases for the strategy package, so we can insure the current > behaviour will stay the same and if not, we actually get a failing > testcase. > - Added testcase for my specific xml file, which started all this > programming in the first place. I added a new test package called > org.apache.commons.betwixt.schema. The testcase is pretty well > documented and can be used nicely as example code. > > unknowns : > > - The .betwixt files. I didn't dig into that, and didn't check if my > changes break anything, if it isn't covered by tests, that is.. > - The decapitalizeNameMapper changes FooBar to fooBar. Decapitalization > (at least the way I use/know the word), should return foobar. Let me > know if it needs "fixing". > > Still broken : > > The demo.<whatever> targets are broken (has nothing to do with my > patches btw). The error is : maven.dependency.classpath not found.. > > Have fun ;) > > Mvgr, > Martin > ---------------------------------------------------------------------------- ---- > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>