You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the annotation {code}@interface XmlJavaTypeAdapter{code} accepts only {code}Class{code} as a value.
I suspect that it would work with {code}Class>{code} or something similar.
Shai Yallin (electricmonk) said:
This problem exists with JDK6, though, Any solution in sight? currently this blocks the usage of Scala "beans" with JAXB, thus preventing integration of Scala modules into legacy systems that use JAXB. However, I assume that there are other frameworks that use this combination of annotation and class type for configuration.
Below class example, this cannot be compiled.
getting the following error:
error: type mismatch;
found : java.lang.Classjavax.xml.bind.annotation.adapters.CollapsedStringAdapter
required: java.lang.Class[_ <: javax.xml.bind.annotation.adapters.XmlAdapter]
@XmlJavaTypeAdapter(classOf[CollapsedStringAdapter])
Code example:
import javax.xml.bind.annotation.XmlAttribute
import javax.xml.bind.annotation.adapters.{CollapsedStringAdapter, XmlJavaTypeAdapter}
/**
*/
class TestDto {
@XmlAttribute
@XmlJavaTypeAdapter(classOf[CollapsedStringAdapter])
var id: String = null
}
The text was updated successfully, but these errors were encountered: