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