added default marshaling/unmarshaling as XML
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/dataminer-invocation-model@174556 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
06e1259287
commit
87ada9ed39
|
@ -37,6 +37,9 @@ public class DataMinerInvocationManager {
|
||||||
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
|
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
|
||||||
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
||||||
|
|
||||||
|
if(mediaType==null)
|
||||||
|
mediaType = MediaType.ApplicationXML;
|
||||||
|
|
||||||
switch (mediaType) {
|
switch (mediaType) {
|
||||||
case ApplicationJSON:
|
case ApplicationJSON:
|
||||||
jaxbMarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, Boolean.TRUE);
|
jaxbMarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, Boolean.TRUE);
|
||||||
|
@ -65,6 +68,8 @@ public class DataMinerInvocationManager {
|
||||||
JAXBContext jaxbContext = JAXBContext.newInstance(DataMinerInvocation.class);
|
JAXBContext jaxbContext = JAXBContext.newInstance(DataMinerInvocation.class);
|
||||||
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
|
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
|
||||||
|
|
||||||
|
if(mediaType==null)
|
||||||
|
mediaType = MediaType.ApplicationXML;
|
||||||
|
|
||||||
switch (mediaType) {
|
switch (mediaType) {
|
||||||
case ApplicationJSON:
|
case ApplicationJSON:
|
||||||
|
|
Loading…
Reference in New Issue