| Modifier and Type | Field and Description |
|---|---|
| protected HashMap | _cfgCustomUntouchables
Map that contains overrides to default list of untouchable
types: |
| protected Class | _defaultReadView
View to use for reading if none defined for the end point. |
| protected Class | _defaultWriteView
View to use for writing if none defined for the end point. |
| protected int | _jaxRSFeatures
Feature flags set. |
| protected final MAPPER_CONFIG | _mapperConfig
Helper object used for encapsulating configuration aspects
of |
| protected final AtomicReference | |
| protected final LookupCache | _readers
Cache for resolved endpoint configurations when reading JSON data |
| public static final Class | |
| public static final HashSet | |
| public static final Class | |
| protected final LookupCache | _writers
Cache for resolved endpoint configurations when writing JSON data |
| protected static final String | |
| public static final Class | DEFAULT_UNREADABLES
These are classes that we never use for reading (never try to deserialize instances of these types). |
| protected static final HashSet | DEFAULT_UNTOUCHABLES
Looks like we need to worry about accidental data binding for types we shouldn't be handling. |
| public static final Class | DEFAULT_UNWRITABLES
These are classes that we never use for writing (never try to serialize instances of these types). |
| public static final String | HEADER_CONTENT_TYPE_OPTIONS
This header is useful on Windows, trying to deal with potential XSS attacks. |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ProviderBase()
Deprecated
Constructor that is only added to resolve issue #10; problems with combination of RESTeasy and CDI. |
| protected | ProviderBase(MAPPER_CONFIG mconfig, LookupCache<AnnotationBundleKey, EP_CONFIG> readerCache, LookupCache<AnnotationBundleKey, EP_CONFIG> writerCache)
|
| Modifier and Type | Method and Description |
|---|---|
| protected static void | _addSuperTypes(Class<?> cls, Class<?> endBefore, Collection<Class<?>> result, boolean addClassItself)
|
| protected EP_CONFIG | |
| protected abstract EP_CONFIG | |
| protected EP_CONFIG | |
| protected abstract EP_CONFIG | |
| protected static boolean | |
| protected JsonGenerator | _createGenerator(ObjectWriter writer, OutputStream rawStream, JsonEncoding enc)
Overridable helper method called to create a |
| protected NoContentException | |
| protected JsonParser | _createParser(ObjectReader reader, InputStream rawStream)
Overridable helper method called to create a |
| protected EP_CONFIG | _endpointForReading(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders)
Overridable helper method that will basically fetch representation of the
endpoint that can be used to get |
| protected EP_CONFIG | _endpointForWriting(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders)
|
| protected Boolean | |
| protected boolean | _isIgnorableForReading(ClassKey typeKey)
Overridable helper method called to check whether given type is a known "ignorable type" (in context of reading), values of which are not bound from content. |
| protected boolean | _isIgnorableForWriting(ClassKey typeKey)
Overridable helper method called to check whether given type is a known "ignorable type" (in context of reading), values of which can not be written out. |
| protected boolean | _isSpecialReadable(Class<?> type)
Overridable helper method used to allow handling of somewhat special types for reading |
| protected abstract MAPPER | _locateMapperViaProvider(Class<?> type, MediaType mediaType)
Helper method that is called if no mapper has been explicitly configured. |
| protected void | _modifyHeaders(Object value, Class<?> type, Type genericType, Annotation[] annotations, MultivaluedMap<String, Object> httpHeaders, EP_CONFIG endpoint)
Overridable method used for adding optional response headers before serializing response object. |
| private final THIS | |
| public void | addUntouchable(Class<?>
Type to consider untouchable; can be any kind of class,
including abstract class or interface. No instance of this type
(including subtypes, i.e. types assignable to this type) will
be read or written by provider type)Method for marking specified type as "untouchable", meaning that provider will not try to read or write values of this type (or its subtypes). |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| public THIS | |
| protected JsonEncoding | findEncoding(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders)
Helper method to use for determining desired output encoding. |
| protected static List | |
| protected static List | |
| public long | getSize(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
Overrides default javax. Method that JAX-RS container calls to try to figure out serialized length of given value. |
| protected abstract boolean | hasMatchingMediaType(MediaType mediaType)
Helper method used to check whether given media type is supported by this provider. |
| protected boolean | hasMatchingMediaTypeForReading(MediaType mediaType)
Helper method used to check whether given media type is supported by this provider for read operations (when binding input data such as POST body). |
| protected boolean | hasMatchingMediaTypeForWriting(MediaType mediaType)
Helper method used to check whether given media type is supported by this provider for writing operations, such as when converting response object to response body of request (like GET or POST). |
| public boolean | |
| public boolean | isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
Implements javax. Method that JAX-RS container calls to try to check whether values of given type (and media type) can be deserialized by this provider. |
| public boolean | isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
Implements javax. Method that JAX-RS container calls to try to check whether given value (of specified type) can be serialized by this provider. |
| public MAPPER | locateMapper(Class<?>
Class of object being serialized or deserialized;
not checked at this point, since it is assumed that unprocessable
classes have been already weeded out,
but will be passed to type, MediaType ContextResolver as is.Declared media type for the instance to process:
not used by this method,
but will be passed to mediaType)ContextResolver as is.Method called to locate |
| public Object | readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
Implements javax. Method that JAX-RS container calls to deserialize given value. |
| public void | removeUntouchable(Class<?> type)
Method for removing definition of specified type as untouchable: usually only |
| public void | setAnnotationsToUse(AnnotationIntrospector
AnnotationIntrospector to configure mapper to use
( aiOverride)null to leave it as default one)Method for overriding |
| public THIS | setDefaultReadView(Class<?> view)
Method for specifying JSON View to use for reading content when end point does not have explicit View annotations. |
| public THIS | setDefaultView(Class<?> view)
Method for specifying JSON View to use for reading and writing content when end point does not have explicit View annotations. |
| public THIS | setDefaultWriteView(Class<?> view)
Method for specifying JSON View to use for reading content when end point does not have explicit View annotations. |
| public void | setMapper(MAPPER m)
Method that can be used to directly define |
| public void | writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
Implements javax. Method that JAX-RS container calls to serialize given value. |
| _cfgCustomUntouchables | back to summary |
|---|---|
| protected HashMap<ClassKey, Boolean> _cfgCustomUntouchables Map that contains overrides to default list of untouchable
types: | |
| _defaultReadView | back to summary |
|---|---|
| protected Class<?> _defaultReadView View to use for reading if none defined for the end point. | |
| _defaultWriteView | back to summary |
|---|---|
| protected Class<?> _defaultWriteView View to use for writing if none defined for the end point. | |
| _jaxRSFeatures | back to summary |
|---|---|
| protected int _jaxRSFeatures Feature flags set. | |
| _mapperConfig | back to summary |
|---|---|
| protected final MAPPER_CONFIG _mapperConfig Helper object used for encapsulating configuration aspects
of | |
| _noContentExceptionRef | back to summary |
|---|---|
| protected final AtomicReference<IOException> _noContentExceptionRef | |
| _readers | back to summary |
|---|---|
| protected final LookupCache<AnnotationBundleKey, EP_CONFIG> _readers Cache for resolved endpoint configurations when reading JSON data | |
| _unreadableClasses | back to summary |
|---|---|
| public static final Class<?>[] _unreadableClasses | |
| _untouchables | back to summary |
|---|---|
| public static final HashSet<ClassKey> _untouchables | |
| _unwritableClasses | back to summary |
|---|---|
| public static final Class<?>[] _unwritableClasses | |
| _writers | back to summary |
|---|---|
| protected final LookupCache<AnnotationBundleKey, EP_CONFIG> _writers Cache for resolved endpoint configurations when writing JSON data | |
| CLASS_NAME_NO_CONTENT_EXCEPTION | back to summary |
|---|---|
| protected static final String CLASS_NAME_NO_CONTENT_EXCEPTION | |
| DEFAULT_UNREADABLES | back to summary |
|---|---|
| public static final Class<?>[] DEFAULT_UNREADABLES These are classes that we never use for reading (never try to deserialize instances of these types). | |
| DEFAULT_UNTOUCHABLES | back to summary |
|---|---|
| protected static final HashSet<ClassKey> DEFAULT_UNTOUCHABLES Looks like we need to worry about accidental data binding for types we shouldn't be handling. This is probably not a very good way to do it, but let's start by blacklisting things we are not to handle. (why ClassKey? since plain old Class has no hashCode() defined, lookups are painfully slow) | |
| DEFAULT_UNWRITABLES | back to summary |
|---|---|
| public static final Class<?>[] DEFAULT_UNWRITABLES These are classes that we never use for writing (never try to serialize instances of these types). | |
| HEADER_CONTENT_TYPE_OPTIONS | back to summary |
|---|---|
| public static final String HEADER_CONTENT_TYPE_OPTIONS This header is useful on Windows, trying to deal with potential XSS attacks. | |
| JAXRS_FEATURE_DEFAULTS | back to summary |
|---|---|
| protected static final int JAXRS_FEATURE_DEFAULTS | |
| ProviderBase | back to summary |
|---|---|
| protected ProviderBase(MAPPER_CONFIG mconfig) | |
| ProviderBase | back to summary |
|---|---|
| protected ProviderBase()
Deprecated
Constructor that is only added to resolve issue #10; problems with combination of RESTeasy and CDI. Should NOT be used by any code explicitly; only exists for proxy support.
| |
| ProviderBase | back to summary |
|---|---|
| protected ProviderBase(MAPPER_CONFIG mconfig, LookupCache<AnnotationBundleKey, EP_CONFIG> readerCache, LookupCache<AnnotationBundleKey, EP_CONFIG> writerCache) | |
| _addSuperTypes | back to summary |
|---|---|
| protected static void _addSuperTypes(Class<?> cls, Class<?> endBefore, Collection<Class<?>> result, boolean addClassItself) | |
| _configForReading | back to summary |
|---|---|
| protected EP_CONFIG _configForReading(MAPPER mapper, Annotation[] annotations, Class<?> defaultView) | |
| _configForReading | back to summary |
|---|---|
| protected abstract EP_CONFIG _configForReading(ObjectReader reader, Annotation[] annotations) | |
| _configForWriting | back to summary |
|---|---|
| protected EP_CONFIG _configForWriting(MAPPER mapper, Annotation[] annotations, Class<?> defaultView) | |
| _configForWriting | back to summary |
|---|---|
| protected abstract EP_CONFIG _configForWriting(ObjectWriter writer, Annotation[] annotations) | |
| _containedIn | back to summary |
|---|---|
| protected static boolean _containedIn(Class<?> mainType, HashSet<ClassKey> set) | |
| _createGenerator | back to summary |
|---|---|
| protected JsonGenerator _createGenerator(ObjectWriter writer, OutputStream rawStream, JsonEncoding enc) throws JacksonException Overridable helper method called to create a | |
| _createNoContentException | back to summary |
|---|---|
| protected NoContentException _createNoContentException() | |
| _createParser | back to summary |
|---|---|
| protected JsonParser _createParser(ObjectReader reader, InputStream rawStream) throws JacksonException Overridable helper method called to create a | |
| _endpointForReading | back to summary |
|---|---|
| protected EP_CONFIG _endpointForReading(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders) Overridable helper method that will basically fetch representation of the
endpoint that can be used to get | |
| _endpointForWriting | back to summary |
|---|---|
| protected EP_CONFIG _endpointForWriting(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) | |
| _findCustomUntouchable | back to summary |
|---|---|
| protected Boolean _findCustomUntouchable(Class<?> mainType) | |
| _isIgnorableForReading | back to summary |
|---|---|
| protected boolean _isIgnorableForReading(ClassKey typeKey) Overridable helper method called to check whether given type is a known "ignorable type" (in context of reading), values of which are not bound from content. | |
| _isIgnorableForWriting | back to summary |
|---|---|
| protected boolean _isIgnorableForWriting(ClassKey typeKey) Overridable helper method called to check whether given type is a known "ignorable type" (in context of reading), values of which can not be written out. | |
| _isSpecialReadable | back to summary |
|---|---|
| protected boolean _isSpecialReadable(Class<?> type) Overridable helper method used to allow handling of somewhat special types for reading | |
| _locateMapperViaProvider | back to summary |
|---|---|
| protected abstract MAPPER _locateMapperViaProvider(Class<?> type, MediaType mediaType) Helper method that is called if no mapper has been explicitly configured. | |
| _modifyHeaders | back to summary |
|---|---|
| protected void _modifyHeaders(Object value, Class<?> type, Type genericType, Annotation[] annotations, MultivaluedMap<String, Object> httpHeaders, EP_CONFIG endpoint) throws JacksonException Overridable method used for adding optional response headers before serializing response object. | |
| _this | back to summary |
|---|---|
private final THIS _this()
| |
| addUntouchable | back to summary |
|---|---|
| public void addUntouchable(Class<?> type) Method for marking specified type as "untouchable", meaning that provider will not try to read or write values of this type (or its subtypes).
| |
| configure | back to summary |
|---|---|
| public THIS configure(JaxRSFeature feature, boolean state) | |
| configure | back to summary |
|---|---|
| public THIS configure(DeserializationFeature f, boolean state) | |
| configure | back to summary |
|---|---|
| public THIS configure(SerializationFeature f, boolean state) | |
| disable | back to summary |
|---|---|
| public THIS disable(JaxRSFeature feature) | |
| disable | back to summary |
|---|---|
| public THIS disable(JaxRSFeature first, JaxRSFeature... f2) | |
| disable | back to summary |
|---|---|
| public THIS disable(DeserializationFeature f) | |
| disable | back to summary |
|---|---|
| public THIS disable(SerializationFeature f) | |
| enable | back to summary |
|---|---|
| public THIS enable(JaxRSFeature feature) | |
| enable | back to summary |
|---|---|
| public THIS enable(JaxRSFeature first, JaxRSFeature... f2) | |
| enable | back to summary |
|---|---|
| public THIS enable(DeserializationFeature f) | |
| enable | back to summary |
|---|---|
| public THIS enable(SerializationFeature f) | |
| findEncoding | back to summary |
|---|---|
| protected JsonEncoding findEncoding(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) Helper method to use for determining desired output encoding. For now, will always just use UTF-8... | |
| findSuperTypes | back to summary |
|---|---|
| protected static List | |
| findSuperTypes | back to summary |
|---|---|
| protected static List | |
| getSize | back to summary |
|---|---|
| public long getSize(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) Overrides default javax. Method that JAX-RS container calls to try to figure out serialized length of given value. Since computation of this length is about as expensive as serialization itself, implementation will return -1 to denote "not known", so that container will determine length from actual serialized output (if needed).
| |
| hasMatchingMediaType | back to summary |
|---|---|
| protected abstract boolean hasMatchingMediaType(MediaType mediaType) Helper method used to check whether given media type is supported by this provider. | |
| hasMatchingMediaTypeForReading | back to summary |
|---|---|
| protected boolean hasMatchingMediaTypeForReading(MediaType mediaType) Helper method used to check whether given media type is supported by this provider for read operations (when binding input data such as POST body).
Default implementation simply calls | |
| hasMatchingMediaTypeForWriting | back to summary |
|---|---|
| protected boolean hasMatchingMediaTypeForWriting(MediaType mediaType) Helper method used to check whether given media type is supported by this provider for writing operations, such as when converting response object to response body of request (like GET or POST).
Default implementation simply calls | |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled(JaxRSFeature f) | |
| isReadable | back to summary |
|---|---|
| public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) Implements javax. Method that JAX-RS container calls to try to check whether
values of given type (and media type) can be deserialized by
this provider.
Implementation will first check that expected media type is
a JSON type (via call to Note in 2.x also checked (if configured) for "canDeserialize()", but with 3.x that is not done since there that detection never worked in a useful manner.
| |
| isWriteable | back to summary |
|---|---|
| public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) Implements javax. Method that JAX-RS container calls to try to check whether
given value (of specified type) can be serialized by
this provider.
Implementation will first check that expected media type is
expected one (by call to Note in 2.x also checked (if configured) for "canSerialize()", but with 3.x that is not done since there that detection never worked in a useful manner.
| |
| locateMapper | back to summary |
|---|---|
| public MAPPER locateMapper(Class<?> type, MediaType mediaType) Method called to locate
If
If
| |
| readFrom | back to summary |
|---|---|
| public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws JacksonException, NoContentException Implements javax. Method that JAX-RS container calls to deserialize given value.
| |
| removeUntouchable | back to summary |
|---|---|
| public void removeUntouchable(Class<?> type) Method for removing definition of specified type as untouchable: usually only | |
| setAnnotationsToUse | back to summary |
|---|---|
| public void setAnnotationsToUse(AnnotationIntrospector aiOverride) Method for overriding
| |
| setDefaultReadView | back to summary |
|---|---|
| public THIS setDefaultReadView(Class<?> view) Method for specifying JSON View to use for reading content when end point does not have explicit View annotations. | |
| setDefaultView | back to summary |
|---|---|
| public THIS setDefaultView(Class<?> view) Method for specifying JSON View to use for reading and writing content
when end point does not have explicit View annotations.
Functionally equivalent to:
| |
| setDefaultWriteView | back to summary |
|---|---|
| public THIS setDefaultWriteView(Class<?> view) Method for specifying JSON View to use for reading content when end point does not have explicit View annotations. | |
| setMapper | back to summary |
|---|---|
| public void setMapper(MAPPER m) Method that can be used to directly define | |
| writeTo | back to summary |
|---|---|
| public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws JacksonException Implements javax. Method that JAX-RS container calls to serialize given value.
| |