org.odata4j.exceptions
Interface ExceptionFactory<T extends ODataProducerException>

Type Parameters:
T - the concrete sub-class of ODataProducerException created
All Known Implementing Classes:
BadRequestException.Factory, ForbiddenException.Factory, MethodNotAllowedException.Factory, NotAcceptableException.Factory, NotAuthorizedException.Factory, NotFoundException.Factory, NotImplementedException.Factory, ServerErrorException.Factory, UnsupportedMediaTypeException.Factory

public interface ExceptionFactory<T extends ODataProducerException>

A factory for instances of a specific sub-class of ODataProducerException.

Implementations of this interface are registered to and used by ODataProducerExceptions. When an OData consumer receives an error message returned by an OData producer, the parsed OError is wrapped into an exception and thrown via the consumer API.

See Also:
ODataProducerExceptions.create(javax.ws.rs.core.Response.StatusType, OError)

Method Summary
 T createException(OError error)
          Creates an instance of a specific sub-class of ODataProducerException.
 int getStatusCode()
          Gets the status code this factory creates exception instances for.
 

Method Detail

createException

T createException(OError error)
Creates an instance of a specific sub-class of ODataProducerException.

Parameters:
error - the OData error message to be wrapped into the returned exception
Returns:
the exception instance

getStatusCode

int getStatusCode()
Gets the status code this factory creates exception instances for.

Returns:
the status code


http://odata4j.org