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.dataformat.yaml.YAMLFactory; 009 010import gov.nist.secauto.metaschema.core.model.IBoundObject; 011import gov.nist.secauto.metaschema.databind.io.json.DefaultJsonDeserializer; 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 DefaultYamlDeserializer<CLASS extends IBoundObject> 018 extends DefaultJsonDeserializer<CLASS> { 019 020 /** 021 * Construct a new YAML deserializer that will parse the bound class identified 022 * by the {@code classBinding}. 023 * 024 * @param definition 025 * the bound class information for the Java type this deserializer is 026 * operating on 027 */ 028 public DefaultYamlDeserializer(@NonNull IBoundDefinitionModelAssembly definition) { 029 super(definition); 030 } 031 032 /** 033 * {@inheritDoc} 034 * <p> 035 * This method provides a YAML version of the JSON factory. 036 * 037 * @return the factory 038 */ 039 @Override 040 protected YAMLFactory newFactoryInstance() { 041 return YamlFactoryFactory.newParserFactoryInstance(getConfiguration()); 042 } 043 044}