private class DtoContainerSerializer implements JsonSerializer<DtoContainer<?>>, JsonDeserializer<DtoContainer<?>> {
private final ConcurrentMap<String, Class<? extends Dto>> singleDtoMap = new ConcurrentHashMap<String, Class<? extends Dto>>();
private final ConcurrentMap<String, Class<? extends Dto>> pluralDtoMap = new ConcurrentHashMap<String, Class<? extends Dto>>();
public void registerType(Class<? extends Dto> type) {
Named typeName = type.getAnnotation(Named.class);
String single = getDtoSingularName(type, typeName);
String plural = getDtoPluralName(single, typeName);
// in the event that registerType is called simultaneously with
// the same type, we're still okay since getDtoXName() will return