public final void afterPropertiesSet() throws Exception { try { jaxbContext = createJaxbContext(); } catch (JAXBException ex) { throw convertJaxbException(ex); } }
/** Returns a newly created JAXB marshaller. JAXB marshallers are not necessarily thread safe. */ protected Marshaller createMarshaller() { try { Marshaller marshaller = jaxbContext.createMarshaller(); if (marshallerProperties != null) { for (Iterator iterator = marshallerProperties.keySet().iterator(); iterator.hasNext();) { String name = (String) iterator.next(); marshaller.setProperty(name, marshallerProperties.get(name)); } } if (validationEventHandler != null) { marshaller.setEventHandler(validationEventHandler); } initJaxbMarshaller(marshaller); return marshaller; } catch (JAXBException ex) { throw convertJaxbException(ex); } }
/** Returns a newly created JAXB unmarshaller. JAXB unmarshallers are not necessarily thread safe. */ protected Unmarshaller createUnmarshaller() { try { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); if (unmarshallerProperties != null) { for (Iterator iterator = unmarshallerProperties.keySet().iterator(); iterator.hasNext();) { String name = (String) iterator.next(); unmarshaller.setProperty(name, unmarshallerProperties.get(name)); } } if (validationEventHandler != null) { unmarshaller.setEventHandler(validationEventHandler); } initJaxbUnmarshaller(unmarshaller); return unmarshaller; } catch (JAXBException ex) { throw convertJaxbException(ex); } }