public AbstractJAXBBuilder (@Nonnull final IJAXBDocumentType aDocType) { m_aDocType = ValueEnforcer.notNull (aDocType, "DocType"); // By default this class loader of the type to be marshalled should be used // This is important for OSGI application containers and ANT tasks m_aClassLoader = new WeakReference <> (aDocType.getImplementationClass ().getClassLoader ()); }
public JAXBReaderBuilder (@Nonnull final IJAXBDocumentType aDocType) { this (aDocType, GenericReflection.uncheckedCast (aDocType.getImplementationClass ())); }
@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 ()); }
if (!m_aDocType.getImplementationClass ().getPackage ().equals (aJAXBDocument.getClass ().getPackage ())) m_aDocType.getImplementationClass ().getPackage ().getName ());
@Nonnull final String sBuilderClass) final String sType = ClassHelper.getClassLocalName (e.getImplementationClass ()); final String sName = StringHelper.trimEnd (sType, "Type"); final String sBuilderMethodName = Character.toLowerCase (sName.charAt (0)) + sName.substring (1);
@Nonnull final String sBuilderClass) final String sType = ClassHelper.getClassLocalName (e.getImplementationClass ()); final String sName = StringHelper.trimEnd (sType, "Type"); final String sBuilderMethodName = Character.toLowerCase (sName.charAt (0)) + sName.substring (1);
@Nonnull public static ValidationExecutorXSD create (@Nonnull final IJAXBDocumentType aDocType) { ValueEnforcer.notNull (aDocType, "DocType"); return new ValidationExecutorXSD (new ValidationArtefact (EValidationType.XSD, aDocType.getImplementationClass ().getClassLoader (), aDocType.getAllXSDResources ().getLast ()), aDocType::getSchema); }
if (!m_aDocType.getImplementationClass ().getPackage ().equals (aJAXBDocument.getClass ().getPackage ())) aJAXBDocument.getClass () + "' as a " + m_aDocType.getImplementationClass ().getPackage ().getName ()); return ESuccess.FAILURE;