Package org.apache.johnzon.jaxrs
Class ConfigurableJohnzonProvider<T>
- java.lang.Object
-
- org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider<T>
-
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<T>
,jakarta.ws.rs.ext.MessageBodyWriter<T>
@Produces("application/json") @Consumes("application/json") public class ConfigurableJohnzonProvider<T> extends Object implements jakarta.ws.rs.ext.MessageBodyWriter<T>, jakarta.ws.rs.ext.MessageBodyReader<T>
-
-
Field Summary
Fields Modifier and Type Field Description private MapperBuilder
builder
private AtomicReference<JohnzonProvider<T>>
delegate
private List<String>
ignores
-
Constructor Summary
Constructors Constructor Description ConfigurableJohnzonProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Set<Class<?>>
asSet(String classes)
long
getSize(T t, Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
private JohnzonProvider<T>
instance()
boolean
isReadable(Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
boolean
isWriteable(Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
T
readFrom(Class<T> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
void
setAccessMode(AccessMode mode)
void
setAccessModeFieldFilteringStrategy(BaseAccessMode.FieldFilteringStrategy strategy)
void
setAccessModeFieldFilteringStrategyName(String mode)
void
setAccessModeName(String mode)
void
setAttributeOrder(Comparator<String> attributeOrder)
void
setAutoAdjustStringBuffers(boolean autoAdjustStringBuffers)
void
setBufferSize(int bufferSize)
void
setBufferStrategy(String bufferStrategy)
MapperBuilder
setDeduplicateObjects(boolean deduplicateObjects)
void
setDoCloseOnStreams(boolean doCloseOnStreams)
void
setEncoding(String encoding)
void
setFailOnUnknownProperties(boolean active)
void
setGeneratorFactory(jakarta.json.stream.JsonGeneratorFactory generatorFactory)
void
setIgnoreFieldsForType(String mapping)
void
setIgnores(String ignores)
void
setInterfaceImplementationMapping(Map<String,String> interfaceImplementationMapping)
void
setMaxSize(int size)
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
setPrimitiveConverters(boolean val)
void
setReadAttributeBeforeWrite(boolean rabw)
void
setReaderFactory(jakarta.json.JsonReaderFactory readerFactory)
void
setSerializeValueFilter(String val)
void
setSkipEmptyArray(boolean skipEmptyArray)
void
setSkipNull(boolean skipNull)
void
setSnippetMaxLength(int value)
void
setSupportConstructors(boolean supportConstructors)
void
setSupportGetterForCollections(boolean supportGetterForCollections)
void
setSupportHiddenAccess(boolean supportHiddenAccess)
void
setSupportsComments(boolean supportsComments)
void
setTreatByteArrayAsBase64(boolean treatByteArrayAsBase64)
void
setUseBigDecimalForFloats(boolean useBigDecimalForFloats)
void
setUseBigDecimalForObjectNumbers(boolean value)
void
setUseJsRange(boolean value)
void
setVersion(int version)
void
writeTo(T t, Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
-
-
-
Field Detail
-
builder
private MapperBuilder builder
-
delegate
private AtomicReference<JohnzonProvider<T>> delegate
-
-
Method Detail
-
instance
private JohnzonProvider<T> instance()
-
isReadable
public boolean isReadable(Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
- Specified by:
isReadable
in interfacejakarta.ws.rs.ext.MessageBodyReader<T>
-
readFrom
public T readFrom(Class<T> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
- Specified by:
readFrom
in interfacejakarta.ws.rs.ext.MessageBodyReader<T>
- Throws:
IOException
-
getSize
public long getSize(T t, Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
- Specified by:
getSize
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
isWriteable
public boolean isWriteable(Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteable
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
writeTo
public void writeTo(T t, Class<?> rawType, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException
- Specified by:
writeTo
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
- Throws:
IOException
-
setSnippetMaxLength
public void setSnippetMaxLength(int value)
-
setUseJsRange
public void setUseJsRange(boolean value)
-
setUseBigDecimalForObjectNumbers
public void setUseBigDecimalForObjectNumbers(boolean value)
-
setIgnoreFieldsForType
public void setIgnoreFieldsForType(String mapping)
-
setFailOnUnknownProperties
public void setFailOnUnknownProperties(boolean active)
-
setPolymorphicSerializationPredicate
public void setPolymorphicSerializationPredicate(String classes)
-
setPolymorphicDeserializationPredicate
public void setPolymorphicDeserializationPredicate(String classes)
-
setPolymorphicDiscriminatorMapper
public void setPolymorphicDiscriminatorMapper(Map<String,String> discriminatorMapper)
-
setPolymorphicTypeLoader
public void setPolymorphicTypeLoader(Map<String,String> aliasTypeMapping)
-
setPolymorphicDiscriminator
public void setPolymorphicDiscriminator(String value)
-
setSupportConstructors
public void setSupportConstructors(boolean supportConstructors)
-
setPretty
public void setPretty(boolean pretty)
-
setSupportGetterForCollections
public void setSupportGetterForCollections(boolean supportGetterForCollections)
-
setSupportsComments
public void setSupportsComments(boolean supportsComments)
-
setIgnores
public void setIgnores(String ignores)
-
setAccessMode
public void setAccessMode(AccessMode mode)
-
setAccessModeName
public void setAccessModeName(String mode)
-
setAccessModeFieldFilteringStrategy
public void setAccessModeFieldFilteringStrategy(BaseAccessMode.FieldFilteringStrategy strategy)
-
setInterfaceImplementationMapping
public void setInterfaceImplementationMapping(Map<String,String> interfaceImplementationMapping)
-
setAccessModeFieldFilteringStrategyName
public void setAccessModeFieldFilteringStrategyName(String mode)
-
setSupportHiddenAccess
public void setSupportHiddenAccess(boolean supportHiddenAccess)
-
setAttributeOrder
public void setAttributeOrder(Comparator<String> attributeOrder)
-
setReaderFactory
public void setReaderFactory(jakarta.json.JsonReaderFactory readerFactory)
-
setGeneratorFactory
public void setGeneratorFactory(jakarta.json.stream.JsonGeneratorFactory generatorFactory)
-
setDoCloseOnStreams
public void setDoCloseOnStreams(boolean doCloseOnStreams)
-
setVersion
public void setVersion(int version)
-
setSkipNull
public void setSkipNull(boolean skipNull)
-
setSkipEmptyArray
public void setSkipEmptyArray(boolean skipEmptyArray)
-
setBufferSize
public void setBufferSize(int bufferSize)
-
setBufferStrategy
public void setBufferStrategy(String bufferStrategy)
-
setMaxSize
public void setMaxSize(int size)
-
setTreatByteArrayAsBase64
public void setTreatByteArrayAsBase64(boolean treatByteArrayAsBase64)
-
setEncoding
public void setEncoding(String encoding)
-
setReadAttributeBeforeWrite
public void setReadAttributeBeforeWrite(boolean rabw)
-
setPrimitiveConverters
public void setPrimitiveConverters(boolean val)
-
setDeduplicateObjects
public MapperBuilder setDeduplicateObjects(boolean deduplicateObjects)
-
setSerializeValueFilter
public void setSerializeValueFilter(String val)
-
setUseBigDecimalForFloats
public void setUseBigDecimalForFloats(boolean useBigDecimalForFloats)
-
setAutoAdjustStringBuffers
public void setAutoAdjustStringBuffers(boolean autoAdjustStringBuffers)
-
-