Home Manual Reference Source Test Repository
import AbstractSerializer from 'serializerjs/src/Serializer/AbstractSerializer.js'
public class | source

AbstractSerializer

Extends:

SerializerInterfaceSerializerAware → AbstractSerializer

Base class that can be used for writing a custom serializer. It is especially convenient if your serializer do only serialization or only deserialization. If not, it you are better off implementing SerializerAwareInterface or SerializerInterface.

Test:

Method Summary

Public Methods
public

deserialize(data: *, className: *, format: *, context: *): *

public

serialize(data: *, format: *, context: *): *

public

supportsDeserialize(data: *, className: *, format: *): boolean

public

supportsSerialize(data: *, format: *): boolean

Inherited Summary

From class SerializerInterface
public

deserialize(data: *, className: string, format: string, context: *): *

Deserializes data back into an object of the given class.

public

serialize(data: *, format: string, context: *): *

Serializes any data object into and object usable for the backend service.

public

supportsDeserialize(data: *, className: string, format: string): boolean

Checks whether the given class is supported for deserialization by this serializer.

public

supportsSerialize(data: *, format: string): boolean

Checks whether the given class is supported for serialization by this serializer.

From class SerializerAware
protected
public

Public Methods

public deserialize(data: *, className: *, format: *, context: *): * source

Override:

SerializerInterface#deserialize

Params:

NameTypeAttributeDescription
data *
className *
format *
  • optional
  • default: null
context *
  • optional
  • default: null

Return:

*

Test:

public serialize(data: *, format: *, context: *): * source

Override:

SerializerInterface#serialize

Params:

NameTypeAttributeDescription
data *
format *
context *

Return:

*

Test:

public supportsDeserialize(data: *, className: *, format: *): boolean source

Override:

SerializerInterface#supportsDeserialize

Params:

NameTypeAttributeDescription
data *
className *
format *
  • optional
  • default: null

Return:

boolean

Test:

public supportsSerialize(data: *, format: *): boolean source

Override:

SerializerInterface#supportsSerialize

Params:

NameTypeAttributeDescription
data *
format *
  • optional
  • default: null

Return:

boolean

Test: