Using Dozer framework for object mapping in java -
i using dozer framework object mapping in java.
now got stuck because of following problem:
following classes:
public class basequestion { public string question = ""; public string answer = ""; /** * getter question */ public string getquestion() { return question; } /** * @setter question */ public void setquestion(string question) { this.question = question; } /** * getter answer */ public string getanswer() { return answer; } /** * @setter answer */ public void setanswer(string answer) { this.answer = answer; } } public class questionsmap { question[] question; public void setquestion(question[] question) { this.question = question; } public question[] getquestion() { return this.question; } } in above classes have map questionsmap class hashmap below: map<string,string> questionsmap=new hashmap<string,string>(); basequestion[] question=questionsmap.getquestion(); questionsmap.put(question[0].getquestion(),question[0].getanswer()); questionsmap.put(question[1].getquestion(),question[1].getanswer()); questionsmap.put(question[2].getquestion(),question[2].getanswer()); questionsmap.put(question[3].getquestion(),question[3].getanswer());
can 1 suggest how can acheive using dozer framework.
thanks,
narendra
why want use dozer ??? looking for:
map<string,string> questionsmap=new hashmap<string,string>(); for(basequestion basequestion : questionmap.getquestion()){ questionmap.put(basequestion.getquestion(),basequestion.getanswer()); }
Comments
Post a Comment