Overrides the default serialization.
188373
private void writeObject(ObjectOutputStream s) throws IOException {
        ObjectOutputStream.PutField putField = s.putFields();
        putField.put("version", version);
        putField.put("resourceAdapterKey", resourceAdapterKey);
        s.writeFields();
    }
903553
public function unserialize($serialized)
    {
        $data = unserialize($serialized);
        $this->_data = $data['data'];
        $this->_iteratorClass = $data['iteratorClass'];
        parent::__construct();
    }
565222
protected void applyDefaultConfiguration(ObjectMapper om) {
		om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, this.writeDatesAsTimestamps);

		om.setSerializationInclusion(JsonInclude.Include.NON_NULL);
	}
820952
private function shouldSerialize($defaultSerializeValue)
    {
        $serialize = Common::getRequestVar('serialize', $defaultSerializeValue, 'int', $this->request);

        return !empty($serialize);
    }
336043
def _serialize(self, value, attr, obj):
        
        # this might be an optional field
        if value:
            value = value.id

        return super(ForeignKeyField, self)._serialize(value, attr, obj)
965949
def serialize(self, value, **kwargs):
        
        if self._serialize is not None:
            return self._serialize(value, **kwargs)
        else:
            return value
164060
def _default(self, obj):
        
        return obj.__dict__ if isinstance(obj, JsonObj) else json.JSONDecoder().decode(obj)
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;
    }
1235877
def start_serialization(self):
        
        if (self.root):
            self.xml = XmlPrinter(self.stream, self.options.get("encoding", settings.DEFAULT_CHARSET))
            self.xml.startDocument()
            self.xml.startElement("django-objects", {"version" : "1.0"})
894105
def serialize(self, obj, method='json', beautify=False, raise_exception=False):
        """"""

        return self.helper.string.serialization.serialize(
            obj=obj, method=method, beautify=beautify, raise_exception=raise_exception)
1348282
public XmlObjectSerializer setOutput(SerializerContext serializerContext, Writer out) throws SerializerException, IOException
	{
		try
		{
			serializerContext.serializer.setOutput(out);
		}
		catch (IllegalArgumentException e)
		{
			throw new SerializerException("can't configure serializer", e);
		}
		catch (IllegalStateException e)
		{
			throw new SerializerException("can't configure serializer", e);
		}
		return this;
	}
1180180
def default(self, value):
        """"""
        if isinstance(value, ObjectId):
            return str(value)
        return super(ElasticJSONSerializer, self).default(value)
386871
def override(self, obj):
        """"""
        for field in obj.__class__.export_fields:
            setattr(self, field, getattr(obj, field))
1318466
public function unserializeAttributes()
    {
        foreach ($this->attributes as $key => $attribute) {
            $default = is_numeric($key) ? [] : $attribute;
            $attribute = is_numeric($key) ? $attribute : $key;
            $value = $this->owner->getAttribute($attribute);
            if (is_array($value)) {
                continue;
            }
            switch ($this->type) {
                case static::TYPE_JSON :
                    $value = $value ? json_decode($value, true) : [];
                    break;
                case static::TYPE_PHP :
                    $value = $value ? unserialize($value) : [];
                    break;
                default: throw new Exception("Unknown type: ". $this->type);
            }
            $value = (!$value && $this->owner->isNewRecord) ? $default : $value;
            $this->owner->setAttribute($attribute, $value);
        }
    }
1030492
public void initializeSerializerUnlessSet(ExecutionConfig executionConfig) {
		if (serializer == null) {
			checkState(typeInfo != null, "no serializer and no type info");

			// instantiate the serializer
			serializer = typeInfo.createSerializer(executionConfig);

			// we can drop the type info now, no longer needed
			typeInfo  = null;
		}
	}
671864
public function unserialize($serialized)
    {
        $data = unserialize($serialized);
        $this->data = $data['data'];
        $this->setOriginalData($data['originalData']);
    }
663794
@SuppressWarnings("unchecked")
	private final void instantiateDeserializationUtils() {
		if (this.serializers == null) {
			this.serializers = new TypeSerializer[this.serializerFactories.length];
			for (int i = 0; i < this.serializers.length; i++) {
				this.serializers[i] = this.serializerFactories[i].getSerializer();
			}
		}
		
		this.deserializedFields1 = new Object[this.serializers.length];
		this.deserializedFields2 = new Object[this.serializers.length];
		
		for (int i = 0; i < this.serializers.length; i++) {
			this.deserializedFields1[i] = this.serializers[i].createInstance();
			this.deserializedFields2[i] = this.serializers[i].createInstance();
		}
	}