JsonXMLObjectProvider extends AbstractJsonXMLProvider { @Override protected boolean isReadWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return isSupported(mediaType) && getJsonXML(type, annotations) != null && isBindable(type); } JsonXMLObjectProvider(@Context Providers providers); @Override Object read(
			Class<?> type,
			Type genericType,
			Annotation[] annotations,
			MediaType mediaType,
			MultivaluedMap<String, String> httpHeaders,
			Reader stream); @Override void write(
			Class<?> type,
			Type genericType,
			Annotation[] annotations,
			MediaType mediaType,
			MultivaluedMap<String, Object> httpHeaders,
			Writer stream,
			Object value);  }
@Test public void testIsReadWriteable() { JsonXMLObjectProvider provider = new JsonXMLObjectProvider(null); Annotation[] jsonXMLAnnotations = new Annotation[]{JsonXMLDefault.class.getAnnotation(JsonXML.class)}; Assert.assertTrue(provider.isReadWriteable(SampleRootElement.class, null, jsonXMLAnnotations, MediaType.APPLICATION_JSON_TYPE)); Assert.assertTrue(provider.isReadWriteable(SampleType.class, null, jsonXMLAnnotations, MediaType.APPLICATION_JSON_TYPE)); Assert.assertFalse(provider.isReadWriteable(Object.class, null, jsonXMLAnnotations, MediaType.APPLICATION_JSON_TYPE)); Assert.assertFalse(provider.isReadWriteable(SampleType.class, null, new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); Assert.assertFalse(provider.isReadWriteable(SampleRootElement.class, null, jsonXMLAnnotations, MediaType.APPLICATION_XML_TYPE)); }