JsonXMLArrayProvider extends AbstractJsonXMLProvider { @Override protected boolean isReadWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { if (!isSupported(mediaType)) { return false; } Class<?> componentType = getComponentType(type, genericType); return componentType != null && getJsonXML(componentType, annotations) != null && isBindable(componentType); } JsonXMLArrayProvider(@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 entry);  }
@Test public void testIsReadWriteable() throws NoSuchFieldException { JsonXMLArrayProvider provider = new JsonXMLArrayProvider(null); Annotation[] annotations = new Annotation[]{JsonXMLDefault.class.getAnnotation(JsonXML.class)}; Type type = getClass().getDeclaredField("sampleRootElementList").getGenericType(); Assert.assertTrue(provider.isReadWriteable(List.class, type, annotations, MediaType.APPLICATION_JSON_TYPE)); type = getClass().getDeclaredField("sampleTypeList").getGenericType(); Assert.assertTrue(provider.isReadWriteable(List.class, type, annotations, MediaType.APPLICATION_JSON_TYPE)); type = getClass().getDeclaredField("objectList").getGenericType(); Assert.assertFalse(provider.isReadWriteable(List.class, type, annotations, MediaType.APPLICATION_JSON_TYPE)); type = getClass().getDeclaredField("sampleTypeIterable").getGenericType(); Assert.assertFalse(provider.isReadWriteable(Iterable.class, type, annotations, MediaType.APPLICATION_JSON_TYPE)); type = getClass().getDeclaredField("sampleTypeList").getGenericType(); Assert.assertFalse(provider.isReadWriteable(List.class, type, new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); Assert.assertFalse(provider.isReadWriteable(List.class, type, annotations, MediaType.APPLICATION_XML_TYPE)); }