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:
Francesco Mangiacrapa 2018-12-04 17:41:52 +00:00
parent 06e1259287
commit 87ada9ed39
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,9 @@ public class DataMinerInvocationManager {
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
if(mediaType==null)
mediaType = MediaType.ApplicationXML;
switch (mediaType) {
case ApplicationJSON:
jaxbMarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, Boolean.TRUE);
@ -65,6 +68,8 @@ public class DataMinerInvocationManager {
JAXBContext jaxbContext = JAXBContext.newInstance(DataMinerInvocation.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
if(mediaType==null)
mediaType = MediaType.ApplicationXML;
switch (mediaType) {
case ApplicationJSON: