Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2500

JAXBContextInitializer does not support JAXBRIContext.ANNOTATION_READER property

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.2.4
    • Invalid
    • JAXB Databinding
    • None

    Description

      JAXBContextInitializer does not support JAXBRIContext.ANNOTATION_READER property which is used to specify a different RuntimeAnnotationReader. For instance, this property is required for JAXBIntroductions (http://www.jboss.org/community/wiki/JAXBIntroductions) to work. While trying to use JAXBIntroductions, I've noticed that JAXBContextInitializer was ignoring @XmlTransient and therefore included a lot of unused classes - (marshalling and unmarshalling works as expected though)

      Instead of calling (e.g.) clazz.getAnnotation(XmlJavaTypeAdapter.class) directly, runtimeAnnotationReader.getClassAnnotation(clazz, XmlJavaTypeAdapter.class, srcpos) should be used. I'll attach a patch containing yet untested (sorry, but I wasn't able to build from source) changes to JAXBContextInitializer.

      If out-of-the-box support of JAXBRIContext.ANNOTATION_READER isn't possible, I'd really appreciate the possibility to plug in a custom implementation, e.g. using JAXBContextInitializer initializer = newJAXBContextInitializer(serviceInfo, contextClasses) in JAXBDataBinding.

      Attachments

        1. JAXBContextInitializer.java.patch
          8 kB
          Stefan Fussenegger

        Activity

          People

            Unassigned Unassigned
            sfussenegger Stefan Fussenegger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: