Registers the given class as a default serializer for the given base type.

@param baseType The base type for which to register the serializer.
@param serializer The serializer class.
@return The serializer registry.
161120
public SerializerRegistry registerDefault(Class<?> baseType, Class<? extends TypeSerializer> serializer) {
    return registerDefault(baseType, new DefaultTypeSerializerFactory(serializer));
  }
275155
public static <T> Array2dJsonSerializer<T> newInstance( JsonSerializer<T> serializer ) {
        return new Array2dJsonSerializer<T>( serializer );
    }
956735
private BTreeKeySerializer<?> getBTreeKeySerializerFromClass(Class<?> klass) {
        if(klass == Integer.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_INT;
        }
        else if(klass == Long.class) {
            return BTreeKeySerializer.ZERO_OR_POSITIVE_LONG;
        }
        else if(klass == String.class) {
            return BTreeKeySerializer.STRING;
        }
        return null; //Default POJO serializer
    }
1352162
def _resolve_serializer(self, serializer):
        
        if isinstance(serializer, Serializer):
            return serializer

        if serializer in self._serializers:
            return self._serializers[serializer]

        raise RuntimeError('Unsupported serializer')
513458
def base_object(self, obj):
        
        if not obj.is_serializable:
            raise Exception("Base object must be serializable: " + obj.classname)
        javabridge.call(self.jobject, "setBaseObject", "(Ljava/io/Serializable;)V", obj.jobject)
198081
public final <T> SerializerJson<T> serializer(Class<T> cl)
  {
    return (SerializerJson) _serMap.get(cl);
  }
283956
public Serializer registerClassLoader(String className, ClassLoader classLoader) {
    classLoaders.put(className, classLoader);
    return this;
  }
13799
def default_serializer
      # Basic
      serializer = Spark::Serializer.find!(config('spark.ruby.serializer')).new

      # Compress
      if config('spark.ruby.serializer.compress')
        serializer = Spark::Serializer.compressed(serializer)
      end

      # Bactching
      batch_size = default_batch_size
      if batch_size == 'auto'
        serializer = Spark::Serializer.auto_batched(serializer)
      else
        serializer = Spark::Serializer.batched(serializer, batch_size)
      end

      # Finally, "container" contains serializers
      serializer
    end
874452
private Serializer getSupportedSerializer(Object o) throws SerializerException {
        for (Serializer s : serializers) {
            if (s.canWrite(o)) {
                return s;
            }
        }
        throw new SerializerException("Unable to find serializer for object with type '" + o.getClass() + "'");
    }
300153
public synchronized void registerSerializer(Serializer serializer) {
    Class objClass = getSerializerType(serializer);
    if (!serializers.containsKey(objClass)) {
      int index = COUNTER.getAndIncrement();
      serializers.put(objClass, new SerializerWrapper(index, serializer));
      if (serializersArray.length <= index) {
        serializersArray = Arrays.copyOf(serializersArray, index + 1);
      }
      serializersArray[index] = serializer;

      LOGGER.info(String
          .format("Registered new serializer '%s' %n  for '%s' at index %d", serializer.getClass().getName(),
              objClass.getName(), index));
    }
  }
462014
def _create_serializer_of_type_with_cache(self, serializer_type: Type) -> "Serializer":
        
        if serializer_type not in self._serializers_cache:
            self._serializers_cache[serializer_type] = self._create_serializer_of_type(serializer_type)
        return self._serializers_cache[serializer_type]
890505
TypeSerializer<?> getSubclassSerializer(Class<?> subclass) {
		TypeSerializer<?> result = subclassSerializerCache.get(subclass);
		if (result == null) {
			result = createSubclassSerializer(subclass);
			subclassSerializerCache.put(subclass, result);
		}
		return result;
	}
1340553
@SuppressWarnings("unchecked")
  private <T> TypeSerializer<T> getSerializer(Class<T> type) {
    TypeSerializer<T> serializer = (TypeSerializer<T>) serializers.get(type);
    if (serializer == null) {
      TypeSerializerFactory factory = registry.factory(type);
      if (factory != null) {
        serializer = (TypeSerializer<T>) factory.createSerializer(type);
        serializers.put(type, serializer);
      }
    }
    return serializer;
  }
840061
public SerDeserializers register(Class<?> type, SerDeserializer deserializer) {
        deserializers.put(type, deserializer);
        return this;
    }
394210
def register_serializer(name, serializer):
    '''
'''
    if not isclass(serializer):
        serializer = serializer.__class__
    _serializers[name] = serializer
1020704
@Override
  public <T> Serializer<T> nullable(Serializer<T> serializer) {
    return new NullSerializer<T>(serializer);
  }
604243
def register_serializer(self, serializer, name=None, **kwargs):
        
        name = name or serializer.Meta.model.__name__
        self.spec.definition(name, schema=serializer, **kwargs)