Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Map<String,Department> nameToDeptMap= new HashMap<String,Department>();
  2.  
  3. Department is super class. Development,Testing,Requirment...etc are extending that class.
  4.  
  5.  
  6. <Company>
  7. <Employee empname="xyz" department ="com.compnayname.departments.department.Development>
  8. <Employee empname="xyza" department ="com.compnayname.departments.department.Testing>
  9. <Employee empname="xyzab" department ="com.compnayname.departments.department.Requiremetns>
  10. <Employee empname="xyzabc" department ="com.compnayname.departments.department.Production>
  11. .
  12. .
  13. .
  14. .
  15. </Company>
  16.  
  17. Digester digester = new Digester();
  18. digester.addObjectCreate("Company/Employee", Company.class);
  19. digester.addCallMethod("Company/Employee", "setComapnyConfigMap", 2);
  20. digester.addCallParam("Company/Employee", 0, "empname");
  21. digester.addCallParam("Company/Employee", 1, "department");
  22.  
  23.  
  24. :> Using JDK 1.6 , commons-digester-2.0.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement