Announcement Announcement Module
Collapse
No announcement yet.
How to populate tokenizers and fieldsetmappers dynamically? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to populate tokenizers and fieldsetmappers dynamically?

    Hi All,

    I working on a POC using spring batch that reads a flat file and reads the file line by line and on the basis of first character of line we have to make a decision that which tokenizer and fieldsetmapper be used?
    This decision we are making in the overriden doread().

    below is the code snippet of my context.xml
    <beans bean id="customIPACReader"
    class="org.frb.rich.ipac.IPACCustomFileReaderX">
    <beans property name="resource" ref="ipacFile" />
    <beans property name="linesToSkip" value="1" />
    <beans property name="lineMapper">
    <beans bean class="org.springframework.batch.item.file.mapping .PatternMatchingCompositeLineMapper">
    <beans bean class="org.frb.rich.ipac.IPACPopulateTokenizer">
    <bean property name="tokenizers" value="#{tokenizers}"/>
    <beans property name="fieldSetMappers" value="#{fieldSetMappers}"/>
    </beans bean>
    </beans property>
    </beans bean>
    Please provide me any suggestions or any sample available.

    Thanks

    Jon
    Last edited by maran001.nilay; Nov 9th, 2011, 02:32 PM.
Working...
X