/** * Set usage of XML Schema. By default it is enabled, but for rare cases it * could make sense to disable validation e.g. because of performance reasons. * * @param bUseSchema * <code>true</code> to use XML Schema, <code>false</code> to not do * it. * @return this * @since 9.0.3 */ @Nonnull public final IMPLTYPE setUseSchema (final boolean bUseSchema) { m_bUseSchema = bUseSchema; return thisAsT (); }
@Nonnull @OverrideOnDemand protected JAXBContext getJAXBContext () throws JAXBException { if (m_bUseJAXBContextCache) { // Since creating the JAXB context is quite cost intensive this is done // only once! return JAXBContextCache.getInstance ().getFromCache (m_aDocType.getImplementationClass (), getClassLoader ()); } // Create a new JAXBContext - inefficient return JAXBContext.newInstance (m_aDocType.getImplementationClass ().getPackage ().getName (), getClassLoader ()); }
@Override public String toString () { return ToStringGenerator.getDerived (super.toString ()) .append ("ImplClass", m_aImplClass) .append ("EventHandler", m_aEventHandler) .append ("UnmarshallerCustomizer", m_aUnmarshallerCustomizer) .append ("ReadSecure", m_bReadSecure) .getToString (); } }
/** * Set usage of the {@link JAXBContextCache}. For performance reasons it's * recommended to use the cache. * * @param bUseJAXBContextCache * <code>true</code> to use the cache, <code>false</code> to create a * new {@link JAXBContext} every time. * @return this */ @Nonnull public final IMPLTYPE setUseJAXBContextCache (final boolean bUseJAXBContextCache) { m_bUseJAXBContextCache = bUseJAXBContextCache; return thisAsT (); }