Class DefaultYamlSerializer<CLASS extends dev.metaschema.core.model.IBoundObject>

java.lang.Object
dev.metaschema.databind.io.AbstractSerializer<CLASS>
dev.metaschema.databind.io.json.DefaultJsonSerializer<CLASS>
dev.metaschema.databind.io.yaml.DefaultYamlSerializer<CLASS>
Type Parameters:
CLASS - the Java type of the bound object to serialize
All Implemented Interfaces:
dev.metaschema.core.configuration.IConfiguration<SerializationFeature<?>>, dev.metaschema.core.configuration.IMutableConfiguration<SerializationFeature<?>>, ISerializer<CLASS>

public class DefaultYamlSerializer<CLASS extends dev.metaschema.core.model.IBoundObject> extends DefaultJsonSerializer<CLASS>
Serializes bound Java objects to YAML content.
  • Constructor Details

    • DefaultYamlSerializer

      Construct a new YAML serializer that will generate YAML content based on data in the bound class identified by the classBinding.
      Parameters:
      definition - the bound class information for the Java type this serializer is operating on
  • Method Details

    • newFactoryInstance

      protected com.fasterxml.jackson.core.JsonFactory newFactoryInstance()
      Description copied from class: DefaultJsonSerializer
      Constructs a new JSON factory.

      Subclasses can override this method to create a JSON factory with a specific configuration.

      Overrides:
      newFactoryInstance in class DefaultJsonSerializer<CLASS extends dev.metaschema.core.model.IBoundObject>
      Returns:
      the factory
    • getBindingContext

      @NonNull protected IBindingContext getBindingContext()
      Retrieve the binding context associated with the serializer.
      Returns:
      the binding context
    • getDefinition

      @NonNull protected IBoundDefinitionModelAssembly getDefinition()
      Retrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.
      Returns:
      the class binding for the Module assembly
    • getConfiguration

      @NonNull protected dev.metaschema.core.configuration.IMutableConfiguration<SerializationFeature<?>> getConfiguration()
      Get the current configuration of the serializer/deserializer.
      Returns:
      the configuration
    • isFeatureEnabled

      public boolean isFeatureEnabled(SerializationFeature<?> feature)
      Specified by:
      isFeatureEnabled in interface dev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>
    • getFeatureValues

      public Map<SerializationFeature<?>,Object> getFeatureValues()
      Specified by:
      getFeatureValues in interface dev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>
    • get

      public <V> V get(SerializationFeature<?> feature)
      Specified by:
      get in interface dev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>