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

    Modifier and Type
    Method
    Description
    <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, org.apache.olingo.commons.api.format.ContentType contentType)
    Parses a stream taking care to de-serializes the first OData entity found.
    readEntitySet(InputStream input, org.apache.olingo.commons.api.format.ContentType contentType)
    De-Serializes a stream into an OData entity set.
    org.apache.olingo.commons.api.ex.ODataError
    readError(InputStream inputStream, org.apache.olingo.commons.api.format.ContentType contentType)
    Parses a stream into an OData error.
    org.apache.olingo.commons.api.edm.Edm
    Parses a stream into metadata representation.
    org.apache.olingo.commons.api.edm.Edm
    readMetadata(InputStream input, List<InputStream> termDefinitions)
    Parses a stream into metadata representation.
    org.apache.olingo.commons.api.edm.Edm
    readMetadata(Map<String,org.apache.olingo.commons.api.edm.provider.CsdlSchema> xmlSchemas)
    Parses a stream into metadata representation, including referenced metadata documents.
    org.apache.olingo.commons.api.edm.Edm
    readMetadata(Map<String,org.apache.olingo.commons.api.edm.provider.CsdlSchema> xmlSchemas, List<org.apache.olingo.commons.api.edm.provider.CsdlSchema> termDefinitionSchema)
    Parses metadata document along with the document which includes term definitions
    org.apache.olingo.commons.api.edm.Edm
    readMetadata(XMLMetadata metadata, List<InputStream> termDefinitions)
    Fetches schema from metadata document and parses the document which includes term definitions
    readProperty(InputStream input, org.apache.olingo.commons.api.format.ContentType contentType)
    Parses a stream taking care to de-serialize the first OData entity property found.
    readServiceDocument(InputStream input, org.apache.olingo.commons.api.format.ContentType contentType)
    Parses an OData service document.
  • Method Details

    • readMetadata

      org.apache.olingo.commons.api.edm.Edm readMetadata(InputStream input)
      Parses a stream into metadata representation.
      Parameters:
      input - stream to de-serialize.
      Returns:
      metadata representation.
    • readMetadata

      org.apache.olingo.commons.api.edm.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

      org.apache.olingo.commons.api.edm.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

      org.apache.olingo.commons.api.edm.Edm readMetadata(Map<String,org.apache.olingo.commons.api.edm.provider.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

      org.apache.olingo.commons.api.edm.Edm readMetadata(Map<String,org.apache.olingo.commons.api.edm.provider.CsdlSchema> xmlSchemas, List<org.apache.olingo.commons.api.edm.provider.CsdlSchema> termDefinitionSchema)
      Parses metadata document along with the document which includes term definitions
      Parameters:
      xmlSchemas -
      termDefinitionSchema -
      Returns:
    • readServiceDocument

      ClientServiceDocument readServiceDocument(InputStream input, org.apache.olingo.commons.api.format.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, org.apache.olingo.commons.api.format.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, org.apache.olingo.commons.api.format.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, org.apache.olingo.commons.api.format.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

      org.apache.olingo.commons.api.ex.ODataError readError(InputStream inputStream, org.apache.olingo.commons.api.format.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