[Flatworm-users] Help on Repeating Segments
Brought to you by:
blackbearnh,
dderry
From: Rodrigo C. <roc...@gm...> - 2013-11-21 19:24:10
|
Hi Guys, I'm Rodrigo Camargo from Brazil and I'm testing the flatworm for a big project I have here. The point I didn't get it very well is the repeating segments. The only example at Flatworm website is using the pipe separated string, but I intent to use it by position defined. So I changed my XML accordingly and this is not working. The "add" method is not being called. There is no error also, and I'm lost. Could you please send me an example of a simple configuration like this: To be parsed: ABC.......DEF.....DEF.....DEF..... (maybe more DEF ahead) So, the main bean is ABC with three segments DEF. What I did is after the configuration of ABC (which is working by the way), I've included the <segment-element> with the DEF bean. <?xml version="1.0" encoding="ISO-8859-1"?> <file-format> <converter name="char" class="com.blackbear.flatworm.converters.CoreConverters" method="convertChar" return-type="java.lang.String"/> <converter name="decimal" class="com.blackbear.flatworm.converters.CoreConverters" method="convertDecimal" return-type="java.lang.Double"/> <record name="ABC"> <record-ident> <field-ident field-start="0" field-length="3"> <match-string>ABC</match-string> </field-ident> </record-ident> <record-definition> <bean name="abc" class="com.mypackage.ABC"/> <bean name="def" class="com.mypackage.DEF"/> <line> ... (fields for ABC) <segment-element parent-beanref="com.mypackage.ABC" addMethod="addDEF" beanref="com.mypackage.DEF" minCount="1" maxCount="2" cardinality-mode="STRICT"> <field-ident field-start="0" field-length="3"> <match-string>DEF</match-string> </field-ident> <record-element length="3" beanref="def.type" type="char"/> ... (other elements of def) </segment-element> </line> </record-definition> </record> </file-format> This is not working and there is neither error nor warnings. Could you please help? Thanks a lot, RODRIGO CAMARGO roc...@gm... |