Returns the protocol serializer.

@return the protocol serializer
17786
protected Serializer serializer() {
    Serializer serializer = this.serializer;
    if (serializer == null) {
      synchronized (this) {
        serializer = this.serializer;
        if (serializer == null) {
          NamespaceConfig config = this.config.getNamespaceConfig();
          if (config == null) {
            serializer = Serializer.using(Namespaces.BASIC);
          } else {
            serializer = Serializer.using(Namespace.builder()
                .register(Namespaces.BASIC)
                .nextId(Namespaces.BEGIN_USER_CUSTOM_ID)
                .register(new Namespace(config))
                .build());
          }
          this.serializer = serializer;
        }
      }
    }
    return serializer;
  }
406295
def get_serializer(serializer):
    
    if isinstance(serializer, string_types):
        try:
            app_label, serializer_name = serializer.split('.')
            app_package = get_application(app_label)
            serializer_module = import_module('%s.serializers' % app_package)
            serializer = getattr(serializer_module, serializer_name)
        except Exception as e:
            logger.error('Serializer %s not found: %s' % (serializer, e))
            return None
    return serializer
964694
public function getTypeSerializer()
    {
        $type = 'array<'.$this->element->getTypeSerializer().'>';

        // if we have a x-dynamic-key field, serializer type must be changed
        if ($this->element instanceof JsonDefinitionField && !empty($this->element->getXDynamicKey())) {
            $type = 'array<string, '.$this->element->getTypeSerializer().'>';
        }

        return $type;
    }
514973
protected Serializer serializer() {
    if (serializer == null) {
      NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
      if (namespaceConfig == null) {
        namespaceConfig = new NamespaceConfig();
      }

      SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
      serializerBuilder.withNamespace(new Namespace(namespaceConfig));

      if (config.isRegistrationRequired()) {
        serializerBuilder.withRegistrationRequired();
      }
      if (config.isCompatibleSerialization()) {
        serializerBuilder.withCompatibleSerialization();
      }

      if (config.getElementType() != null) {
        serializerBuilder.addType(config.getElementType());
      }
      if (!config.getExtraTypes().isEmpty()) {
        serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
      }

      serializer = serializerBuilder.build();
    }
    return serializer;
  }
428423
public static NormalizerSerializer getDefault() {
        if (defaultSerializer == null) {
            defaultSerializer = new NormalizerSerializer().addStrategy(new StandardizeSerializerStrategy())
                    .addStrategy(new MinMaxSerializerStrategy())
                    .addStrategy(new MultiStandardizeSerializerStrategy())
                    .addStrategy(new MultiMinMaxSerializerStrategy())
                    .addStrategy(new ImagePreProcessingSerializerStrategy())
                    .addStrategy(new MultiHybridSerializerStrategy());
        }
        return defaultSerializer;
    }
751090
private <T extends Serializable> Serializer getSerializer(QName xmlType, Class<T> clazz)
      throws SecurityException,
      NoSuchMethodException,
      IllegalArgumentException,
      IllegalAccessException,
      InvocationTargetException {
    Method getSerializer = clazz.getMethod("getSerializer", String.class, Class.class, QName.class);
    return (Serializer) getSerializer.invoke(null, null, clazz, xmlType);
  }
519307
@Override
    public String getIdentity() {
        return protocol + Constants.PROTOCOL_SEPARATOR + host + ":" + port +
                "/" + getParameter(URLParamType.group.getName(), URLParamType.group.getValue()) + "/" +
                getPath() + "/" + getParameter(URLParamType.version.getName(), URLParamType.version.getValue()) +
                "/" + getParameter(URLParamType.nodeType.getName(), URLParamType.nodeType.getValue());
    }
398886
protected function serializer()
    {
        if (null === $this->serializer) {
            $self = $this;
            $this->serializer = Closure::bind($this->bindSerializer(), null, $this->class);
        }
        return $this->serializer;
    }
403161
def protocol(self):
        
        proto_id = self.lib.iperf_get_test_protocol_id(self._test)

        if proto_id == SOCK_STREAM:
            self._protocol = 'tcp'
        elif proto_id == SOCK_DGRAM:
            self._protocol = 'udp'

        return self._protocol
1207401
@Override
    public String getProtocol() {
        String protocol = this.request.getVersion();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getProtocol: " + protocol);
        }
        return protocol;
    }
622940
public Serializer getSerializer(String className)
    {
        Serializer serializer = _serializerClassMap.get(className);

        if (serializer == AbstractSerializer.NULL)
            return null;
        else
            return serializer;
    }
1286089
private function getUrlFileSerializer()
    {
        if ($this->urlFileSerializer === null) {
            $this->urlFileSerializer = new UrlFileSerializer();
            $this->urlFileSerializer->setServiceLocator($this->getServiceLocator());
        }

        return $this->urlFileSerializer;
    }
522462
public static Serializer getSerializer(Class<?> type) {
    Class<?> serializable = lookupSerializableType(type);
    Serializer serializer = serializers.get(serializable);
    if (serializer == null) {
      serializer = getInstance().createSerializer(serializable);
      serializers.put(serializable, serializer);
    }
    return serializer;
  }
947008
public com.google.protobuf.ByteString
      getProtocolBytes() {
    java.lang.Object ref = protocol_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      protocol_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
981525
public static SerializeHandler getHandlerByProtocal(String protocol)
            throws InvalidProtocolException {
        SerializeHandler handler = HANDLER_MAP.get(protocol);
        if (handler != null) {
            return handler;
        }
        throw new InvalidProtocolException("rpc protocol not supported for " + protocol);
    }
1293966
def toProtocolElement(self):
        
        protocolElement = protocol.VariantAnnotationSet()
        protocolElement.id = self.getId()
        protocolElement.variant_set_id = self._variantSet.getId()
        protocolElement.name = self.getLocalId()
        protocolElement.analysis.CopyFrom(self.getAnalysis())
        self.serializeAttributes(protocolElement)
        return protocolElement
249633
public static byte getSerializeTypeByName(String serialization) throws SofaRpcException {
        String sz = serialization.toLowerCase();
        Byte code;
        if (RpcConstants.SERIALIZE_HESSIAN2.equals(sz) || RpcConstants.SERIALIZE_HESSIAN.equals(sz)) {
            code = SerializerFactory.getCodeByAlias(RpcConstants.SERIALIZE_HESSIAN2);
        } else {
            code = SerializerFactory.getCodeByAlias(serialization);
        }
        if (code != null) {
            return code;
        } else {
            throw new SofaRpcException(RpcErrorType.SERVER_DESERIALIZE, "Unsupported serialize type " + serialization
                + " in http protocol.");
        }
    }