code: protected Serializer getDefaultSerializer(Class cl) {
          if (_defaultSerializer != null)
              return _defaultSerializer;
  
          if (!Serializable.class.isAssignableFrom(cl)
              && !_isAllowNonSerializable) {
              throw new IllegalStateException("Serialized class " + cl.getName() + " must implement java.io.Serializable");
          }
  
          if (_isEnableUnsafeSerializer
              && JavaSerializer.getWriteReplace(cl) == null) {
              return UnsafeSerializer.create(cl);
          } else
              return JavaSerializer.create(cl);
      }
docs: Returns the default serializer for a class that isn't matched
  directly.  Application can override this method to produce
  bean-style serialization instead of field serialization.
  
  @param cl the class of the object that needs to be serialized.
  @return a serializer object for the serialization.