org.apache.olingo.server.api.serializer

## Interface ODataSerializer

-     public interface ODataSerializer

  OData serializer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_CHARSET` The default character set is UTF-8.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `SerializerResult` | `complex(ServiceMetadata metadata, EdmComplexType type, Property property, ComplexSerializerOptions options)` Writes complex-type instance data into an InputStream.
    `SerializerResult` | `complexCollection(ServiceMetadata metadata, EdmComplexType type, Property property, ComplexSerializerOptions options)` Writes data of a collection of complex-type instances into an InputStream.
    `SerializerResult` | `entity(ServiceMetadata metadata, EdmEntityType entityType, Entity entity, EntitySerializerOptions options)` Writes entity data into an InputStream.
    `SerializerResult` | `entityCollection(ServiceMetadata metadata, EdmEntityType entityType, AbstractEntityCollection entitySet, EntityCollectionSerializerOptions options)` Writes entity-collection data into an InputStream.
    `SerializerStreamResult` | `entityCollectionStreamed(ServiceMetadata metadata, EdmEntityType entityType, EntityIterator entities, EntityCollectionSerializerOptions options)` Writes entity-collection data into an InputStream.
    `SerializerResult` | `error(ODataServerError error)` Writes an ODataError into an InputStream.
    `SerializerResult` | `metadataDocument(ServiceMetadata serviceMetadata)` Writes the metadata document into an InputStream.
    `SerializerResult` | `primitive(ServiceMetadata metadata, EdmPrimitiveType type, Property property, PrimitiveSerializerOptions options)` Writes primitive-type instance data into an InputStream.
    `SerializerResult` | `primitiveCollection(ServiceMetadata metadata, EdmPrimitiveType type, Property property, PrimitiveSerializerOptions options)` Writes data of a collection of primitive-type instances into an InputStream.
    `SerializerResult` | `reference(ServiceMetadata metadata, EdmEntitySet edmEntitySet, Entity entity, ReferenceSerializerOptions options)` Writes a single entity reference into an InputStream.
    `SerializerResult` | `referenceCollection(ServiceMetadata metadata, EdmEntitySet edmEntitySet, AbstractEntityCollection entityCollection, ReferenceCollectionSerializerOptions options)` Writes entity-collection references into an InputStream.
    `SerializerResult` | `serviceDocument(ServiceMetadata serviceMetadata, String serviceRoot)` Writes the service document into an InputStream.

- - ### Field Detail

    - #### DEFAULT_CHARSET

          static final String DEFAULT_CHARSET

      The default character set is UTF-8.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### serviceDocument

          SerializerResult serviceDocument(ServiceMetadata serviceMetadata,
                                           String serviceRoot)
                                    throws SerializerException

      Writes the service document into an InputStream.
      Parameters:
        `serviceMetadata` - the metadata information for the service
        `serviceRoot` - the service-root URI of this OData service
      Throws:
        `SerializerException`

    - #### metadataDocument

          SerializerResult metadataDocument(ServiceMetadata serviceMetadata)
                                     throws SerializerException

      Writes the metadata document into an InputStream.
      Parameters:
        `serviceMetadata` - the metadata information for the service
      Throws:
        `SerializerException`

    - #### error

          SerializerResult error(ODataServerError error)
                          throws SerializerException

      Writes an ODataError into an InputStream.
      Parameters:
        `error` - the main error
      Throws:
        `SerializerException`

    - #### entityCollection

          SerializerResult entityCollection(ServiceMetadata metadata,
                                            EdmEntityType entityType,
                                            AbstractEntityCollection entitySet,
                                            EntityCollectionSerializerOptions options)
                                     throws SerializerException

      Writes entity-collection data into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `entityType` - the `EdmEntityType`
        `entitySet` - the data of the entity set
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### entityCollectionStreamed

          SerializerStreamResult entityCollectionStreamed(ServiceMetadata metadata,
                                                          EdmEntityType entityType,
                                                          EntityIterator entities,
                                                          EntityCollectionSerializerOptions options)
                                                   throws SerializerException

      Writes entity-collection data into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `entityType` - the `EdmEntityType`
        `entities` - the data of the entity set
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### entity

          SerializerResult entity(ServiceMetadata metadata,
                                  EdmEntityType entityType,
                                  Entity entity,
                                  EntitySerializerOptions options)
                           throws SerializerException

      Writes entity data into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `entityType` - the `EdmEntityType`
        `entity` - the data of the entity
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### primitive

          SerializerResult primitive(ServiceMetadata metadata,
                                     EdmPrimitiveType type,
                                     Property property,
                                     PrimitiveSerializerOptions options)
                              throws SerializerException

      Writes primitive-type instance data into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `type` - primitive type
        `property` - property value
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### complex

          SerializerResult complex(ServiceMetadata metadata,
                                   EdmComplexType type,
                                   Property property,
                                   ComplexSerializerOptions options)
                            throws SerializerException

      Writes complex-type instance data into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `type` - complex type
        `property` - property value
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### primitiveCollection

          SerializerResult primitiveCollection(ServiceMetadata metadata,
                                               EdmPrimitiveType type,
                                               Property property,
                                               PrimitiveSerializerOptions options)
                                        throws SerializerException

      Writes data of a collection of primitive-type instances into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `type` - primitive type
        `property` - property value
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### complexCollection

          SerializerResult complexCollection(ServiceMetadata metadata,
                                             EdmComplexType type,
                                             Property property,
                                             ComplexSerializerOptions options)
                                      throws SerializerException

      Writes data of a collection of complex-type instances into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `type` - complex type
        `property` - property value
        `options` - options for the serializer
      Throws:
        `SerializerException`

    - #### reference

          SerializerResult reference(ServiceMetadata metadata,
                                     EdmEntitySet edmEntitySet,
                                     Entity entity,
                                     ReferenceSerializerOptions options)
                              throws SerializerException

      Writes a single entity reference into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `edmEntitySet` - `EdmEntitySet`
        `entity` - data of the entity
        `options` - `ReferenceSerializerOptions`
      Throws:
        `SerializerException`

    - #### referenceCollection

          SerializerResult referenceCollection(ServiceMetadata metadata,
                                               EdmEntitySet edmEntitySet,
                                               AbstractEntityCollection entityCollection,
                                               ReferenceCollectionSerializerOptions options)
                                        throws SerializerException

      Writes entity-collection references into an InputStream.
      Parameters:
        `metadata` - metadata for the service
        `edmEntitySet` - `EdmEntitySet`
        `entityCollection` - data of the entity collection
        `options` - `ReferenceCollectionSerializerOptions`
      Throws:
        `SerializerException`

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