Advertisement
Bleser

Untitled

Sep 6th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import javax.xml.bind.JAXBException;
  2. import java.io.File;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) {
  7. Parser parser = new JaxbParser();
  8. File file = new File("elements.xml");
  9.  
  10.  
  11. JaxbRoot root = new JaxbRoot();
  12. try {
  13. parser.saveObject(file, root);
  14. System.out.println(parser.getObject(file, JaxbRoot.class));
  15.  
  16. } catch (JAXBException e) {
  17. e.printStackTrace();
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement