@Override public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
/** * {@inheritDoc} */ @Override public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
/** * Delegates to the wrapped marshaller. */ @Override public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
@Override public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
/** * Delegates to the wrapped marshaller. */ @Override public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
@Override public ValidationEventHandler getEventHandler() throws JAXBException { return marshaller.getEventHandler(); }
@Override public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return jaxbMarshaller.getEventHandler(); }
public ValidationEventHandler getEventHandler() throws JAXBException { return getMarshaller().getEventHandler(); }
@Nonnull private static Marshaller _createMarshaller (@Nonnull final Class <?> aClass, @Nonnull final String sNamespaceURI, @Nullable final ValidationEventHandler aCustomEventHandler) throws JAXBException { // Since creating the JAXB context is quite cost intensive this is done // only once! final JAXBContext aJAXBContext = JAXBContextCache.getInstance ().getFromCache (aClass); // create an Unmarshaller final Marshaller aMarshaller = aJAXBContext.createMarshaller (); aMarshaller.setEventHandler (aCustomEventHandler != null ? aCustomEventHandler : new LoggingValidationEventHandler (aMarshaller.getEventHandler ())); // Validating! aMarshaller.setSchema (UBL20DocumentTypes.getSchemaOfNamespace (sNamespaceURI)); if (JAXBMarshallerUtils.isSunJAXB2Marshaller (aMarshaller)) { // It's the Sun JAXB implementation try { JAXBMarshallerUtils.setSunNamespacePrefixMapper (aMarshaller, UBL20NamespacePrefixMapper.getInstance ()); } catch (final NoClassDefFoundError ex) { s_aLogger.warn ("The com.sun.xml.bind:jaxb-impl artifact is missing in your classpath. Therefore no namespace mapping can be applied!"); } } return aMarshaller; }
/** * @return A marshaller for converting document to XML. Never * <code>null</code>. * @throws JAXBException * In case of an error. */ @Nonnull private Marshaller _createMarshaller () throws JAXBException { final Package aPackage = m_aType.getPackage (); final JAXBContext aJAXBContext = useJAXBContextCache () ? JAXBContextCache.getInstance ().getFromCache (aPackage) : JAXBContext.newInstance (aPackage.getName ()); // create an Unmarshaller final Marshaller aMarshaller = aJAXBContext.createMarshaller (); if (m_aVEHFactory != null) { // Create and set the event handler m_aLastEventHandler = m_aVEHFactory.create (aMarshaller.getEventHandler ()); aMarshaller.setEventHandler (m_aLastEventHandler); } else m_aLastEventHandler = null; JAXBMarshallerUtils.setFormattedOutput (aMarshaller, m_bWriteFormatted); // Set XSD (if any) final Schema aValidationSchema = createValidationSchema (); if (aValidationSchema != null) aMarshaller.setSchema (aValidationSchema); return aMarshaller; }
@Nonnull private static Marshaller _createMarshaller (@Nonnull final Class <?> aClass, @Nonnull final String sNamespaceURI, @Nullable final ValidationEventHandler aCustomEventHandler) throws JAXBException { // Since creating the JAXB context is quite cost intensive this is done // only once! final JAXBContext aJAXBContext = JAXBContextCache.getInstance ().getFromCache (aClass); // create an Unmarshaller final Marshaller aMarshaller = aJAXBContext.createMarshaller (); aMarshaller.setEventHandler (aCustomEventHandler != null ? aCustomEventHandler : new LoggingValidationEventHandler (aMarshaller.getEventHandler ())); // Validating! aMarshaller.setSchema (UBL21DocumentTypes.getSchemaOfNamespace (sNamespaceURI)); if (JAXBMarshallerUtils.isSunJAXB2Marshaller (aMarshaller)) { // It's the Sun JAXB implementation try { JAXBMarshallerUtils.setSunNamespacePrefixMapper (aMarshaller, UBL21NamespacePrefixMapper.getInstance ()); } catch (final NoClassDefFoundError ex) { s_aLogger.warn ("The com.sun.xml.bind:jaxb-impl artifact is missing in your classpath. Therefore no namespace mapping can be applied!"); } } return aMarshaller; }
aMarshaller.setEventHandler (m_aEventHandler); else aMarshaller.setEventHandler (new LoggingValidationEventHandler ().andThen (aMarshaller.getEventHandler ()));
final ValidationEventHandler aEvHdl = m_aVEHFactory.apply (aMarshaller.getEventHandler ()); if (aEvHdl != null) aMarshaller.setEventHandler (aEvHdl);