LOM2M  0.8.0
Static Public Member Functions | List of all members
ContainerMapper Class Reference

#include <JsonMapper.h>

Static Public Member Functions

static int mapAttributes (JsonObject jsonObj, Container *cnt, int level=0, bool restCreation=false, bool mapAll=false)
 
static ContainerparseResource (JsonObject o, const String &name, Entity *targetEntity, Entity *toUpdate=nullptr)
 

Detailed Description

Provide specific mapping and parsing methods dedicated to CNT resource

Member Function Documentation

◆ mapAttributes()

int ContainerMapper::mapAttributes ( JsonObject  jsonObj,
Container cnt,
int  level = 0,
bool  restCreation = false,
bool  mapAll = false 
)
static

Map specific attributes of CNT resource

Parameters
jsonObjroot of the json object used to map the resource
cntentity to map to a json object
levelof depth of mapping (in case of mapping with children resources)
restCreationboolean used to avoid serializing non permitted attributes (useful for REST creation of resource)
mapAllinternal parameter used for full serialization of all entities
Returns
int different from 0 if an error occurs

◆ parseResource()

Container * ContainerMapper::parseResource ( JsonObject  o,
const String &  name,
Entity targetEntity,
Entity toUpdate = nullptr 
)
static

Parse CNT resource (will map json object to a CNT entity)

Parameters
jsonObjroot of the json object used to map the resource
nameof the entity (to be handled externaly)
targetEntityparent of the resource to create
Returns
the created entity

The documentation for this class was generated from the following files: