public final class WriteMethodUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RETURN_MINIMAL
The key/value pair specifying that the return-minimal is preferred by the client.
|
| Modifier and Type | Method and Description |
|---|---|
static DataSource |
getDataSource(ODataRequestContext requestContext,
String entityType,
DataSourceFactory dataSourceFactory) |
static Map<String,String> |
getResponseHeaders(Object entity,
ODataUri oDataUri,
EntityDataModel entityDataModel)
Get the response headers when the response is to include an entity in its body.
|
static TargetType |
getTargetType(ODataRequest request,
EntityDataModel entityDataModel,
ODataUri oDataUri) |
static boolean |
isMinimalReturnPreferred(ODataRequest request)
Check whether the return-minimal is preferred by the HTTP client by inspecting the 'HTTP-Prefer' header.
|
static void |
validateKeys(Object entity,
EntityType type,
ODataUri oDataUri,
EntityDataModel entityDataModel)
Performs the validation of keys.
|
static void |
validateProperties(Object entity,
EntityDataModel edm)
Checks if all non-nullable properties of an entity are non-empty.
|
static void |
validateTargetType(Object entity,
ODataRequest request,
EntityDataModel entityDataModel,
ODataUri oDataUri)
Validates the target type.
|
public static final String RETURN_MINIMAL
public static TargetType getTargetType(ODataRequest request, EntityDataModel entityDataModel, ODataUri oDataUri) throws ODataTargetTypeException
ODataTargetTypeExceptionpublic static DataSource getDataSource(ODataRequestContext requestContext, String entityType, DataSourceFactory dataSourceFactory) throws ODataDataSourceException
ODataDataSourceExceptionpublic static boolean isMinimalReturnPreferred(ODataRequest request)
true if the return-minimal is preferred.public static Map<String,String> getResponseHeaders(Object entity, ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataEdmException
entity - The entity that will be included in the body of the response.ODataEdmException - In case it is not possible to build the headers.public static void validateKeys(Object entity, EntityType type, ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataClientException, ODataProcessorException
entity - The passed entity.type - The entity type of the passed entity.ODataClientExceptionODataProcessorExceptionpublic static void validateTargetType(Object entity, ODataRequest request, EntityDataModel entityDataModel, ODataUri oDataUri) throws ODataProcessorException, ODataTargetTypeException
entity - an entityODataProcessorExceptionODataTargetTypeExceptionpublic static void validateProperties(Object entity, EntityDataModel edm) throws ODataException
entity - The entity to check.ODataBadRequestException - If any of the non-nullable properties of the entity are empty.ODataExceptionCopyright © 2014–2015 SDL. All rights reserved.