Exemple #1
0
 /** Used to retrieve the root document bound through JAXB */
 private static void getRootDocument() {
   if (rDocument == null) {
     try {
       JAXBContext jaxbCtxt = JAXBContext.newInstance("odin.odin.xml");
       Unmarshaller jaxbU = jaxbCtxt.createUnmarshaller();
       jaxbU.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
       File fRoot = new File("home.root.xml");
       JAXBElement<Root> rElement = jaxbU.unmarshal(new StreamSource(fRoot), Root.class);
       rDocument = rElement.getValue();
     } catch (JAXBException jaxbX) {
       System.err.println(
           "An error was caught while trying to read information from the server's root information document.");
       jaxbX.printStackTrace();
     }
   }
 }