Skip to content

Package: ModelSerializer

ModelSerializer

Coverage

1: /*
2: * Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0 which is available at
6: * http://www.eclipse.org/legal/epl-2.0,
7: * or the Eclipse Distribution License v. 1.0 which is available at
8: * http://www.eclipse.org/org/documents/edl-v10.php.
9: *
10: * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11: */
12:
13: package org.eclipse.yasson.internal.serializer;
14:
15: import jakarta.json.stream.JsonGenerator;
16:
17: import org.eclipse.yasson.internal.SerializationContextImpl;
18:
19: /**
20: * Type serializer.
21: * <br>
22: * All the instances are required to be reusable and without any states
23: * stored in the class fields.
24: */
25: public interface ModelSerializer {
26:
27: /**
28: * Serialize provided value or delegate serialization to the next serializer.
29: *
30: * @param value value to be serialized
31: * @param generator json generator
32: * @param context serialization context
33: */
34: void serialize(Object value, JsonGenerator generator, SerializationContextImpl context);
35:
36: }