private static Mapping loadFrom(Node node, ConfigurationContext context) {
        final LoaderOptions loaderOptions = new LoaderOptions();
        loaderOptions.setMaxAliasesForCollections(context.getYamlMaxAliasesForCollections());
        loaderOptions.setCodePointLimit(context.getYamlCodePointLimit());
        final ModelConstructor constructor = new ModelConstructor(loaderOptions);
        constructor.setComposer(
                new Composer(
                        new ParserImpl(new StreamReader(Reader.nullReader()), loaderOptions),
                        new Resolver(),
                        loaderOptions) {

                    @Override
                    public Node getSingleNode() {
                        return node;
                    }
                });
        return (Mapping) constructor.getSingleData(Mapping.class);
    }
Load configuration-as-code model from a snakeyaml Node
plugin/src/main/java/io/jenkins/plugins/casc/yaml/YamlUtils.java