/** * Method used by module registration functionality, to attach additional * serializer providers into this serializer factory. This is typically * handled by constructing a new instance with additional serializers, * to ensure thread-safe access. * * @since 1.7 */ @Override public SerializerFactory withConfig(Config config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between losing subtype instance * when registering additional serializers, or losing serializers. * Instead, let's actually just throw an error if this method is called when subtype * has not properly overridden this method; this to indicate problem as soon as possible. */ if (getClass() != BeanSerializerFactory.class) { throw new IllegalStateException("Subtype of BeanSerializerFactory ("+getClass().getName() +") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " +"additional serializer definitions"); } return new BeanSerializerFactory(config); }
/** * Method used by module registration functionality, to attach additional * serializer providers into this serializer factory. This is typically * handled by constructing a new instance with additional serializers, * to ensure thread-safe access. * * @since 1.7 */ @Override public SerializerFactory withConfig(Config config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between losing subtype instance * when registering additional serializers, or losing serializers. * Instead, let's actually just throw an error if this method is called when subtype * has not properly overridden this method; this to indicate problem as soon as possible. */ if (getClass() != BeanSerializerFactory.class) { throw new IllegalStateException("Subtype of BeanSerializerFactory ("+getClass().getName() +") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " +"additional serializer definitions"); } return new BeanSerializerFactory(config); }
/** * Method used by module registration functionality, to attach additional * serializer providers into this serializer factory. This is typically * handled by constructing a new instance with additional serializers, * to ensure thread-safe access. * * @since 1.7 */ @Override public SerializerFactory withConfig(Config config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between losing subtype instance * when registering additional serializers, or losing serializers. * Instead, let's actually just throw an error if this method is called when subtype * has not properly overridden this method; this to indicate problem as soon as possible. */ if (getClass() != BeanSerializerFactory.class) { throw new IllegalStateException("Subtype of BeanSerializerFactory ("+getClass().getName() +") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " +"additional serializer definitions"); } return new BeanSerializerFactory(config); }
/** * Method used by module registration functionality, to attach additional * serializer providers into this serializer factory. This is typically * handled by constructing a new instance with additional serializers, * to ensure thread-safe access. * * @since 1.7 */ @Override public SerializerFactory withConfig(Config config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between losing subtype instance * when registering additional serializers, or losing serializers. * Instead, let's actually just throw an error if this method is called when subtype * has not properly overridden this method; this to indicate problem as soon as possible. */ if (getClass() != BeanSerializerFactory.class) { throw new IllegalStateException("Subtype of BeanSerializerFactory ("+getClass().getName() +") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " +"additional serializer definitions"); } return new BeanSerializerFactory(config); }
/** * Method used by module registration functionality, to attach additional * serializer providers into this serializer factory. This is typically * handled by constructing a new instance with additional serializers, * to ensure thread-safe access. * * @since 1.7 */ @Override public SerializerFactory withConfig(Config config) { if (_factoryConfig == config) { return this; } /* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor; * and we pretty much have to here either choose between losing subtype instance * when registering additional serializers, or losing serializers. * Instead, let's actually just throw an error if this method is called when subtype * has not properly overridden this method; this to indicate problem as soon as possible. */ if (getClass() != BeanSerializerFactory.class) { throw new IllegalStateException("Subtype of BeanSerializerFactory ("+getClass().getName() +") has not properly overridden method 'withAdditionalSerializers': can not instantiate subtype with " +"additional serializer definitions"); } return new BeanSerializerFactory(config); }