Back to project page dandy.
The source code is released under:
GNU General Public License
If you think the Android project dandy listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.workhabit.drupal.api.json; //w w w .j av a 2 s . c o m import org.workhabit.drupal.api.entity.drupal7.DrupalEntity; import java.util.HashMap; import java.util.Map; /** * Copyright 2009 - WorkHabit, Inc. - acs * Date: 11/30/10, 12:26 PM */ public class DrupalJsonObjectSerializerFactory { private static final Map<Class<? extends DrupalEntity>, DrupalJsonObjectSerializer> instances = new HashMap<Class<? extends DrupalEntity>, DrupalJsonObjectSerializer>(); public static <T extends DrupalEntity> DrupalJsonObjectSerializer<T> getInstance(Class<T> clazz) { if (!instances.containsKey(clazz)) { DrupalJsonObjectSerializer<T> serializer = new DrupalJsonObjectSerializer<T>(clazz); instances.put(clazz, serializer); } //noinspection unchecked return instances.get(clazz); } private DrupalJsonObjectSerializerFactory() { // not instantiable } }