code: private void setMappers(ObjectMapper mapper, XmlMapper xml) {
          synchronized (lock) {
              this.mapper = mapper;
              this.xml = xml;
              // mapper and xml are set to null on invalidation.
              if (mapper != null && xml != null) {
                  applyMapperConfiguration(mapper, xml);
              }
          }
      }
docs: Sets the object mapper.
  
  @param mapper the object mapper to use