org.apache.olingo.client.api.serialization

## 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.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> ResWrap<T>` | `read(InputStream src, String format, Class<T> reference)` Parses a stream into the object type specified by the given reference.
    `ClientEntity` | `readEntity(InputStream input, ContentType contentType)` Parses a stream taking care to de-serializes the first OData entity found.
    `ClientEntitySet` | `readEntitySet(InputStream input, ContentType contentType)` De-Serializes a stream into an OData entity set.
    `ODataError` | `readError(InputStream inputStream, ContentType contentType)` Parses a stream into an OData error.
    `Edm` | `readMetadata(InputStream input)` Parses a stream into metadata representation.
    `Edm` | `readMetadata(InputStream input, List<InputStream> termDefinitions)` Parses a stream into metadata representation.
    `Edm` | `readMetadata(Map<String,CsdlSchema> xmlSchemas)` Parses a stream into metadata representation, including referenced metadata documents.
    `Edm` | `readMetadata(Map<String,CsdlSchema> xmlSchemas, List<CsdlSchema> termDefinitionSchema)` Parses metadata document along with the document which includes term definitions
    `Edm` | `readMetadata(XMLMetadata metadata, List<InputStream> termDefinitions)` Fetches schema from metadata document and parses the document which includes term definitions
    `ClientProperty` | `readProperty(InputStream input, ContentType contentType)` Parses a stream taking care to de-serialize the first OData entity property found.
    `ClientServiceDocument` | `readServiceDocument(InputStream input, ContentType contentType)` Parses an OData service document.

- - ### Method Detail

    - #### readMetadata

          Edm readMetadata(InputStream input)

      Parses a stream into metadata representation.
      Parameters:
        `input` - stream to de-serialize.
      Returns:
        metadata representation.

    - #### readMetadata

          Edm readMetadata(InputStream input,
                           List<InputStream> termDefinitions)

      Parses a stream into metadata representation. Also parses a term definition stream into Term representation.
      Parameters:
        `input` -
        `termDefinitions` -
      Returns:

    - #### readMetadata

          Edm readMetadata(XMLMetadata metadata,
                           List<InputStream> termDefinitions)

      Fetches schema from metadata document and parses the document which includes term definitions
      Parameters:
        `metadata` -
        `termDefinitions` -
      Returns:

    - #### readMetadata

          Edm readMetadata(Map<String,CsdlSchema> xmlSchemas)

      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

          Edm readMetadata(Map<String,CsdlSchema> xmlSchemas,
                           List<CsdlSchema> termDefinitionSchema)

      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` - format
        `reference` - reference.
      Returns:
        read object.
      Throws:
        `ODataDeserializerException`

Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.