2016-09-14 9 views

ответ

0

я получил ответ, он создает контекст JAXB одноплодной внутренне внутри Jaxb2Marshaller, как это:

public JAXBContext getJaxbContext() { 
      if (this.jaxbContext != null) { 
       return this.jaxbContext; 
      } 
      synchronized (this.jaxbContextMonitor) { 
       if (this.jaxbContext == null) { 
        try { 
         if (StringUtils.hasLength(this.contextPath)) { 
          this.jaxbContext = createJaxbContextFromContextPath(); 
         } 
         else if (!ObjectUtils.isEmpty(this.classesToBeBound)) { 
          this.jaxbContext = createJaxbContextFromClasses(); 
         } 
         else if (!ObjectUtils.isEmpty(this.packagesToScan)) { 
          this.jaxbContext = createJaxbContextFromPackages(); 
         } 
        } 
        catch (JAXBException ex) { 
         throw convertJaxbException(ex); 
        } 
       } 
       return this.jaxbContext; 
      } 
     }