{8.1.3-updated} Configurable Properties
Serializers and parsers have a wide variety of configurable properties. They all extend from the {@link oaj.BeanContextBuilder} class that allows you to easily construct new instances from scratch or build upon existing instances. For example, the following code shows how to configure a JSON serializer:
WriterSerializer s = JsonSerializer
.
Configurable settings can also be set declaratively. The following produces the same serializer.
WriterSerializer s = JsonSerializer
.
However, each of the serializers and parsers already contain reusable instances with common configurations. For example, JSON has the following predefined reusable serializers and parsers:
These can be used directly, as follows:
For performance reasons, serializers and parsers are immutable.
However, they can be 'copied' and modified using the
Configurable properties can be set globally using either system properties or environment variables.
For example, the