@Provider @Produces(value="application/json") @Consumes(value="application/json") public class JsonbJaxrsProvider<T> extends Object implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>
Modifier and Type | Field and Description |
---|---|
private javax.json.bind.JsonbConfig |
config |
private AtomicReference<javax.json.bind.Jsonb> |
delegate |
private Collection<String> |
ignores |
Modifier | Constructor and Description |
---|---|
|
JsonbJaxrsProvider() |
protected |
JsonbJaxrsProvider(Collection<String> ignores) |
Modifier and Type | Method and Description |
---|---|
protected javax.json.bind.Jsonb |
createJsonb() |
private javax.json.bind.Jsonb |
delegate() |
long |
getSize(T t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
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) |
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 |
setFailOnUnknownProperties(boolean active) |
void |
setIJson(boolean active) |
void |
setNullValues(boolean nulls) |
void |
setOtherProperties(String others) |
void |
setPretty(boolean pretty) |
void |
setPropertyNamingStrategy(String propertyNamingStrategy) |
void |
setPropertyOrderStrategy(String propertyOrderStrategy) |
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) |
private final Collection<String> ignores
private final AtomicReference<javax.json.bind.Jsonb> delegate
private final javax.json.bind.JsonbConfig config
public JsonbJaxrsProvider()
protected JsonbJaxrsProvider(Collection<String> ignores)
protected javax.json.bind.Jsonb createJsonb()
private boolean isIgnored(Class<?> type)
public void setFailOnUnknownProperties(boolean active)
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 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 IOException, javax.ws.rs.WebApplicationException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<T>
IOException
javax.ws.rs.WebApplicationException
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 IOException, javax.ws.rs.WebApplicationException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<T>
IOException
javax.ws.rs.WebApplicationException
private javax.json.bind.Jsonb delegate()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.