@Test public void isPrettyFalseForFalse() { HttpHeaders headers = createHeaders(); headers.getRequestHeaders().putSingle(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME, "false"); assertFalse(FHIRProvider.isPretty(headers, generatePrettyParameterUriInfo("false"))); }
protected static boolean isPretty(HttpHeaders httpHeaders, UriInfo uriInfo) { String value = httpHeaders.getHeaderString(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME); if (value == null) { value = uriInfo.getQueryParameters().getFirst("_pretty"); } if (value != null) { if (Boolean.parseBoolean(value)) { return true; } else if ("false".equalsIgnoreCase(value)) { return false; } } return FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_DEFAULT_PRETTY_PRINT, false); }
FHIRProvider implements MessageBodyReader<Resource>, MessageBodyWriter<Resource> { protected static boolean isPretty(HttpHeaders httpHeaders, UriInfo uriInfo) { String value = httpHeaders.getHeaderString(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME); if (value == null) { value = uriInfo.getQueryParameters().getFirst("_pretty"); } if (value != null) { if (Boolean.parseBoolean(value)) { return true; } else if ("false".equalsIgnoreCase(value)) { return false; } } return FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_DEFAULT_PRETTY_PRINT, false); } }
FHIRProvider implements MessageBodyReader<Resource>, MessageBodyWriter<Resource> { protected static boolean isPretty(HttpHeaders httpHeaders, UriInfo uriInfo) { String value = httpHeaders.getHeaderString(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME); if (value == null) { value = uriInfo.getQueryParameters().getFirst("_pretty"); } if (value != null) { if (Boolean.parseBoolean(value)) { return true; } else if ("false".equalsIgnoreCase(value)) { return false; } } return FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_DEFAULT_PRETTY_PRINT, false); } FHIRProvider(RuntimeType runtimeType); }
FHIRProvider implements MessageBodyReader<Resource>, MessageBodyWriter<Resource> { protected static boolean isPretty(HttpHeaders httpHeaders, UriInfo uriInfo) { String value = httpHeaders.getHeaderString(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME); if (value == null) { value = uriInfo.getQueryParameters().getFirst("_pretty"); } if (value != null) { if (Boolean.parseBoolean(value)) { return true; } else if ("false".equalsIgnoreCase(value)) { return false; } } return FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_DEFAULT_PRETTY_PRINT, false); } FHIRProvider(RuntimeType runtimeType); @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override Resource readFrom(Class<Resource> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String, String> httpHeaders,
            InputStream entityStream); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(Resource t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream entityStream); @Override long getSize(Resource t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); }
FHIRProvider implements MessageBodyReader<Resource>, MessageBodyWriter<Resource> { protected static boolean isPretty(HttpHeaders httpHeaders, UriInfo uriInfo) { String value = httpHeaders.getHeaderString(FHIRConfiguration.DEFAULT_PRETTY_RESPONSE_HEADER_NAME); if (value == null) { value = uriInfo.getQueryParameters().getFirst("_pretty"); } if (value != null) { if (Boolean.parseBoolean(value)) { return true; } else if ("false".equalsIgnoreCase(value)) { return false; } } return FHIRConfigHelper.getBooleanProperty(FHIRConfiguration.PROPERTY_DEFAULT_PRETTY_PRINT, false); } FHIRProvider(RuntimeType runtimeType); @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override Resource readFrom(Class<Resource> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String, String> httpHeaders,
            InputStream entityStream); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(Resource t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream entityStream); @Override long getSize(Resource t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType);  }