# ObjectMapper.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"

# ObjectMapper

Json ObjectMapper. Serialized/Deserializes oatpp DTO objects to/from JSON. See Data Transfer Object(DTO) component.
Extends oatpp::base::Countable, oatpp::data::mapping::ObjectMapper.

namespace oatpp { namespace parser { namespace json { namespace mapping { 
  class ObjectMapper : public oatpp::base::Countable, public oatpp::data::mapping::ObjectMapper {}
}}}}

# Methods

Return Type Name Summary
[none] ObjectMapper Multiple implementations:
  1. Constructor.
  2. Constructor.
std::shared_ptr<ObjectMapper> createShared Multiple implementations:
  1. Create shared ObjectMapper.
  2. Create shared ObjectMapper.
void write Implementation of oatpp::data::mapping::ObjectMapper::write().
oatpp::Void read Implementation of oatpp::data::mapping::ObjectMapper::read().
std::shared_ptr<Serializer> getSerializer Get serializer.
std::shared_ptr<Deserializer> getDeserializer Get deserializer.

# ObjectMapper::ObjectMapper

  1. Constructor.
    ObjectMapper(const std::shared_ptr<Serializer::Config>& serializerConfig,
                 const std::shared_ptr<Deserializer::Config>& deserializerConfig)
    
  2. Constructor.
    • @param serializer
    • @param deserializer
    ObjectMapper(const std::shared_ptr<Serializer>& serializer = std::make_shared<Serializer>(),
                 const std::shared_ptr<Deserializer>& deserializer = std::make_shared<Deserializer>())
    

# ObjectMapper::createShared

  1. Create shared ObjectMapper.
    static std::shared_ptr<ObjectMapper>
    createShared(const std::shared_ptr<Serializer::Config>& serializerConfig,
                 const std::shared_ptr<Deserializer::Config>& deserializerConfig)
    
  2. Create shared ObjectMapper.
    • @param serializer
    • @param deserializer
    • @return
    static std::shared_ptr<ObjectMapper>
    createShared(const std::shared_ptr<Serializer>& serializer = std::make_shared<Serializer>(),
                 const std::shared_ptr<Deserializer>& deserializer = std::make_shared<Deserializer>())
    

# ObjectMapper::write

Implementation of oatpp::data::mapping::ObjectMapper::write().

void write(data::stream::ConsistentOutputStream* stream, const oatpp::Void& variant) const override

# ObjectMapper::read

Implementation of oatpp::data::mapping::ObjectMapper::read().

oatpp::Void read(oatpp::parser::Caret& caret, const oatpp::data::mapping::type::Type* const type) const override

# ObjectMapper::getSerializer

Get serializer.

  • @return

std::shared_ptr<Serializer> getSerializer()

# ObjectMapper::getDeserializer

Get deserializer.

  • @return

std::shared_ptr<Deserializer> getDeserializer()