Class DefaultEncodingRegistry

java.lang.Object
io.permazen.encoding.SimpleEncodingRegistry
io.permazen.encoding.DefaultEncodingRegistry
All Implemented Interfaces:
EncodingRegistry

public class DefaultEncodingRegistry extends SimpleEncodingRegistry
Permazen's default EncodingRegistry.

Instances automatically register all of Permazen's built-in Encodings (see below).

Array Types

Because this class is a subclass of SimpleEncodingRegistry, encodings for array types are created on demand, so they don't need to be explicitly registered.

Enum Types

Encodings for Enum types are not registered in an EncodingRegistry. Instead, Enum values are represented as EnumValue instances, and Enum fields are specially defined in the schema with an explicit identifier list. In turn, EnumValue's are encoded by EnumValueEncoding.

Custom Encodings

During construction, instances scan the class path for custom EncodingRegistry implementations and will delegate to them when an encoding is not found.

If multiple custom EncodingRegistry implementations advertise the same encoding, one will be chosen arbitrarily.

Custom EncodingRegistry implemenations are specified via META-INF/services/io.permazen.encoding.EncodingRegistry files or by module exports; see ServiceLoader. Custom implementations are only queried for non-array types.

Built-in Encodings

Permazen provides built-in Encodings covering the following Java types:

  • Field Details

  • Constructor Details

    • DefaultEncodingRegistry

      public DefaultEncodingRegistry()
      Constructor.

      This constructor invokes initialize().

  • Method Details