com.backendless.persistence.BackendlessSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android Show documentation
Show all versions of android Show documentation
Android SDK used by developers to provide Backendless API in apps.
/*
* ********************************************************************************************************************
*
* BACKENDLESS.COM CONFIDENTIAL
*
* ********************************************************************************************************************
*
* Copyright 2012 BACKENDLESS.COM. All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of Backendless.com and its suppliers,
* if any. The intellectual and technical concepts contained herein are proprietary to Backendless.com and its
* suppliers and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret
* or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from Backendless.com.
*
* ********************************************************************************************************************
*/
package com.backendless.persistence;
import com.backendless.Backendless;
import com.backendless.BackendlessUser;
import com.backendless.FootprintsManager;
import com.backendless.Persistence;
import com.backendless.exceptions.BackendlessException;
import com.backendless.exceptions.ExceptionMessage;
import com.backendless.geo.GeoPoint;
import java.lang.reflect.Array;
import java.util.*;
/**
* Handles object to Map serialization for Backendless services.
*/
public abstract class BackendlessSerializer
{
private static HashMap serializers = new HashMap();
private static IObjectSerializer DEFAULT_SERIALIZER = new DefaultSerializer();
public abstract boolean shouldTraverse();
public static void addSerializer( Class clazz, IObjectSerializer serializer )
{
serializers.put( clazz, serializer );
}
/**
* Serializes Object to Map using WebOrb's serializer.
*
* @param entity object to be serialized
* @return Map corresponding to given Object
*/
public static Map serializeToMap( Object entity )
{
IObjectSerializer serializer = getSerializer( entity.getClass() );
return (Map) serializer.serializeToMap( entity, new HashMap
© 2015 - 2025 Weber Informatics LLC | Privacy Policy