001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.databind.io.yaml;
007
008import com.fasterxml.jackson.core.JsonFactory;
009
010import gov.nist.secauto.metaschema.core.model.IBoundObject;
011import gov.nist.secauto.metaschema.databind.io.json.DefaultJsonSerializer;
012import gov.nist.secauto.metaschema.databind.io.yaml.impl.YamlFactoryFactory;
013import gov.nist.secauto.metaschema.databind.model.IBoundDefinitionModelAssembly;
014
015import edu.umd.cs.findbugs.annotations.NonNull;
016
017public class DefaultYamlSerializer<CLASS extends IBoundObject>
018    extends DefaultJsonSerializer<CLASS> {
019
020  /**
021   * Construct a new YAML serializer that will generate YAML content based on data
022   * in the bound class identified by the {@code classBinding}.
023   *
024   * @param definition
025   *          the bound class information for the Java type this serializer is
026   *          operating on
027   */
028  public DefaultYamlSerializer(@NonNull IBoundDefinitionModelAssembly definition) {
029    super(definition);
030  }
031
032  @Override
033  protected JsonFactory newFactoryInstance() {
034    return YamlFactoryFactory.newGeneratorFactoryInstance(getConfiguration());
035  }
036}