java


How to override Jackson serializer


I have a default serializer assigned to a class:
#JsonSerialize(using = DefaultCustomSerializer.class)
class X { }
I want to disable it in some cases.
So I defined 2 ObjectMappers, one of these mappers registers another serializer.
objectMapper.registerModule(new SimpleModule().addSerializer(
X.class, new SpecialSerializer())
The problem is that module registration has no effect.
In both cases DefaultCustomSerializer is called.
I could try to define both serializes over modules, but I would like to
have a default serializer.
I anticipate there is some magic feature flag which will save my day.
Do you know about it?

Related Links

How to receive messages from server to client, without prompt from client
UCanAccess “given file does not exist:” error
Is there a way to put blank lines only before annotated fields in IDEA
c:foreach returns String and not an object
*Methods* calling a boolean [duplicate]
android studio 2.2.3 CANNOT TRANSLATE guest DNS ip with emulator: emulator window was out of view and was recentered
I am using Window Builder in eclipse for a project. I am trying to add a splash screen. I get the error Type Progress Bar cannot be resolve
repository element was not specified in the POM inside distributionManagement
Android Studio Application Problème running [duplicate]
Law of Demeter in Java
Non blocking IO and HystrixObservableCommand
In java if using call by reference i can make changes in value why can't i set it to null [duplicate]
Null Pointer in Java function [duplicate]
Split a string in Java by symbols
Using a timer in java Error
How do I take a compressed file (through indexes) and re-create the original file? (Java)

Categories

HOME
cakephp
client
osgi
cloud
openstack
azure-data-factory
hashmap
cmd
leon
jsrender
frameworks
jgroups
baqend
onelogin
networkx
uber-api
append
slurm
izpack
etl
timeout
n-gram
serverless-framework
progressive-web-apps
graphlab
pythonanywhere
dbext
tokenize
kudan
underflow
wpfdatagrid
bootstrap-material-design
filezilla
spring-mybatis
fluentvalidation
primitive
tasklet
microsoft-chart-controls
preg-match
functor
typed.js
commit
stacked
web-mining
espeak
serverside-rendering
libvpx
twitch
google-closure
dotcover
outlook-2013
statsd
drupal-6
setter
nativeapplication
diagnostics
knockout-components
magma
snmptrapd
python-cryptography
bonobo
django-debug-toolbar
plottable.js
qpid
connect-by
lua-5.1
unity-networking
srand
wso2cloud
wyam
0xdbe
mono-embedding
system32
javax.mail
fscommand
javafx-webengine
asp.net-web-api-odata
socketexception
websocket4net
centos5
pyhdf
multiprocessor
spring-io
dotnetnuke-5
ril
buster.js
mqx
free-variable
itmstransporter
qtkit
reddot
buildr
transactionscope
blackberry-playbook
locationlistener
xsdobjectgen
ncqrs
post-build

Resources

Encrypt Message