0

I'm using Spring shell to develop command shell for my project.

the problem is as i described below: i need to have some functionality like method overloading in shell. in other words i need to have two commands with same name but different options. I googled it and found some ideas like overriding parser interface, but i did not find any samples over internet.

any suggestions will be helpful.

Thank for your help.

Sajad NasiriNezhad
  • 699
  • 1
  • 7
  • 27

1 Answers1

0

You need to implement org.springframework.shell.core.Converter and add @Component to it.

enem.dev
  • 124
  • 4
  • Thanks for your help. I know that i should to implements org.springframework.shell.core.Converter and add @Component to it, but i dont know where and how. would you give me an example? – Sajad NasiriNezhad Sep 14 '15 at 07:06
  • "Where" is rather irrelevant as long as you have your class within the spring application context, i.e. having the component scan configured properly. Giving an example for setting the whole ctx would be blown out of proportion here, i suggest you take a look at a spring tutorial (http://www.tutorialspoint.com/spring/spring_applicationcontext_container.htm as a quick reference.) – enem.dev Sep 14 '15 at 14:03