private String getActualFormat(final ContentType contentType) { return (ClientProperty.class.isAssignableFrom(reference) && (contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML)) ? ContentType.APPLICATION_XML : contentType).toContentTypeString(); }
private String getActualFormat(final ContentType contentType) { return (ClientProperty.class.isAssignableFrom(reference) && (contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML)) ? ContentType.APPLICATION_XML : contentType).toContentTypeString(); }
public ClientODataDeserializerImpl(final boolean serverMode, final ContentType contentType) { this.contentType = contentType; if (contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML) || contentType.isCompatible(ContentType.APPLICATION_XML)) { deserializer = new AtomDeserializer(); } else { deserializer = new JsonDeserializer(serverMode); } }
@Override public ODataSerializer getSerializer(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML) || contentType.isCompatible(ContentType.APPLICATION_XML) ? new AtomSerializer() : new JsonSerializer(false, contentType); }
@Override public ODataSerializer getSerializer(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML) || contentType.isCompatible(ContentType.APPLICATION_XML) ? new AtomSerializer() : new JsonSerializer(false, contentType); }
public ClientODataDeserializerImpl(final boolean serverMode, final ContentType contentType) { this.contentType = contentType; if (contentType.isCompatible(ContentType.APPLICATION_ATOM_SVC) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML) || contentType.isCompatible(ContentType.APPLICATION_XML)) { deserializer = new AtomDeserializer(); } else { deserializer = new JsonDeserializer(serverMode); } }
public static boolean isODataMetadataNone(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
public static boolean isODataMetadataFull(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
private boolean isODataMetadataFull() { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); } }
private boolean isODataMetadataNone() { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
private boolean isODataMetadataFull() { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); } }
private boolean isODataMetadataNone() { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
public static boolean isODataMetadataNone(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
public static boolean isODataMetadataFull(final ContentType contentType) { return contentType.isCompatible(ContentType.APPLICATION_JSON) && ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase( contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); }
private void validateContentType() throws ODataApplicationException { final ContentType contentType = getRequestContentType(); if (contentType == null || !contentType.isCompatible(ContentType.MULTIPART_MIXED)) { throw new ODataApplicationException("Invalid content type", HttpStatusCode.BAD_REQUEST.getStatusCode(), Locale.getDefault()); } }
private void validateContentType() throws ODataApplicationException { final ContentType contentType = getRequestContentType(); if (contentType == null || !contentType.isCompatible(ContentType.MULTIPART_MIXED)) { throw new ODataApplicationException("Invalid content type", HttpStatusCode.BAD_REQUEST.getStatusCode(), Locale.getDefault()); } }
@Override public ResWrap<ServiceDocument> toServiceDocument(final InputStream input) throws ODataDeserializerException { return contentType.isCompatible(ContentType.APPLICATION_XML) ? new XMLServiceDocumentDeserializer(false).toServiceDocument(input) : new JSONServiceDocumentDeserializer(false).toServiceDocument(input); }
@Override public EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType) throws SerializerException { if (contentType.isCompatible(ContentType.APPLICATION_JSON)) { return new EdmAssistedJsonSerializer(contentType); } throw new SerializerException("Unsupported format: " + contentType.toContentTypeString(), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, contentType.toContentTypeString()); }
@Override public EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType) throws SerializerException { if (contentType.isCompatible(ContentType.APPLICATION_JSON)) { return new EdmAssistedJsonSerializer(contentType); } throw new SerializerException("Unsupported format: " + contentType.toContentTypeString(), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, contentType.toContentTypeString()); }
@Override public ResWrap<ServiceDocument> toServiceDocument(final InputStream input) throws ODataDeserializerException { return contentType.isCompatible(ContentType.APPLICATION_XML) ? new XMLServiceDocumentDeserializer(false).toServiceDocument(input) : new JSONServiceDocumentDeserializer(false).toServiceDocument(input); }