Jaxb and xlink - friends or enemies?

I want to build a recreation service through cxf. this has already been done with only two Earthpart and Earthquake objects. when I call localhost / earthpars, I get a list of earth objects with earthquakes. but an earthquakeobject with additional information (how heavy, how long, etc.) is available only with xlink binding to localhost / earthquake / {id} briefly: in localhost / earthpars there is only xlink to localhost / earthquake / {id}.

now the technical part: to be honest, it was requested to use camel-cxf and jaxb to create a REST service. creating xlinks with jaxb is possible with namespaces, but this is obviously not the way to go! therefore the question arises: is there any information about xlink in connection with jaxb anywhere or is this not the way to link to xlinks?

+3
source share
1 answer

You can use the XmlAdapter to convert the child to the xlink view. For more information on the XmlAdapter, see:

+1
source

Source: https://habr.com/ru/post/1787193/


All Articles