All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mx.path.model.mdx.web.MdxSerializerFactoryBean Maven / Gradle / Ivy

There is a newer version: 16.0.0
Show newest version
package com.mx.path.model.mdx.web;

import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mx.path.model.mdx.model.Resources;

import org.springframework.beans.factory.FactoryBean;

public class MdxSerializerFactoryBean implements FactoryBean {
  public MdxSerializerFactoryBean() {
  }

  @Override
  public final Gson getObject() throws Exception {
    GsonBuilder baseGson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
        .setDateFormat("YYYY-MM-dd").setPrettyPrinting();

    Resources.registerResources(baseGson);

    return baseGson.create();
  }

  @Override
  public final Class getObjectType() {
    return Gson.class;
  }

  @Override
  public final boolean isSingleton() {
    return false;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy