• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

How to Inject ServiceImplementation accordig to the Condition.

Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Ranchers,

I am facing some a problem for injecting my service instance of controller using IoC... I want to import the csv file and parse it according to the type. here type provides me which parse method i can use for parsing the csv file. Following is the classes i am using:

And i have the specific implementation of this ParseService according to the CSV file i.e if i am importing the Student record then i have StudentParseServiceImpl likewise if i am importing the Employee then i have EmployeeParseServiceImpl class.

now in my ImportController i have

parseService instance which i want to inject using the specific implementation of PraseService as mentioned earlier.

So, the question is How can i inject parseService at run-time using the type of file i am importing ?


Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic