Gets a serializer for a particular type. For primitives, returns the
        serializer from the module-level serializers.
        For arrays and objects, uses the special _get_T_serializer methods to
        build the encoders and decoders.
495278
def _get_serializer(self, _type):
        
        if _type in _serializers:  # _serializers is module level
            return _serializers[_type]
        # array and object are special types
        elif _type == 'array':
            return self._get_array_serializer()
        elif _type == 'object':
            return self._get_object_serializer()

        raise ValueError('Unknown type: {}'.format(_type))
457622
public Serializer getCustomSerializer(Class cl)
    {
        Serializer serializer = _customSerializerMap.get(cl.getName());

        if (serializer == AbstractSerializer.NULL)
            return null;
        else if (serializer != null)
            return serializer;

        try {
            Class serClass = Class.forName(cl.getName() + "HessianSerializer",
                false, cl.getClassLoader());

            Serializer ser = (Serializer) serClass.newInstance();

            _customSerializerMap.put(cl.getName(), ser);

            return ser;
        } catch (ClassNotFoundException e) {
            log.log(Level.ALL, e.toString(), e);
        } catch (Exception e) {
            throw new HessianException(e);
        }

        _customSerializerMap.put(cl.getName(), AbstractSerializer.NULL);

        return null;
    }
220981
public function getTypeSerializer()
    {
        if (isset(self::$serializerTypeMap[$this->getType()])) {
            return self::$serializerTypeMap[$this->getType()];
        }

        // our fallback default
        return self::$serializerTypeMap[self::TYPE_STRING];
    }
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]
335000
def _deserialize_property_value(self, to_deserialize: PrimitiveJsonType, deserializer_cls: Type) -> Any:
        
        deserializer = self._create_deserializer_of_type_with_cache(deserializer_cls)
        assert deserializer is not None
        return deserializer.deserialize(to_deserialize)
388072
public Serializer getSerializer(Class cl)
        throws HessianProtocolException {
        Serializer serializer;

        serializer = (Serializer) _cachedSerializerMap.get(cl);

        if (serializer != null) {
            return serializer;
        }

        serializer = loadSerializer(cl);

        _cachedSerializerMap.put(cl, serializer);

        return serializer;
    }
852448
@SuppressWarnings("unchecked")
    public static <T> Serializer<T> unsafeGetSerializer(SerializerFactory serializerFactory,
                                                        SerializerDefinition serializerDefinition) {
        return (Serializer<T>) serializerFactory.getSerializer(serializerDefinition);
    }
88284
def serialize(obj):
    
    if isinstance(obj, list):
        return [serialize(o) for o in obj]
    return GenericSerializer(ModelProviderImpl()).serialize(obj)
1197082
def get_serializer_class(self):
        
        base_class = super().get_serializer_class()

        class SerializerWithPermissions(base_class):
            """Augment serializer class."""

            def get_fields(serializer_self):  # pylint: disable=no-self-argument
                """Return serializer's fields."""
                fields = super().get_fields()
                fields['current_user_permissions'] = CurrentUserPermissionsSerializer(read_only=True)
                return fields

            def to_representation(serializer_self, instance):  # pylint: disable=no-self-argument
                """Object serializer."""
                data = super().to_representation(instance)

                if ('fields' not in self.request.query_params
                        or 'current_user_permissions' in self.request.query_params['fields']):
                    data['current_user_permissions'] = get_object_perms(instance, self.request.user)

                return data

        return SerializerWithPermissions
1289182
function getSerializer(target, property /* | keyof T*/) {
    // get the class constructor
    const constr = target.constructor;
    // retrieve the current metadata
    const metadata = Reflect.getMetadata(METADATA_serializeWith, constr) || {};
    if (metadata.hasOwnProperty(property))
        return metadata[property];
    // If there's no custom serializer, try to find a default one
    const type = getPropertyType(target, property);
    if (type && type.name in defaultSerializers) {
        return defaultSerializers[type.name];
    }
}
39087
private ObjectInspector getObjectInspectorForType(TypeInfo type)
            throws SerDeException {
        switch (type.getCategory()) {
            case PRIMITIVE:
                PrimitiveTypeInfo primitiveType = (PrimitiveTypeInfo) type;
                if (isSupportedPrimitive(primitiveType)) {
                    return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(primitiveType.getPrimitiveCategory());
                }
                break;
            case STRUCT:
                StructTypeInfo structType = (StructTypeInfo) type;
                List<ObjectInspector> structInspectors = Lists.newArrayListWithCapacity(structType.getAllStructFieldTypeInfos().size());
                for (TypeInfo fieldType : structType.getAllStructFieldTypeInfos()) {
                    structInspectors.add(getObjectInspectorForType(fieldType));
                }
                return ObjectInspectorFactory.getStandardStructObjectInspector(structType.getAllStructFieldNames(), structInspectors);
            case MAP:
                MapTypeInfo mapType = (MapTypeInfo) type;
                return ObjectInspectorFactory.getStandardMapObjectInspector(
                        getObjectInspectorForType(mapType.getMapKeyTypeInfo()), getObjectInspectorForType(mapType.getMapValueTypeInfo()));
            case LIST:
                ListTypeInfo listType = (ListTypeInfo) type;
                return ObjectInspectorFactory.getStandardListObjectInspector(getObjectInspectorForType(listType.getListElementTypeInfo()));
            case UNION:
                UnionTypeInfo unionType = (UnionTypeInfo) type;
                List<ObjectInspector> unionInspectors = Lists.newArrayListWithCapacity(unionType.getAllUnionObjectTypeInfos().size());
                for (TypeInfo fieldType : unionType.getAllUnionObjectTypeInfos()) {
                    unionInspectors.add(getObjectInspectorForType(fieldType));
                }
                return ObjectInspectorFactory.getStandardUnionObjectInspector(unionInspectors);
        }

        // Should be unreachable
        throw new SerDeException("Unsupported type: " + type);
    }
233082
def get_serializer_in(self, *args, **kwargs):
        
        serializer_class = self.get_serializer_class_in()
        kwargs['context'] = self.get_serializer_context()
        return serializer_class(*args, **kwargs)
86998
private SerializerWrapper getSerializerWrapper(Class cls) {
    SerializerWrapper w = serializers.get(cls);
    if (w != null) {
      return w;
    } else {
      // Try with interfaces implemented
      for (Class c : cls.getInterfaces()) {
        w = serializers.get(c);
        if (w != null) {
          return w;
        }
      }
    }
    return null;
  }
932079
private static IObjectSerializer getSerializer( Class clazz )
  {
    Iterator<Map.Entry<Class, IObjectSerializer>> iterator = serializers.entrySet().iterator();
    IObjectSerializer serializer = DEFAULT_SERIALIZER;

    while( iterator.hasNext() )
    {
      Map.Entry<Class, IObjectSerializer> entry = iterator.next();

      if( entry.getKey().isAssignableFrom( clazz ) )
      {
        serializer = entry.getValue();
        break;
      }
    }

    return serializer;
  }
78934
def serializer(metadata_prefix):
    
    metadataFormats = current_app.config['OAISERVER_METADATA_FORMATS']
    serializer_ = metadataFormats[metadata_prefix]['serializer']
    if isinstance(serializer_, tuple):
        return partial(import_string(serializer_[0]), **serializer_[1])
    return import_string(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
358752
function getDeserializer(type, subtype)
{
    if (Array.isArray(type))
        return compositeDeserializer(_.map(type, function(value) { return getDeserializer(value, subtype); }));

    return function deserializer(val)
    {
        return val !== null ? Deserializers[type](val, subtype) : null;
    };
}