- All Implemented Interfaces:
RuntimeType.Api<JsonpSupportConfig>,NamedService,NamedService,MediaSupport
public class JsonpSupport
extends MediaSupportBase<JsonpSupportConfig>
implements RuntimeType.Api<JsonpSupportConfig>
Media support implementation for JSON Processing media support.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.http.media.MediaSupport
MediaSupport.ReaderResponse<T>, MediaSupport.SupportLevel, MediaSupport.WriterResponse<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GenericType<JsonArray> Json array generic type.static final GenericType<JsonObject> Json object generic type. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonpSupportConfig.Builderbuilder()Creates a new builder.protected booleancanDeserialize(GenericType<?> type) Check whether the type is supported by this media support for deserialization.protected booleancanSerialize(GenericType<?> type) Check whether the type is supported by this media support for serialization.static MediaSupportcreate()Creates a newJsonpSupport.static MediaSupportDeprecated, for removal: This API element is subject to removal in a future version.static MediaSupportDeprecated, for removal: This API element is subject to removal in a future version.static MediaSupportCreates a newJsonpSupport.static MediaSupportCreates a new namedJsonpSupport.static JsonpSupportcreate(JsonpSupportConfig jsonpSupportConfig) Creates a newJsonpSupportbased on theJsonpSupportConfig.static JsonpSupportcreate(Consumer<JsonpSupportConfig.Builder> consumer) Creates a new customizedJsonpSupport.The prototype as it was received when creating this runtime object instance.<T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders) Reader for an entity.<T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders, Headers responseHeaders) Client response reader.static <T extends JsonStructure>
EntityReader<T> Server request reader direct access.static <T extends JsonStructure>
EntityWriter<T> Server response writer direct access.type()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().<T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Server response writer.<T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, WritableHeaders<?> requestHeaders) Client request writer.Methods inherited from class io.helidon.http.media.MediaSupportBase
config, isMediaTypeSupported, matchesClientRequest, matchesClientResponse, matchesServerRequest, matchesServerResponse, nameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.http.media.MediaSupport
init
-
Field Details
-
JSON_OBJECT_TYPE
Json object generic type. -
JSON_ARRAY_TYPE
Json array generic type.
-
-
Method Details
-
create
Creates a newJsonpSupport.- Returns:
- a new
JsonpSupport
-
create
Deprecated, for removal: This API element is subject to removal in a future version.usecreate(io.helidon.config.Config)insteadCreates a newJsonpSupport.- Parameters:
config- must not benull- Returns:
- a new
JsonpSupport
-
create
Creates a newJsonpSupport.- Parameters:
config- must not benull- Returns:
- a new
JsonpSupport
-
create
@Deprecated(forRemoval=true, since="4.4.0") public static MediaSupport create(Config config, String name) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new namedJsonpSupport.- Parameters:
config- must not benullname- name of the support- Returns:
- a new
JsonpSupport
-
create
Creates a new namedJsonpSupport.- Parameters:
config- must not benullname- name of the support- Returns:
- a new
JsonpSupport
-
create
Creates a newJsonpSupportbased on theJsonpSupportConfig.- Parameters:
jsonpSupportConfig- must not benull- Returns:
- a new
JsonpSupport
-
create
Creates a new customizedJsonpSupport.- Parameters:
consumer- config builder consumer- Returns:
- a new
JsonpSupport
-
builder
Creates a new builder.- Returns:
- a new builder instance
-
serverResponseWriter
Server response writer direct access.- Type Parameters:
T- type to write- Returns:
- a writer to write JSON-P objects
-
serverRequestReader
Server request reader direct access.- Type Parameters:
T- type to read- Returns:
- a reader to read JSON-P objects
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Specified by:
typein interfaceNamedService- Overrides:
typein classMediaSupportBase<JsonpSupportConfig>- Returns:
- type of this service
-
reader
Description copied from interface:MediaSupportReader for an entity.- Specified by:
readerin interfaceMediaSupport- Type Parameters:
T- type- Parameters:
type- type of entityrequestHeaders- headers belonging to this entity (such as server request headers), expected to have content type- Returns:
- reader response, whether this type is supported or not
-
writer
public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, Headers requestHeaders, WritableHeaders<?> responseHeaders) Description copied from interface:MediaSupportServer response writer.- Specified by:
writerin interfaceMediaSupport- Type Parameters:
T- type- Parameters:
type- type of entityrequestHeaders- request headersresponseHeaders- response headers- Returns:
- writer response, whether this type is supported or not
-
reader
public <T> MediaSupport.ReaderResponse<T> reader(GenericType<T> type, Headers requestHeaders, Headers responseHeaders) Description copied from interface:MediaSupportClient response reader.- Specified by:
readerin interfaceMediaSupport- Type Parameters:
T- type- Parameters:
type- type of entityrequestHeaders- request headersresponseHeaders- response headers- Returns:
- reader response, whether this type is supported or not
-
writer
public <T> MediaSupport.WriterResponse<T> writer(GenericType<T> type, WritableHeaders<?> requestHeaders) Description copied from interface:MediaSupportClient request writer.- Specified by:
writerin interfaceMediaSupport- Type Parameters:
T- type- Parameters:
type- type of entityrequestHeaders- request headers- Returns:
- writer response, whether this type is supported or not
-
canSerialize
Description copied from class:MediaSupportBaseCheck whether the type is supported by this media support for serialization.- Specified by:
canSerializein classMediaSupportBase<JsonpSupportConfig>- Parameters:
type- type to check- Returns:
- whether this media support can handle this type
-
canDeserialize
Description copied from class:MediaSupportBaseCheck whether the type is supported by this media support for deserialization.- Specified by:
canDeserializein classMediaSupportBase<JsonpSupportConfig>- Parameters:
type- type to check- Returns:
- whether this media support can handle this type
-
prototype
Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<JsonpSupportConfig>- Returns:
- prototype object used to create this instance
-
create(io.helidon.config.Config)instead