Guest User

Untitled

a guest
Jan 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import java.io.File;
  2.  
  3. import javax.xml.bind.JAXBContext;
  4. import javax.xml.bind.JAXBException;
  5. import javax.xml.bind.Unmarshaller;
  6.  
  7.  
  8. public class Test {
  9.  
  10. /**
  11. * @param args
  12. */
  13. public static void main(String[] args) {
  14. /*int i = 1;
  15. HashMap<Integer, Integer> hm = new HashMap<>();
  16. System.out.println(i != hm.get(1));*/
  17.  
  18. try {
  19.  
  20. File file = new File("dbplresp.xml");
  21. JAXBContext jaxbContext = JAXBContext.newInstance(DBPLResponse.class);
  22.  
  23. Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
  24. DBPLResponse dbplResp = (DBPLResponse)jaxbUnmarshaller.unmarshal(file);
  25. System.out.println(dbplResp.getHeader().getRefId() + " " + dbplResp.getHeader().getStatusCode() + " " + dbplResp.getHeader().getStatusDesc());
  26. System.out.println(dbplResp.getDetail().getActivationCode());
  27. } catch (JAXBException e) {
  28. e.printStackTrace();
  29. }
  30.  
  31. }
  32.  
  33. }
Add Comment
Please, Sign In to add comment