public interface HttpPartSerializer
The following default implementations are provided:
OpenApiSerializer
- Parts encoded based on OpenAPI schema.
UonSerializer
- Parts encoded in UON notation.
SimplePartSerializer
- Parts encoded in plain text.
This class is used in the following locations:
FormData.serializer()
Query.serializer()
Header.serializer()
Path.serializer()
Request.partSerializer()
Response.partSerializer()
Implementations must include either a public no-args constructor or a public constructor that takes in a single
PropertyStore
object.
Modifier and Type | Interface and Description |
---|---|
static interface |
HttpPartSerializer.Null
Represent "no" part part serializer.
|
Modifier and Type | Method and Description |
---|---|
HttpPartSerializerSession |
createPartSession()
Creates a new no-argument serializer session.
|
HttpPartSerializerSession |
createPartSession(SerializerSessionArgs args)
Creates a new serializer session.
|
String |
serialize(HttpPartSchema schema,
Object value)
Convenience method for creating a no-arg session and serializing a part with no specified part type.
|
String |
serialize(HttpPartType partType,
HttpPartSchema schema,
Object value)
Convenience method for creating a no-arg session and serializing a part.
|
HttpPartSerializerSession createPartSession(SerializerSessionArgs args)
args
- The runtime arguments for the session.HttpPartSerializerSession createPartSession()
String serialize(HttpPartType partType, HttpPartSchema schema, Object value) throws SchemaValidationException, SerializeException
partType
- The category of value being serialized.schema
- Schema information about the part.
value
- The value being serialized.SerializeException
- If a problem occurred while trying to parse the input.SchemaValidationException
- If the output fails schema validation.String serialize(HttpPartSchema schema, Object value) throws SchemaValidationException, SerializeException
schema
- Schema information about the part.
value
- The value being serialized.SerializeException
- If a problem occurred while trying to parse the input.SchemaValidationException
- If the output fails schema validation.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.