code: public void setScalarSerializer (Class type, ScalarSerializer serializer) {
  		if (type == null) throw new IllegalArgumentException("type cannot be null.");
  		if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  		scalarSerializers.put(type, serializer);
  	}
docs: Adds a serializer for the specified scalar type.