Clover icon

sunshower-sdk

  1. Project Clover database Sat May 12 2018 05:15:40 UTC
  2. Package io.sunshower.sdk.common.jaxb

File CachingJAXBContextAwareMOxyJSONProvider.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
3
2
1
36
31
2
0.67
1.5
2
1

Classes

Class Line # Actions
CachingJAXBContextAwareMOxyJSONProvider 20 3 2
1.0100%
 

Contributing tests

This file is covered by 23 tests. .

Source view

1    package io.sunshower.sdk.common.jaxb;
2   
3    import io.sunshower.service.serialization.DynamicResolvingMoxyJsonProvider;
4    import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
5   
6    import javax.ws.rs.Consumes;
7    import javax.ws.rs.Produces;
8    import javax.ws.rs.core.MediaType;
9    import javax.ws.rs.core.MultivaluedMap;
10    import javax.ws.rs.ext.Provider;
11    import javax.ws.rs.ext.Providers;
12    import javax.xml.bind.JAXBContext;
13    import javax.xml.bind.JAXBException;
14    import java.lang.annotation.Annotation;
15    import java.util.Set;
16   
17    @Provider
18    @Produces({MediaType.APPLICATION_JSON, MediaType.WILDCARD, "application/x-javascript"})
19    @Consumes({MediaType.APPLICATION_JSON, MediaType.WILDCARD})
 
20    public class CachingJAXBContextAwareMOxyJSONProvider extends DynamicResolvingMoxyJsonProvider {
21   
 
22  7 toggle public CachingJAXBContextAwareMOxyJSONProvider(Providers providers) {
23  7 super(providers);
24  7 this.setWrapperAsArrayName(true);
25    }
26   
 
27  559 toggle @Override
28    public JAXBContext getJAXBContext(
29    Set<Class<?>> domainClasses,
30    Annotation[] annotations,
31    MediaType mediaType,
32    MultivaluedMap<String, ?> httpHeaders)
33    throws JAXBException {
34  559 return super.getJAXBContext(domainClasses, annotations, mediaType, httpHeaders);
35    }
36    }