@Provider
@Produces(value="application/json")
@Consumes(value="application/json")
@Priority(value=4900)
public class JsonbJaxrsProvider<T>
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>, java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
private static class |
JsonbJaxrsProvider.DynamicInstance |
private static class |
JsonbJaxrsProvider.ProvidedInstance |
private static interface |
JsonbJaxrsProvider.ReadImpl |
Modifier and Type | Field and Description |
---|---|
protected javax.json.bind.JsonbConfig |
config |
private boolean |
customized |
protected java.util.function.Function<java.lang.Class<?>,javax.json.bind.Jsonb> |
delegate |
protected java.util.Collection<java.lang.String> |
ignores |
private javax.ws.rs.ext.Providers |
providers |
protected JsonbJaxrsProvider.ReadImpl |
readImpl |
private java.lang.Boolean |
throwNoContentExceptionOnEmptyStreams |
Modifier | Constructor and Description |
---|---|
|
JsonbJaxrsProvider() |
protected |
JsonbJaxrsProvider(java.util.Collection<java.lang.String> ignores) |
Modifier and Type | Method and Description |
---|---|
private java.util.Set<java.lang.Class<?>> |
asSet(java.lang.String classes) |
void |
close() |
protected javax.json.bind.Jsonb |
createJsonb() |
private java.lang.Object |
doRead(javax.json.bind.Jsonb jsonb,
java.lang.reflect.Type t,
java.io.InputStream stream) |
private java.lang.Object |
doReadWithNoContentException(javax.json.bind.Jsonb jsonb,
java.lang.reflect.Type t,
java.io.InputStream stream) |
protected javax.json.bind.Jsonb |
getJsonb(java.lang.Class<?> type) |
private PolymorphicConfig |
getOrCreatePolymorphicConfig() |
long |
getSize(T t,
java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
private boolean |
initThrowNoContentExceptionOnEmptyStreams() |
private boolean |
isIgnored(java.lang.Class<?> type) |
boolean |
isReadable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isWriteable(java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
private java.util.logging.Logger |
logger() |
T |
readFrom(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders,
java.io.InputStream entityStream) |
void |
setBinaryDataStrategy(java.lang.String binaryDataStrategy) |
void |
setEncoding(java.lang.String encoding) |
void |
setFailOnMissingCreatorValues(boolean failOnMissingCreatorValues) |
void |
setFailOnUnknownProperties(boolean active) |
void |
setIJson(boolean active) |
void |
setInterfaceImplementationMapping(java.util.Map<java.lang.String,java.lang.String> interfaceImplementationMapping) |
void |
setNullValues(boolean nulls) |
void |
setOtherProperties(java.lang.String others) |
void |
setPolymorphicDeserializationPredicate(java.lang.String classes) |
void |
setPolymorphicDiscriminator(java.lang.String value) |
void |
setPolymorphicDiscriminatorMapper(java.util.Map<java.lang.String,java.lang.String> discriminatorMapper) |
void |
setPolymorphicSerializationPredicate(java.lang.String classes) |
void |
setPolymorphicTypeLoader(java.util.Map<java.lang.String,java.lang.String> aliasTypeMapping) |
void |
setPretty(boolean pretty) |
void |
setPropertyNamingStrategy(java.lang.String propertyNamingStrategy) |
void |
setPropertyOrderStrategy(java.lang.String propertyOrderStrategy) |
void |
setThrowNoContentExceptionOnEmptyStreams(boolean throwNoContentExceptionOnEmptyStreams) |
void |
setUseJsRange(boolean value) |
void |
writeTo(T t,
java.lang.Class<?> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
java.io.OutputStream entityStream) |
protected final java.util.Collection<java.lang.String> ignores
protected final javax.json.bind.JsonbConfig config
protected volatile java.util.function.Function<java.lang.Class<?>,javax.json.bind.Jsonb> delegate
protected volatile JsonbJaxrsProvider.ReadImpl readImpl
private boolean customized
private java.lang.Boolean throwNoContentExceptionOnEmptyStreams
@Context private javax.ws.rs.ext.Providers providers
public JsonbJaxrsProvider()
protected JsonbJaxrsProvider(java.util.Collection<java.lang.String> ignores)
private boolean isIgnored(java.lang.Class<?> type)
public void setThrowNoContentExceptionOnEmptyStreams(boolean throwNoContentExceptionOnEmptyStreams)
public void setFailOnUnknownProperties(boolean active)
public void setUseJsRange(boolean value)
public void setOtherProperties(java.lang.String others)
public void setIJson(boolean active)
public void setEncoding(java.lang.String encoding)
public void setBinaryDataStrategy(java.lang.String binaryDataStrategy)
public void setPropertyNamingStrategy(java.lang.String propertyNamingStrategy)
public void setPropertyOrderStrategy(java.lang.String propertyOrderStrategy)
public void setNullValues(boolean nulls)
public void setPretty(boolean pretty)
public void setFailOnMissingCreatorValues(boolean failOnMissingCreatorValues)
public void setInterfaceImplementationMapping(java.util.Map<java.lang.String,java.lang.String> interfaceImplementationMapping)
public void setPolymorphicSerializationPredicate(java.lang.String classes)
public void setPolymorphicDeserializationPredicate(java.lang.String classes)
public void setPolymorphicDiscriminatorMapper(java.util.Map<java.lang.String,java.lang.String> discriminatorMapper)
public void setPolymorphicTypeLoader(java.util.Map<java.lang.String,java.lang.String> aliasTypeMapping)
public void setPolymorphicDiscriminator(java.lang.String value)
private PolymorphicConfig getOrCreatePolymorphicConfig()
private java.util.Set<java.lang.Class<?>> asSet(java.lang.String classes)
public boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<T>
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<T>
public long getSize(T t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<T>
public T readFrom(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream) throws javax.ws.rs.WebApplicationException, java.io.IOException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<T>
javax.ws.rs.WebApplicationException
java.io.IOException
public void writeTo(T t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream) throws javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<T>
javax.ws.rs.WebApplicationException
protected javax.json.bind.Jsonb createJsonb()
protected javax.json.bind.Jsonb getJsonb(java.lang.Class<?> type)
private boolean initThrowNoContentExceptionOnEmptyStreams()
private java.lang.Object doRead(javax.json.bind.Jsonb jsonb, java.lang.reflect.Type t, java.io.InputStream stream)
private java.lang.Object doReadWithNoContentException(javax.json.bind.Jsonb jsonb, java.lang.reflect.Type t, java.io.InputStream stream) throws javax.ws.rs.core.NoContentException
javax.ws.rs.core.NoContentException
private java.util.logging.Logger logger()
public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.