Interface ODataReader
public interface ODataReader
OData reader.
Use this class to de-serialize an OData response body.
This class provides method helpers to de-serialize an entire entity set, a set of entities or a single entity.
Use this class to de-serialize an OData response body.
This class provides method helpers to de-serialize an entire entity set, a set of entities or a single entity.
-
Method Summary
Modifier and TypeMethodDescription<T> ResWrap<T>
read
(InputStream src, String format, Class<T> reference) Parses a stream into the object type specified by the given reference.readEntity
(InputStream input, ContentType contentType) Parses a stream taking care to de-serializes the first OData entity found.readEntitySet
(InputStream input, ContentType contentType) De-Serializes a stream into an OData entity set.readError
(InputStream inputStream, ContentType contentType) Parses a stream into an OData error.readMetadata
(InputStream input) Parses a stream into metadata representation.readMetadata
(InputStream input, List<InputStream> termDefinitions) Parses a stream into metadata representation.readMetadata
(Map<String, CsdlSchema> xmlSchemas) Parses a stream into metadata representation, including referenced metadata documents.readMetadata
(Map<String, CsdlSchema> xmlSchemas, List<CsdlSchema> termDefinitionSchema) Parses metadata document along with the document which includes term definitionsreadMetadata
(XMLMetadata metadata, List<InputStream> termDefinitions) Fetches schema from metadata document and parses the document which includes term definitionsreadProperty
(InputStream input, ContentType contentType) Parses a stream taking care to de-serialize the first OData entity property found.readServiceDocument
(InputStream input, ContentType contentType) Parses an OData service document.
-
Method Details
-
readMetadata
Parses a stream into metadata representation.- Parameters:
input
- stream to de-serialize.- Returns:
- metadata representation.
-
readMetadata
Parses a stream into metadata representation. Also parses a term definition stream into Term representation.- Parameters:
input
-termDefinitions
-- Returns:
-
readMetadata
Fetches schema from metadata document and parses the document which includes term definitions- Parameters:
metadata
-termDefinitions
-- Returns:
-
readMetadata
Parses a stream into metadata representation, including referenced metadata documents.- Parameters:
xmlSchemas
- XML representation of the requested metadata document + any other referenced (via <edmx:Reference/>) metadata document- Returns:
- metadata representation.
-
readMetadata
Parses metadata document along with the document which includes term definitions- Parameters:
xmlSchemas
-termDefinitionSchema
-- Returns:
-
readServiceDocument
ClientServiceDocument readServiceDocument(InputStream input, ContentType contentType) throws ODataDeserializerException Parses an OData service document.- Parameters:
input
- stream to de-serialize.contentType
- de-serialize as XML or JSON- Returns:
- List of URIs.
- Throws:
ODataDeserializerException
-
readEntitySet
ClientEntitySet readEntitySet(InputStream input, ContentType contentType) throws ODataDeserializerException De-Serializes a stream into an OData entity set.- Parameters:
input
- stream to de-serialize.contentType
- de-serialize format- Returns:
- de-serialized entity set.
- Throws:
ODataDeserializerException
-
readEntity
ClientEntity readEntity(InputStream input, ContentType contentType) throws ODataDeserializerException Parses a stream taking care to de-serializes the first OData entity found.- Parameters:
input
- stream to de-serialize.contentType
- de-serialize format- Returns:
- entity de-serialized.
- Throws:
ODataDeserializerException
-
readProperty
ClientProperty readProperty(InputStream input, ContentType contentType) throws ODataDeserializerException Parses a stream taking care to de-serialize the first OData entity property found.- Parameters:
input
- stream to de-serialize.contentType
- de-serialize as XML or JSON- Returns:
- OData entity property de-serialized.
- Throws:
ODataDeserializerException
-
readError
ODataError readError(InputStream inputStream, ContentType contentType) throws ODataDeserializerException Parses a stream into an OData error.- Parameters:
inputStream
- stream to de-serialize.contentType
- format- Returns:
- OData error.
- Throws:
ODataDeserializerException
-
read
<T> ResWrap<T> read(InputStream src, String format, Class<T> reference) throws ODataDeserializerException Parses a stream into the object type specified by the given reference.- Type Parameters:
T
- expected object type.- Parameters:
src
- input stream.format
- formatreference
- reference.- Returns:
- read object.
- Throws:
ODataDeserializerException
-