class YamlPropertySourceFactory implements PropertySourceFactory {

    @Override
    public PropertySource<?> createPropertySource(@Nullable String name, EncodedResource encodedResource) {<FILL_FUNCTION_BODY>}
}

        YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
        factory.setResources(encodedResource.getResource());
        Properties properties = factory.getObject();
        if (Objects.isNull(properties)
                || StringUtils.isBlank(encodedResource.getResource().getFilename())) {
            return null;
        }
        return new PropertiesPropertySource(encodedResource.getResource().getFilename(), properties);
    
<no_super_class>